提交 2b2d1d66 authored 作者: lyl88's avatar lyl88 提交者: joe

cirat commit

上级 a93a5657
# Compiled class file target/
*.class .classpath
.factorypath
# Log file .project
*.log .settings
.springBeans
# BlueJ files \ No newline at end of file
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# runpoints ## 声明
\ No newline at end of file
源码只供学习使用,如用于商业活动与本人无关,请勿将系统用于非法业务
## 在线体验
h5端:http://223.247.221.197:8093
账号/密码:
普通会员:huiyuan1/123
代理账号:agent2/123
商户端:http://223.247.221.197:8095
账号/密码:tencent/123
后台管理:http://223.247.221.197:8094
账号/密码:zohar001/123
## 交流
可加qq了解完整版:781432868
## 截图
| 排行榜 | 我的主页 | 收款码 |
| :------: | :------: | :------: |
| ![排行榜](/实施输出/截图//1.png) | ![我的主页](/实施输出/截图/2.png) | ![收款码](/实施输出/截图/3.png) |
| 接单 | 切换收款码 | 审核 |
| :------: | :------: | :------: |
| ![接单](/实施输出/截图/4.png) | ![切换收款码](/实施输出/截图/5.png) | ![审核](/实施输出/截图/6.png) |
| 接单情况 | 代理中心 | 下级开户 |
| :------: | :------: | :------: |
| ![接单情况](/实施输出/截图/7.png) | ![代理中心](/实施输出/截图/8.png) | ![下级开户](/实施输出/截图/9.png) |
| 下级账号管理 | app账号密钥 | app监控通知 |
| :------: | :------: | :------: |
| ![下级账号管理](/实施输出/截图/10.png) | ![app账号密钥](/实施输出/截图/11.png) | ![app监控通知](/实施输出/截图/12.png) |
> 由于程序不断优化,界面细节可能有所变化,请以实际页面为准
> 作者不喝咖啡 :coffee: 只喝茶 :tea: 觉得有帮助的可以请我喝茶
| 支付宝 | 微信支付 |
| :------: | :------: |
| ![alipay](/实施输出/截图/alipay.jpg) | ![wepay](/实施输出/截图/wechant.png) |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.zohar</groupId>
<artifactId>runscore</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.1.1.RELEASE</spring-boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath />
</parent>
<modules>
<module>runscore-api</module>
<module>runscore-mobile</module>
<module>runscore-admin</module>
<module>runscore-merchant</module>
</modules>
</project>
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.zohar</groupId>
<artifactId>runscore</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>runscore-admin</artifactId>
<name>runscore-admin</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>me.zohar</groupId>
<artifactId>runscore-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- <exclusions> <exclusion> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> -->
</dependency>
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId>
</dependency> -->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package me.zohar;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
@SpringBootApplication
@EnableMethodCache(basePackages = "me.zohar.runscore")
@EnableCreateCacheAnnotation
public class AdminApplication implements ApplicationRunner {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
@Override
public void run(ApplicationArguments args) throws Exception {
}
}
package me.zohar.runscore;
import java.text.MessageFormat;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import me.zohar.runscore.common.utils.ThreadPoolUtils;
import me.zohar.runscore.constants.Constant;
import me.zohar.runscore.merchant.service.MerchantOrderService;
import me.zohar.runscore.rechargewithdraw.service.RechargeService;
@Slf4j
@Component
public class RedisMessageListener {
@Autowired
private StringRedisTemplate redisTemplate;
@Autowired
private RechargeService rechargeService;
@Autowired
private MerchantOrderService merchantOrderService;
@PostConstruct
public void init() {
listenRechargeSettlement();
listenPaidMerchantOrder();
}
public void listenRechargeSettlement() {
new Thread(() -> {
while (true) {
try {
String orderNo = redisTemplate.opsForList().rightPop(Constant.充值订单_已支付订单单号, 2L, TimeUnit.SECONDS);
if (StrUtil.isBlank(orderNo)) {
continue;
}
ThreadPoolUtils.getRechargeSettlementPool().execute(() -> {
try {
log.info("系统进行充值结算操作,订单单号为{}", orderNo);
rechargeService.rechargeOrderSettlement(orderNo);
} catch (Exception e) {
log.error(MessageFormat.format("系统进行充值结算操作出现异常,订单单号为{0}", orderNo), e);
throw new RuntimeException();
}
});
} catch (Exception e) {
log.error("充值结算消息队列异常", e);
}
}
}).start();
}
public void listenPaidMerchantOrder() {
new Thread(() -> {
while (true) {
try {
String orderId = redisTemplate.opsForList().rightPop(Constant.商户订单ID, 1300L, TimeUnit.MILLISECONDS);
if (StrUtil.isBlank(orderId)) {
continue;
}
ThreadPoolUtils.getPaidMerchantOrderPool().execute(() -> {
try {
log.info("商户订单支付成功异步通知,id为{}", orderId);
merchantOrderService.paySuccessAsynNotice(orderId);
} catch (Exception e) {
log.error(MessageFormat.format("商户订单支付成功异步通知异常,id为{0}", orderId), e);
throw new RuntimeException();
}
});
ThreadPoolUtils.getPaidMerchantOrderPool().execute(() -> {
try {
log.info("系统通知该订单进行返点结算,id为{}", orderId);
merchantOrderService.noticeOrderRebateSettlement(orderId);
} catch (Exception e) {
log.error(MessageFormat.format("系统通知该订单进行返点结算异常,id为{0}", orderId), e);
throw new RuntimeException();
}
});
} catch (Exception e) {
log.error("商户订单ID消息队列异常", e);
}
}
}).start();
new Thread(() -> {
while (true) {
try {
String orderRebateId = redisTemplate.opsForList().rightPop(Constant.订单返点ID, 2L, TimeUnit.SECONDS);
if (StrUtil.isBlank(orderRebateId)) {
continue;
}
ThreadPoolUtils.getPaidMerchantOrderPool().execute(() -> {
try {
log.info("系统进行订单返点结算操作,id为{}", orderRebateId);
merchantOrderService.orderRebateSettlement(orderRebateId);
} catch (Exception e) {
log.error(MessageFormat.format("系统进行订单返点结算操作出现异常,id为{0}", orderRebateId), e);
throw new RuntimeException();
}
});
} catch (Exception e) {
log.error("订单返点结算消息队列异常", e);
}
}
}).start();
}
}
package me.zohar.runscore.admin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class PageController {
@GetMapping("/")
public String index() {
return "statistical-analysis";
}
/**
* 登录页面
*
* @return
*/
@GetMapping("/login")
public String login() {
return "login";
}
/**
* 投注记录
*
* @return
*/
@GetMapping("/betting-record")
public String bettingRecord() {
return "betting-record";
}
/**
* 账号管理
*
* @return
*/
@GetMapping("/account-manage")
public String accountManage() {
return "account-manage";
}
/**
* 帐变日志
*
* @return
*/
@GetMapping("/account-change-log")
public String accountChangeLog() {
return "account-change-log";
}
/**
* 充值订单
*
* @return
*/
@GetMapping("/recharge-order")
public String rechargeOrder() {
return "recharge-order";
}
/**
* 提现记录
*
* @return
*/
@GetMapping("/withdraw-record")
public String withdrawRecord() {
return "withdraw-record";
}
/**
* 配置项管理
*
* @return
*/
@GetMapping("/config-manage")
public String configManage() {
return "config-manage";
}
/**
* 字典管理
*
* @return
*/
@GetMapping("/dict-manage")
public String dictManage() {
return "dict-manage";
}
/**
* 总控室
*
* @return
*/
@GetMapping("/master-control-room")
public String masterControlRoom() {
return "master-control-room";
}
/**
* 平台订单
*
* @return
*/
@GetMapping("/platform-order")
public String platformOrder() {
return "platform-order";
}
/**
* 接入商家
*
* @return
*/
@GetMapping("/merchant")
public String merchant() {
return "merchant";
}
/**
* 统计分析
*
* @return
*/
@GetMapping("/statistical-analysis")
public String statisticalAnalysis() {
return "statistical-analysis";
}
/**
* 收款码
*
* @return
*/
@GetMapping("/gathering-code")
public String gatheringCode() {
return "gathering-code";
}
/**
* 申诉记录
*
* @return
*/
@GetMapping("/appeal-record")
public String appealRecord() {
return "appeal-record";
}
@GetMapping("/appeal-details")
public String appealDetails() {
return "appeal-details";
}
@GetMapping("/pay-channel")
public String payChannel() {
return "pay-channel";
}
@GetMapping("/login-log")
public String loginLog() {
return "login-log";
}
/**
* 返点表
*
* @return
*/
@GetMapping("/rebate")
public String rebate() {
return "rebate";
}
}
package me.zohar.runscore.admin.dictconfig.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.dictconfig.DictHolder;
import me.zohar.runscore.dictconfig.param.AddOrUpdateDictTypeParam;
import me.zohar.runscore.dictconfig.param.ConfigItemQueryCondParam;
import me.zohar.runscore.dictconfig.param.ConfigParam;
import me.zohar.runscore.dictconfig.param.DictTypeQueryCondParam;
import me.zohar.runscore.dictconfig.param.UpdateDictDataParam;
import me.zohar.runscore.dictconfig.service.ConfigService;
import me.zohar.runscore.dictconfig.service.DictService;
@Controller
@RequestMapping("/dictconfig")
public class DictConfigController {
@Autowired
private ConfigService configService;
@Autowired
private DictService dictService;
@PostMapping("/updateDictData")
@ResponseBody
public Result updateDictData(@RequestBody UpdateDictDataParam param) {
dictService.updateDictData(param);
return Result.success();
}
@GetMapping("/findDictItemByDictTypeId")
@ResponseBody
public Result findDictItemByDictTypeId(String dictTypeId) {
return Result.success().setData(dictService.findDictItemByDictTypeId(dictTypeId));
}
@GetMapping("/delDictTypeById")
@ResponseBody
public Result delDictTypeById(String id) {
dictService.delDictTypeById(id);
return Result.success();
}
@PostMapping("/addOrUpdateDictType")
@ResponseBody
public Result addOrUpdateDictType(@RequestBody AddOrUpdateDictTypeParam param) {
dictService.addOrUpdateDictType(param);
return Result.success();
}
@GetMapping("/findDictTypeById")
@ResponseBody
public Result findDictTypeById(String id) {
return Result.success().setData(dictService.findDictTypeById(id));
}
@GetMapping("/findDictTypeByPage")
@ResponseBody
public Result findDictTypeByPage(DictTypeQueryCondParam param) {
return Result.success().setData(dictService.findDictTypeByPage(param));
}
@GetMapping("/findDictItemInCache")
@ResponseBody
public Result findDictItemInCache(String dictTypeCode) {
return Result.success().setData(DictHolder.findDictItem(dictTypeCode));
}
@GetMapping("/findConfigItemByPage")
@ResponseBody
public Result findConfigItemByPage(ConfigItemQueryCondParam param) {
return Result.success().setData(configService.findConfigItemByPage(param));
}
@GetMapping("/findConfigItemById")
@ResponseBody
public Result findConfigItemById(String id) {
return Result.success().setData(configService.findConfigItemById(id));
}
@PostMapping("/addOrUpdateConfig")
@ResponseBody
public Result addOrUpdateConfig(@RequestBody ConfigParam configParam) {
configService.addOrUpdateConfig(configParam);
return Result.success();
}
@GetMapping("/delConfigById")
@ResponseBody
public Result delConfigById(String id) {
configService.delConfigById(id);
return Result.success();
}
}
package me.zohar.runscore.admin.gatheringcode.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.gatheringcode.param.GatheringCodeParam;
import me.zohar.runscore.gatheringcode.param.GatheringCodeQueryCondParam;
import me.zohar.runscore.gatheringcode.service.GatheringCodeService;
@Controller
@RequestMapping("/gatheringCode")
public class GatheringCodeController {
@Autowired
private GatheringCodeService gatheringCodeService;
@GetMapping("/delGatheringCodeById")
@ResponseBody
public Result delGatheringCodeById(String id) {
gatheringCodeService.delGatheringCodeById(id);
return Result.success();
}
@GetMapping("/findGatheringCodeById")
@ResponseBody
public Result findMyGatheringCodeById(String id) {
return Result.success().setData(gatheringCodeService.findGatheringCodeById(id));
}
@PostMapping("/addOrUpdateGatheringCode")
@ResponseBody
public Result addOrUpdateGatheringCode(@RequestBody GatheringCodeParam param) {
gatheringCodeService.addOrUpdateGatheringCode(param);
return Result.success();
}
@GetMapping("/findGatheringCodeByPage")
@ResponseBody
public Result findGatheringCodeByPage(GatheringCodeQueryCondParam param) {
return Result.success().setData(gatheringCodeService.findGatheringCodeByPage(param));
}
}
package me.zohar.runscore.admin.invitecode.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/inviteCode")
public class InviteCodeController {
}
package me.zohar.runscore.admin.mastercontrol.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.mastercontrol.param.UpdateReceiveOrderSettingParam;
import me.zohar.runscore.mastercontrol.param.UpdateRechargeSettingParam;
import me.zohar.runscore.mastercontrol.param.UpdateRegisterSettingParam;
import me.zohar.runscore.mastercontrol.param.UpdateSystemSettingParam;
import me.zohar.runscore.mastercontrol.service.MasterControlService;
/**
* 总控
*
* @author zohar
* @date 2019年3月9日
*
*/
@Controller
@RequestMapping("/masterControl")
public class MasterControlController {
@Autowired
private MasterControlService service;
@GetMapping("/getSystemSetting")
@ResponseBody
public Result getSystemSetting() {
return Result.success().setData(service.getSystemSetting());
}
@PostMapping("/updateSystemSetting")
@ResponseBody
public Result updateSystemSetting(UpdateSystemSettingParam param) {
service.updateSystemSetting(param);
return Result.success();
}
@GetMapping("/getRegisterSetting")
@ResponseBody
public Result getRegisterSetting() {
return Result.success().setData(service.getRegisterSetting());
}
@PostMapping("/updateRegisterSetting")
@ResponseBody
public Result updateRegisterSetting(UpdateRegisterSettingParam param) {
service.updateRegisterSetting(param);
return Result.success();
}
@GetMapping("/getReceiveOrderSetting")
@ResponseBody
public Result getReceiveOrderSetting() {
return Result.success().setData(service.getReceiveOrderSetting());
}
@PostMapping("/updateReceiveOrderSetting")
@ResponseBody
public Result updateReceiveOrderSetting(UpdateReceiveOrderSettingParam param) {
service.updateReceiveOrderSetting(param);
return Result.success();
}
@GetMapping("/getRechargeSetting")
@ResponseBody
public Result getRechargeSetting() {
return Result.success().setData(service.getRechargeSetting());
}
@PostMapping("/updateRechargeSetting")
@ResponseBody
public Result updateRechargeSetting(UpdateRechargeSettingParam param) {
service.updateRechargeSetting(param);
return Result.success();
}
@GetMapping("/getCustomerQrcodeSetting")
@ResponseBody
public Result getCustomerQrcodeSetting() {
return Result.success().setData(service.getCustomerQrcodeSetting());
}
@PostMapping("/updateCustomerQrcodeSetting")
@ResponseBody
public Result updateCustomerQrcodeSetting(String qrcodeStorageIds) {
service.updateCustomerQrcodeSetting(qrcodeStorageIds);
return Result.success();
}
@PostMapping("/refreshCache")
@ResponseBody
public Result refreshCache(@RequestBody List<String> cacheItems) {
service.refreshCache(cacheItems);
return Result.success();
}
}
package me.zohar.runscore.admin.merchant.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.merchant.param.AppealQueryCondParam;
import me.zohar.runscore.merchant.service.AppealService;
@Controller
@RequestMapping("/appeal")
public class AppealController {
@Autowired
private AppealService appealService;
@GetMapping("/findTop5TodoAppealByPage")
@ResponseBody
public Result findTop5TodoAppealByPage() {
return Result.success().setData(appealService.findTop5TodoAppealByPage());
}
@GetMapping("/dontProcess")
@ResponseBody
public Result dontProcess(String appealId) {
appealService.dontProcess(appealId);
return Result.success();
}
@GetMapping("/cancelOrder")
@ResponseBody
public Result cancelOrder(String appealId) {
appealService.cancelOrder(appealId);
return Result.success();
}
@GetMapping("/alterToActualPayAmount")
@ResponseBody
public Result alterToActualPayAmount(String appealId) {
appealService.alterToActualPayAmount(appealId);
return Result.success();
}
@GetMapping("/confirmToPaid")
@ResponseBody
public Result confirmToPaid(String appealId) {
appealService.confirmToPaid(appealId);
return Result.success();
}
@GetMapping("/findAppealByPage")
@ResponseBody
public Result findAppealByPage(AppealQueryCondParam param) {
return Result.success().setData(appealService.findAppealByPage(param));
}
@GetMapping("/findAppealDetailsById")
@ResponseBody
public Result findAppealDetailsById(String id) {
return Result.success().setData(appealService.findAppealDetailsById(id));
}
}
package me.zohar.runscore.admin.merchant.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.merchant.param.AddOrUpdateMerchantParam;
import me.zohar.runscore.merchant.param.MerchantQueryCondParam;
import me.zohar.runscore.merchant.service.MerchantService;
@Controller
@RequestMapping("/merchant")
public class MerchantController {
@Autowired
private MerchantService merchantService;
@PostMapping("/addOrUpdateMerchant")
@ResponseBody
public Result addOrUpdatePlatform(AddOrUpdateMerchantParam param) {
merchantService.addOrUpdateMerchant(param);
return Result.success();
}
@GetMapping("/findMerchantById")
@ResponseBody
public Result findPlatformById(String id) {
return Result.success().setData(merchantService.findPlatformById(id));
}
@GetMapping("/delMerchantById")
@ResponseBody
public Result delPlatformById(String id) {
merchantService.delMerchantById(id);
return Result.success();
}
@GetMapping("/findMerchantByPage")
@ResponseBody
public Result findPlatformOrderByPage(MerchantQueryCondParam param) {
return Result.success().setData(merchantService.findMerchantByPage(param));
}
}
package me.zohar.runscore.admin.merchant.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.merchant.param.MerchantOrderQueryCondParam;
import me.zohar.runscore.merchant.service.MerchantOrderService;
@Controller
@RequestMapping("/platformOrder")
public class MerchantOrderController {
@Autowired
private MerchantOrderService platformOrderService;
@GetMapping("/findPlatformOrderByPage")
@ResponseBody
public Result findPlatformOrderByPage(MerchantOrderQueryCondParam param) {
return Result.success().setData(platformOrderService.findMerchantOrderByPage(param));
}
@GetMapping("/cancelOrder")
@ResponseBody
public Result cancelOrder(String id) {
platformOrderService.cancelOrder(id);
return Result.success();
}
@GetMapping("/resendNotice")
@ResponseBody
public Result resendNotice(String id) {
platformOrderService.paySuccessAsynNotice(id);
return Result.success();
}
}
package me.zohar.runscore.admin.rechargewithdraw.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.rechargewithdraw.param.AddOrUpdatePayChannelParam;
import me.zohar.runscore.rechargewithdraw.param.AddOrUpdatePayTypeParam;
import me.zohar.runscore.rechargewithdraw.param.RechargeOrderQueryCondParam;
import me.zohar.runscore.rechargewithdraw.service.PayChannelService;
import me.zohar.runscore.rechargewithdraw.service.RechargeService;
/**
*
* @author zohar
* @date 2019年1月21日
*
*/
@Controller
@RequestMapping("/recharge")
public class RechargeController {
@Autowired
private RechargeService rechargeService;
@Autowired
private PayChannelService payChannelService;
@GetMapping("/findRechargeOrderByPage")
@ResponseBody
public Result findRechargeOrderByPage(RechargeOrderQueryCondParam param) {
return Result.success().setData(rechargeService.findRechargeOrderByPage(param));
}
@GetMapping("/cancelOrder")
@ResponseBody
public Result cancelOrder(String id) {
rechargeService.cancelOrder(id);
return Result.success();
}
@GetMapping("/manualSettlement")
@ResponseBody
public Result manualSettlement(String orderNo) {
rechargeService.manualSettlement(orderNo);
return Result.success();
}
@GetMapping("/findRechargeOrderById")
@ResponseBody
public Result findRechargeOrderById(String id) {
return Result.success().setData(rechargeService.findRechargeOrderById(id));
}
@PostMapping("/approval")
@ResponseBody
public Result approval(String id, Double actualPayAmount, String approvalResult) {
rechargeService.approval(id, actualPayAmount, approvalResult);
return Result.success();
}
@GetMapping("/findAllPayType")
@ResponseBody
public Result findAllPayType() {
return Result.success().setData(payChannelService.findAllPayType());
}
@GetMapping("/findAllPayChannel")
@ResponseBody
public Result findAllPayChannel() {
return Result.success().setData(payChannelService.findAllPayChannel());
}
@PostMapping("/addOrUpdatePayType")
@ResponseBody
public Result addOrUpdatePayType(@RequestBody AddOrUpdatePayTypeParam param) {
payChannelService.addOrUpdatePayType(param);
return Result.success();
}
@GetMapping("/findPayTypeById")
@ResponseBody
public Result findPayTypeById(String id) {
return Result.success().setData(payChannelService.findPayTypeById(id));
}
@GetMapping("/delPayTypeById")
@ResponseBody
public Result delPayTypeById(String id) {
payChannelService.delPayTypeById(id);
return Result.success();
}
@PostMapping("/addOrUpdatePayChannel")
@ResponseBody
public Result addOrUpdatePayChannel(@RequestBody AddOrUpdatePayChannelParam param) {
payChannelService.addOrUpdatePayChannel(param);
return Result.success();
}
@GetMapping("/findPayChannelById")
@ResponseBody
public Result findPayChannelById(String id) {
return Result.success().setData(payChannelService.findPayChannelById(id));
}
@GetMapping("/delPayChannelById")
@ResponseBody
public Result delPayChannelById(String id) {
payChannelService.delPayChannelById(id);
return Result.success();
}
}
package me.zohar.runscore.admin.rechargewithdraw.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.rechargewithdraw.param.WithdrawRecordQueryCondParam;
import me.zohar.runscore.rechargewithdraw.service.WithdrawService;
@Controller
@RequestMapping("/withdraw")
public class WithdrawController {
@Autowired
private WithdrawService withdrawService;
@GetMapping("/approved")
@ResponseBody
public Result approved(String id, String note) {
withdrawService.approved(id, note);
return Result.success();
}
@GetMapping("/notApproved")
@ResponseBody
public Result notApproved(String id, String note) {
withdrawService.notApproved(id, note);
return Result.success();
}
@GetMapping("/confirmCredited")
@ResponseBody
public Result confirmCredited(String id) {
withdrawService.confirmCredited(id);
return Result.success();
}
@GetMapping("/findWithdrawRecordByPage")
@ResponseBody
public Result findWithdrawRecordByPage(WithdrawRecordQueryCondParam param) {
return Result.success().setData(withdrawService.findWithdrawRecordByPage(param));
}
}
package me.zohar.runscore.admin.statisticalanalysis.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.statisticalanalysis.service.StatisticalAnalysisService;
@Controller
@RequestMapping("/statisticalAnalysis")
public class StatisticalAnalysisController {
@Autowired
private StatisticalAnalysisService statisticalAnalysisService;
@GetMapping("/findTodayTop10BountyRank")
@ResponseBody
public Result findTodayTop10BountyRank() {
return Result.success().setData(statisticalAnalysisService.findTodayTop10BountyRank());
}
@GetMapping("/findTotalTop10BountyRank")
@ResponseBody
public Result findTotalTop10BountyRank() {
return Result.success().setData(statisticalAnalysisService.findTotalTop10BountyRank());
}
@GetMapping("/findTotalCashDeposit")
@ResponseBody
public Result findTotalCashDeposit() {
return Result.success().setData(statisticalAnalysisService.findTotalCashDeposit());
}
@GetMapping("/findTotalStatistical")
@ResponseBody
public Result findTotalStatistical() {
return Result.success().setData(statisticalAnalysisService.findTotalStatistical());
}
@GetMapping("/findMonthStatistical")
@ResponseBody
public Result findMonthStatistical() {
return Result.success().setData(statisticalAnalysisService.findMonthStatistical());
}
@GetMapping("/findTodayStatistical")
@ResponseBody
public Result findTodayStatistical() {
return Result.success().setData(statisticalAnalysisService.findTodayStatistical());
}
}
package me.zohar.runscore.admin.storage.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import cn.hutool.core.util.ArrayUtil;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.storage.service.StorageService;
import me.zohar.runscore.storage.vo.StorageVO;
@Controller
@RequestMapping("/storage")
public class StorageController {
@Autowired
private StorageService storageService;
@GetMapping("/fetch/{id:.+}")
public ResponseEntity<Resource> fetch(@PathVariable String id) {
StorageVO vo = storageService.findById(id);
if (vo == null) {
return ResponseEntity.notFound().build();
}
String fileType = vo.getFileType();
MediaType mediaType = MediaType.parseMediaType(fileType);
Resource file = storageService.loadAsResource(vo.getId());
if (file == null) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok().contentType(mediaType).body(file);
}
@PostMapping("/uploadPic")
@ResponseBody
public Result uploadPic(@RequestParam("file_data") MultipartFile[] files) throws IOException {
if (ArrayUtil.isEmpty(files)) {
return Result.fail("请选择要上传的图片");
}
List<String> storageIds = new ArrayList<>();
for (MultipartFile file : files) {
String filename = file.getOriginalFilename();
String storageId = storageService.uploadGatheringCode(file.getInputStream(), file.getSize(),
file.getContentType(), filename);
storageIds.add(storageId);
}
return Result.success().setData(storageIds);
}
}
package me.zohar.runscore.admin.useraccount.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.agent.param.AddOrUpdateRebateParam;
import me.zohar.runscore.agent.service.AgentService;
import me.zohar.runscore.common.param.PageParam;
import me.zohar.runscore.common.vo.Result;
@Controller
@RequestMapping("/agent")
public class AgentController {
@Autowired
private AgentService agentService;
@GetMapping("/findAllRebate")
@ResponseBody
public Result findAllRebate() {
return Result.success().setData(agentService.findAllRebate());
}
@GetMapping("/findRebateSituationByPage")
@ResponseBody
public Result findRebateSituationByPage(PageParam param) {
return Result.success().setData(agentService.findRebateSituationByPage(param));
}
@PostMapping("/resetRebate")
@ResponseBody
public Result resetRebate(@RequestBody List<AddOrUpdateRebateParam> params) {
agentService.resetRebate(params);
return Result.success();
}
@GetMapping("/findRebate")
@ResponseBody
public Result findRebate(Double rebate) {
return Result.success().setData(agentService.findRebate(rebate));
}
@PostMapping("/addOrUpdateRebate")
@ResponseBody
public Result addOrUpdateRebate(@RequestBody AddOrUpdateRebateParam param) {
agentService.addOrUpdateRebate(param);
return Result.success();
}
@GetMapping("/delRebate")
@ResponseBody
public Result delRebate(Double rebate) {
agentService.delRebate(rebate);
return Result.success();
}
}
package me.zohar.runscore.admin.useraccount.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.config.security.UserAccountDetails;
import me.zohar.runscore.useraccount.param.AccountChangeLogQueryCondParam;
import me.zohar.runscore.useraccount.param.AddUserAccountParam;
import me.zohar.runscore.useraccount.param.AdjustCashDepositParam;
import me.zohar.runscore.useraccount.param.BindBankInfoParam;
import me.zohar.runscore.useraccount.param.LoginLogQueryCondParam;
import me.zohar.runscore.useraccount.param.UserAccountEditParam;
import me.zohar.runscore.useraccount.param.UserAccountQueryCondParam;
import me.zohar.runscore.useraccount.service.LoginLogService;
import me.zohar.runscore.useraccount.service.UserAccountService;
import me.zohar.runscore.useraccount.vo.UserAccountInfoVO;
@Controller
@RequestMapping("/userAccount")
public class UserAccountController {
@Autowired
private UserAccountService userAccountService;
@Autowired
private LoginLogService loginLogService;
@GetMapping("/findLoginLogByPage")
@ResponseBody
public Result findLoginLogByPage(LoginLogQueryCondParam param) {
return Result.success().setData(loginLogService.findLoginLogByPage(param));
}
@GetMapping("/findAccountChangeLogByPage")
@ResponseBody
public Result findAccountChangeLogByPage(AccountChangeLogQueryCondParam param) {
return Result.success().setData(userAccountService.findAccountChangeLogByPage(param));
}
@GetMapping("/findUserAccountDetailsInfoById")
@ResponseBody
public Result findUserAccountDetailsInfoById(String userAccountId) {
return Result.success().setData(userAccountService.findUserAccountDetailsInfoById(userAccountId));
}
@GetMapping("/findUserAccountDetailsInfoByPage")
@ResponseBody
public Result findUserAccountDetailsInfoByPage(UserAccountQueryCondParam param) {
return Result.success().setData(userAccountService.findUserAccountDetailsInfoByPage(param));
}
@PostMapping("/bindBankInfo")
@ResponseBody
public Result bindBankInfo(BindBankInfoParam param) {
userAccountService.bindBankInfo(param);
return Result.success();
}
@GetMapping("/getBankInfo")
@ResponseBody
public Result getBankInfo(String userAccountId) {
return Result.success().setData(userAccountService.getBankInfo(userAccountId));
}
@PostMapping("/modifyLoginPwd")
@ResponseBody
public Result modifyLoginPwd(String userAccountId, String newLoginPwd) {
userAccountService.modifyLoginPwd(userAccountId, newLoginPwd);
return Result.success();
}
@PostMapping("/modifyMoneyPwd")
@ResponseBody
public Result modifyMoneyPwd(String userAccountId, String newMoneyPwd) {
userAccountService.modifyMoneyPwd(userAccountId, newMoneyPwd);
return Result.success();
}
@PostMapping("/updateUserAccount")
@ResponseBody
public Result updateUserAccount(UserAccountEditParam param) {
userAccountService.updateUserAccount(param);
return Result.success();
}
@GetMapping("/getUserAccountInfo")
@ResponseBody
public Result getUserAccountInfo() {
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if ("anonymousUser".equals(principal)) {
return Result.success();
}
UserAccountDetails user = (UserAccountDetails) principal;
UserAccountInfoVO userAccountInfo = userAccountService.getUserAccountInfo(user.getUserAccountId());
return Result.success().setData(userAccountInfo);
}
@GetMapping("/delUserAccount")
@ResponseBody
public Result delUserAccount(String userAccountId) {
userAccountService.delUserAccount(userAccountId);
return Result.success();
}
@PostMapping("/addUserAccount")
@ResponseBody
public Result addUserAccount(AddUserAccountParam param) {
userAccountService.addUserAccount(param);
return Result.success();
}
@PostMapping("/adjustCashDeposit")
@ResponseBody
public Result adjustCashDeposit(AdjustCashDepositParam param) {
userAccountService.adjustCashDeposit(param);
return Result.success();
}
}
package me.zohar.runscore.config.schedule;
import java.util.concurrent.Executors;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
@EnableScheduling
@Configuration
public class ScheduleConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(Executors.newScheduledThreadPool(5));
}
}
\ No newline at end of file
package me.zohar.runscore.config.security;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import me.zohar.runscore.common.vo.Result;
/**
* 登录失败处理类
*
* @author zohar
* @date 2019年1月23日
*
*/
@Component
public class AuthenticationFailHandler extends SimpleUrlAuthenticationFailureHandler {
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException e) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
PrintWriter out = response.getWriter();
out.println(JSONObject.toJSONString(Result.fail(500, e.getMessage())));
out.flush();
out.close();
}
}
package me.zohar.runscore.config.security;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import me.zohar.runscore.common.vo.Result;
import me.zohar.runscore.constants.Constant;
/**
* 登录成功处理类
*
* @author zohar
* @date 2019年1月23日
*
*/
@Component
public class AuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
PrintWriter out = response.getWriter();
out.println(JSONObject.toJSONString(Result.success().setMsg(Constant.登录提示_登录成功)));
out.flush();
out.close();
}
}
package me.zohar.runscore.config.security;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import cn.hutool.http.HttpUtil;
import cn.hutool.http.useragent.UserAgentUtil;
import me.zohar.runscore.constants.Constant;
import me.zohar.runscore.useraccount.service.LoginLogService;
import me.zohar.runscore.useraccount.service.UserAccountService;
import me.zohar.runscore.useraccount.vo.LoginAccountInfoVO;
@Component
public class CustomAuthenticationProvider implements AuthenticationProvider {
@Autowired
private UserAccountService userAccountService;
@Autowired
private LoginLogService loginLogService;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes())
.getRequest();
UsernamePasswordAuthenticationToken token = (UsernamePasswordAuthenticationToken) authentication;
String username = token.getName();
LoginAccountInfoVO loginAccountInfo = userAccountService.getLoginAccountInfo(username);
if (loginAccountInfo == null) {
loginLogService.recordLoginLog(username, Constant.系统_后台管理, Constant.登录状态_失败, Constant.登录提示_用户名不存在,
HttpUtil.getClientIP(request), UserAgentUtil.parse(request.getHeader("User-Agent")));
throw new AuthenticationServiceException("用户名或密码不正确");
}
if (!Constant.账号类型_管理员.equals(loginAccountInfo.getAccountType())) {
loginLogService.recordLoginLog(loginAccountInfo.getUserName(), Constant.系统_后台管理, Constant.登录状态_失败,
Constant.登录提示_不是管理员无法登陆后台, HttpUtil.getClientIP(request),
UserAgentUtil.parse(request.getHeader("User-Agent")));
throw new AuthenticationServiceException(Constant.登录提示_不是管理员无法登陆后台);
}
if (!new BCryptPasswordEncoder().matches(token.getCredentials().toString(), loginAccountInfo.getLoginPwd())) {
loginLogService.recordLoginLog(loginAccountInfo.getUserName(), Constant.系统_后台管理, Constant.登录状态_失败,
Constant.登录提示_用户名或密码不正确, HttpUtil.getClientIP(request),
UserAgentUtil.parse(request.getHeader("User-Agent")));
throw new AuthenticationServiceException(Constant.登录提示_用户名或密码不正确);
}
if (Constant.账号状态_禁用.equals(loginAccountInfo.getState())) {
loginLogService.recordLoginLog(loginAccountInfo.getUserName(), Constant.系统_后台管理, Constant.登录状态_失败,
Constant.登录提示_账号已被禁用, HttpUtil.getClientIP(request),
UserAgentUtil.parse(request.getHeader("User-Agent")));
throw new AuthenticationServiceException(Constant.登录提示_账号已被禁用);
}
loginLogService.recordLoginLog(loginAccountInfo.getUserName(), Constant.系统_后台管理, Constant.登录状态_成功,
Constant.登录提示_登录成功, HttpUtil.getClientIP(request),
UserAgentUtil.parse(request.getHeader("User-Agent")));
userAccountService.updateLatelyLoginTime(loginAccountInfo.getId());
UserAccountDetails userAccountDetails = new UserAccountDetails(loginAccountInfo);
return new UsernamePasswordAuthenticationToken(userAccountDetails, userAccountDetails.getPassword(),
userAccountDetails.getAuthorities());
}
@Override
public boolean supports(Class<?> authentication) {
return UsernamePasswordAuthenticationToken.class.equals(authentication);
}
}
package me.zohar.runscore.config.security;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import me.zohar.runscore.common.vo.Result;
/**
* 退出登录处理类
*
* @author zohar
* @date 2019年1月23日
*
*/
@Component
public class LogoutHandler implements LogoutSuccessHandler {
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
throws IOException, ServletException {
System.out.println("logout....");
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
PrintWriter out = response.getWriter();
out.println(JSONObject.toJSONString(Result.success().setMsg("退出成功")));
out.flush();
out.close();
}
}
package me.zohar.runscore.config.security;
import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import me.zohar.runscore.useraccount.vo.LoginAccountInfoVO;
public class UserAccountDetails implements UserDetails {
/**
*
*/
private static final long serialVersionUID = 1L;
private String id;
private String userName;
private String loginPwd;
public UserAccountDetails(LoginAccountInfoVO loginAccountInfo) {
if (loginAccountInfo != null) {
this.id = loginAccountInfo.getId();
this.userName = loginAccountInfo.getUserName();
this.loginPwd = loginAccountInfo.getLoginPwd();
}
}
/**
* 获取登陆用户账号id
*
* @return
*/
public String getUserAccountId() {
return this.id;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return null;
}
@Override
public String getPassword() {
return this.loginPwd;
}
@Override
public String getUsername() {
return this.userName;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
package me.zohar.runscore.config.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private CustomAuthenticationProvider customAuthenticationProvider;
@Autowired
private AuthenticationSuccessHandler successHandler;
@Autowired
private AuthenticationFailHandler failHandler;
@Autowired
private LogoutHandler logoutHandler;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers().frameOptions().disable()
.and()
.authorizeRequests()
.antMatchers("/login").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/login").loginProcessingUrl("/login")
.successHandler(successHandler).failureHandler(failHandler).permitAll()
.and().logout().logoutUrl("/logout").logoutSuccessHandler(logoutHandler).permitAll();
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/css/**", "/images/**", "/js/**", "/plugins/**", "/audio/**");
}
@Override
protected void configure(AuthenticationManagerBuilder builder) throws Exception {
builder.authenticationProvider(customAuthenticationProvider);
}
}
package me.zohar.runscore.config.security.xss;
import javax.servlet.Filter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
@Configuration
public class XssConfig {
@Bean
public FilterRegistrationBean<Filter> xssFilterRegistrationBean() {
FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<Filter>(new XssFilter());
filterRegistrationBean.setOrder(1);
filterRegistrationBean.setEnabled(true);
filterRegistrationBean.addUrlPatterns("/*");
return filterRegistrationBean;
}
@Bean
@Primary
public ObjectMapper xssObjectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
SimpleModule xssModule = new SimpleModule();
xssModule.addSerializer(new XssStringJsonSerializer());
objectMapper.registerModule(xssModule);
return objectMapper;
}
}
\ No newline at end of file
package me.zohar.runscore.config.security.xss;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
/**
* Xss攻击过滤器
*
*/
public class XssFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
String path = httpRequest.getServletPath();
String[] exclusionsUrls = { ".js", ".gif", ".jpg", ".png", ".css", ".ico" };
for (String str : exclusionsUrls) {
if (path.contains(str)) {
chain.doFilter(request, response);
return;
}
}
chain.doFilter(new XssHttpServletRequestWrapper(httpRequest), response);
}
@Override
public void destroy() {
}
}
package me.zohar.runscore.config.security.xss;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import cn.hutool.core.util.EscapeUtil;
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
public XssHttpServletRequestWrapper(HttpServletRequest request) {
super(request);
}
@Override
public String getHeader(String name) {
String value = super.getParameter(name);
if (value != null) {
value = EscapeUtil.escapeHtml4(value);
}
return value;
}
@Override
public String getQueryString() {
String value = super.getQueryString();
if (value != null) {
value = EscapeUtil.escapeHtml4(value);
}
return value;
}
@Override
public String getParameter(String name) {
String value = super.getParameter(name);
if (value != null) {
value = EscapeUtil.escapeHtml4(value);
}
return value;
}
@Override
public String[] getParameterValues(String name) {
String[] values = super.getParameterValues(name);
if (values != null) {
int length = values.length;
String[] escapseValues = new String[length];
for (int i = 0; i < length; i++) {
escapseValues[i] = EscapeUtil.escapeHtml4(values[i]);
}
return escapseValues;
}
return values;
}
}
package me.zohar.runscore.config.security.xss;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import cn.hutool.core.util.EscapeUtil;
public class XssStringJsonSerializer extends JsonSerializer<String> {
@Override
public Class<String> handledType() {
return String.class;
}
@Override
public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
throws IOException {
if (value != null) {
String encodedValue = EscapeUtil.escapeHtml4(value);
jsonGenerator.writeString(encodedValue);
}
}
}
package me.zohar.runscore.task.merchant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import me.zohar.runscore.merchant.service.MerchantOrderService;
@Component
@Slf4j
public class MerchantOrderTimeoutDealTask {
@Autowired
private MerchantOrderService merchantOrderService;
//@Scheduled(fixedRate = 3000)
public void execute() {
try {
log.info("商户订单超时处理定时任务start");
merchantOrderService.orderTimeoutDeal();
log.info("商户订单超时处理定时任务end");
} catch (Exception e) {
log.error("商户订单超时处理定时任务", e);
}
}
}
package me.zohar.runscore.task.merchant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import me.zohar.runscore.merchant.service.MerchantOrderService;
@Component
@Slf4j
public class OrderRebateAutoSettlementTask {
@Autowired
private MerchantOrderService merchantOrderService;
//@Scheduled(fixedRate = 50000)
public void execute() {
try {
log.info("订单返点自动结算定时任务start");
merchantOrderService.orderRebateAutoSettlement();
log.info("订单返点自动结算定时任务end");
} catch (Exception e) {
log.error("订单返点自动结算定时任务", e);
}
}
}
package me.zohar.runscore.task.rechargewithdraw;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import me.zohar.runscore.rechargewithdraw.service.RechargeService;
/**
* 充值订单自动结算定时任务
*
* @author zohar
* @date 2019年1月21日
*
*/
@Component
@Slf4j
public class RechargeOrderAutoSettlementTask {
@Autowired
private RechargeService rechargeService;
//@Scheduled(fixedRate = 60000)
public void execute() {
try {
log.info("充值订单自动结算定时任务start");
rechargeService.rechargeOrderAutoSettlement();
log.info("充值订单自动结算定时任务end");
} catch (Exception e) {
log.error("充值订单自动结算定时任务", e);
}
}
}
package me.zohar.runscore.task.rechargewithdraw;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import me.zohar.runscore.rechargewithdraw.service.RechargeService;
/**
* 充值订单超时处理定时任务
*
* @author zohar
* @date 2019年1月21日
*
*/
@Component
@Slf4j
public class RechargeOrderTimeoutDealTask {
@Autowired
private RechargeService rechargeService;
//@Scheduled(fixedRate = 60000)
public void execute() {
try {
log.info("充值订单超时处理定时任务start");
rechargeService.orderTimeoutDeal();
log.info("充值订单超时处理定时任务end");
} catch (Exception e) {
log.error("充值订单超时处理定时任务", e);
}
}
}
server:
port: 8081
servlet:
session:
cookie:
name: sessionid_admin
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/runscore?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: 123456
driverClassName: com.mysql.cj.jdbc.Driver
jpa:
show-sql: true
generate-ddl: true
hibernate:
ddl-auto: none
properties:
javax:
persistence:
validation:
mode: none
thymeleaf:
cache: false
redis:
port: 6379
host: localhost
session:
store-type: redis
timeout: 7200s
redisson:
singleServerConfig:
address: 127.0.0.1:6379
jetcache:
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
uri: redis://127.0.0.1:6379/
\ No newline at end of file
@charset "UTF-8";
[v-cloak] {
display: none;
}
a {
cursor: pointer;
}
.modal-mask {
position: fixed;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: table;
transition: opacity .3s ease;
}
.modal-wrapper {
display: table-cell;
vertical-align: middle;
}
.fixed-table-header {
background-color: #dedede;
}
.common-query-cond-form {
padding-left: 25px;
padding-right: 25px;
padding-top: 8px;
padding-bottom: 8px;
display: inline-flex;
}
.common-query-cond {
padding-right: 30px;
}
.common-query-cond label {
padding-right: 5px;
}
.common-query-cond span {
padding-left: 2px;
padding-right: 2px;
}
.common-table {
border-bottom: 0 !important;
}
.common-table thead th {
border-top: 0;
border-bottom: 0;
text-align: center;
color: #666;
font-size: 14px;
font-weight: normal;
background-color: #dedede;
}
.common-table tr td {
text-align: center;
border-top: 0;
color: #666;
border-bottom: 1px dashed #a0a0a0;
border-left: 0;
}
/*bootstrap table插件detailView样式start*/
.table-detail .row {
padding-bottom: 10px;
width: 1200px;
}
.table-detail-item-label {
text-align: end;
}
.table-detail-item-value {
word-wrap: break-word;
text-align: start;
}
/*bootstrap table插件detailView样式end*/
\ No newline at end of file
var accountChangeLogVM = new Vue({
el : '#account-change-log',
data : {
accountChangeTypeCode : '',
accountChangeTypeDictItems : [],
userName : '',
accountChangeStartTime : dayjs().format('YYYY-MM-DD'),
accountChangeEndTime : dayjs().format('YYYY-MM-DD')
},
computed : {},
created : function() {
},
mounted : function() {
this.loadAccountChangeTypeDictItem();
this.initTable();
},
methods : {
/**
* 加载账变类型字典项
*/
loadAccountChangeTypeDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'accountChangeType'
}
}).then(function(res) {
this.accountChangeTypeDictItems = res.body.data;
});
},
initTable : function() {
var that = this;
$('.account-change-log-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/userAccount/findAccountChangeLogByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
accountChangeTypeCode : that.accountChangeTypeCode,
userName : that.userName,
startTime : that.accountChangeStartTime,
endTime : that.accountChangeEndTime
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'userName',
title : '用户名'
}, {
field : 'orderNo',
title : '订单号'
}, {
field : 'accountChangeTypeName',
title : '帐变类型'
}, {
field : 'accountChangeTime',
title : '账变时间'
}, {
field : 'note',
title : '备注'
}, {
field : 'accountChangeAmount',
title : '账变金额'
}, {
field : 'cashDeposit',
title : '保证金'
} ]
});
},
refreshTable : function() {
$('.account-change-log-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
}
}
});
\ No newline at end of file
var appealDetailsVM = new Vue({
el : '#appeal-details',
data : {
showAppealRecordFlag : true,
selectAppeal : {}
},
computed : {},
created : function() {
},
mounted : function() {
var id = getQueryString('id');
this.loadAppealDetails(id);
},
methods : {
loadAppealDetails : function(id) {
var that = this;
that.$http.get('/appeal/findAppealDetailsById', {
params : {
id : id
}
}).then(function(res) {
that.selectAppeal = res.body.data;
});
},
dontProcess : function(appealId) {
var that = this;
that.$http.get('/appeal/dontProcess', {
params : {
appealId : appealId
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
window.history.back(-1);
});
},
cancelOrder : function(appealId) {
var that = this;
that.$http.get('/appeal/cancelOrder', {
params : {
appealId : appealId
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
window.history.back(-1);
});
},
alterToActualPayAmount : function(appealId) {
var that = this;
that.$http.get('/appeal/alterToActualPayAmount', {
params : {
appealId : appealId
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
window.history.back(-1);
});
},
confirmToPaid : function(appealId) {
var that = this;
that.$http.get('/appeal/confirmToPaid', {
params : {
appealId : appealId
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
window.history.back(-1);
});
},
viewImage : function(imagePath) {
var image = new Image();
image.src = imagePath;
var viewer = new Viewer(image, {
hidden : function() {
viewer.destroy();
},
});
viewer.show();
}
}
});
\ No newline at end of file
var appealRecordVM = new Vue({
el : '#appeal-record',
data : {
orderNo : '',
merchantName : '',
gatheringChannelCode : '',
gatheringChannelDictItems : [],
receiverUserName : '',
appealType : '',
appealTypeDictItems : [],
appealState : '',
appealStateDictItems : [],
appealProcessWay : '',
appealProcessWayDictItems : [],
initiationStartTime : dayjs().format('YYYY-MM-DD'),
initiationEndTime : dayjs().format('YYYY-MM-DD')
},
computed : {},
created : function() {
},
mounted : function() {
var appealState = getQueryString('appealState');
if (appealState == '1') {
this.appealState = appealState;
this.initiationStartTime = '';
this.initiationEndTime = '';
}
this.loadGatheringChannelDictItem();
this.loadAppealTypeDictItem();
this.loadAppealStateDictItem();
this.loadAppealProcessWayDictItem();
this.initTable();
},
methods : {
/**
* 加载收款渠道字典项
*/
loadGatheringChannelDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'gatheringChannel'
}
}).then(function(res) {
this.gatheringChannelDictItems = res.body.data;
});
},
loadAppealTypeDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'appealType'
}
}).then(function(res) {
this.appealTypeDictItems = res.body.data;
});
},
loadAppealStateDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'appealState'
}
}).then(function(res) {
this.appealStateDictItems = res.body.data;
});
},
loadAppealProcessWayDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'appealProcessWay'
}
}).then(function(res) {
this.appealProcessWayDictItems = res.body.data;
});
},
initTable : function() {
var that = this;
$('.appeal-record-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/appeal/findAppealByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
orderNo : that.orderNo,
merchantName : that.merchantName,
gatheringChannelCode : that.gatheringChannelCode,
receiverUserName : that.receiverUserName,
appealType : that.appealType,
appealState : that.appealState,
appealProcessWay : that.appealProcessWay,
initiationStartTime : that.initiationStartTime,
initiationEndTime : that.initiationEndTime
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'orderNo',
title : '订单号'
}, {
field : 'merchantName',
title : '商户'
}, {
title : '收款渠道/收款金额',
formatter : function(value, row, index, field) {
var text = row.gatheringChannelName + '/' + row.gatheringAmount + '元';
return text;
}
}, {
title : '接单人/接单时间',
formatter : function(value, row, index, field) {
if (row.receiverUserName == null) {
return;
}
var text = row.receiverUserName + '/' + row.receivedTime;
return text;
}
}, {
field : 'appealTypeName',
title : '申诉类型'
}, {
field : 'stateName',
title : '状态'
}, {
field : 'processWayName',
title : '处理方式'
}, {
field : 'initiationTime',
title : '发起时间'
}, {
title : '操作',
formatter : function(value, row, index) {
if (row.state == '1') {
return [ '<button type="button" class="deal-btn btn btn-outline-danger btn-sm">马上处理</button>' ].join('');
} else if (row.state == '2') {
return [ '<button type="button" class="deal-btn btn btn-outline-info btn-sm">查看详情</button>' ].join('');
}
},
events : {
'click .deal-btn' : function(event, value, row, index) {
window.location.href = '/appeal-details?id=' + row.id;
}
}
} ]
});
},
refreshTable : function() {
$('.appeal-record-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
}
}
});
\ No newline at end of file
/**
* 由于js存在精度丢失的问题,需要对其进行四舍五入处理
*
* @param num
* @param digit
* 小数位数, 不填则默认4为小数
* @returns
*/
function numberFormat(num, digit) {
if (digit == null) {
digit = 4;
}
return parseFloat(Number(num).toFixed(digit));
}
/**
* 获取url参数
*
* @param name
* @returns
*/
function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null)
return unescape(r[2]);
return null;
}
var configManageVM = new Vue({
el : '#config-manage',
data : {
configCode : '',
configName : '',
addOrUpdateConfigFlag : false,
configActionTitle : '',
editConfig : {},
},
computed : {},
created : function() {
},
mounted : function() {
this.initTable();
},
methods : {
initTable : function() {
var that = this;
$('.config-manage-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/dictconfig/findConfigItemByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
configCode : that.configCode,
configName : that.configName
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'configCode',
title : '配置项code'
}, {
field : 'configName',
title : '配置项名称'
}, {
field : 'configValue',
title : '配置项值'
}, {
title : '操作',
formatter : function(value, row, index) {
return [ '<button type="button" class="edit-config-btn btn btn-outline-success btn-sm" style="margin-right: 4px;">编辑</button>', '<button type="button" class="del-config-btn btn btn-outline-danger btn-sm">删除</button>' ].join('');
},
events : {
'click .edit-config-btn' : function(event, value, row, index) {
that.openEditConfigModal(row.id);
},
'click .del-config-btn' : function(event, value, row, index) {
that.delConfig(row.id);
}
}
} ]
});
},
refreshTable : function() {
$('.config-manage-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},
openAddConfigModal : function() {
this.addOrUpdateConfigFlag = true;
this.configActionTitle = '新增配置项';
this.editConfig = {
configCode : '',
configName : '',
configValue : ''
};
},
openEditConfigModal : function(id) {
var that = this;
that.$http.get('/dictconfig/findConfigItemById', {
params : {
id : id
}
}).then(function(res) {
that.editConfig = res.body.data;
that.addOrUpdateConfigFlag = true;
that.configActionTitle = '编辑配置项';
});
},
addOrUpdateConfig : function() {
var that = this;
var editConfig = that.editConfig;
if (editConfig.configCode == null || editConfig.configCode == '') {
layer.alert('请输入配置项code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editConfig.configName == null || editConfig.configName == '') {
layer.alert('请输入配置项名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editConfig.configValue == null || editConfig.configValue == '') {
layer.alert('请输入配置项值', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
that.$http.post('/dictconfig/addOrUpdateConfig', editConfig).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdateConfigFlag = false;
that.refreshTable();
});
},
delConfig : function(id) {
var that = this;
layer.confirm('确定要删除吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/dictconfig/delConfigById', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.refreshTable();
});
});
}
}
});
\ No newline at end of file
var dictManageVM = new Vue({
el : '#dict-manage',
data : {
dictTypeCode : '',
dictTypeName : '',
editDictDataFlag : false,
dictTypeId : '',
dictItems : [],
addOrUpdateDictTypeFlag : false,
dictTypeActionTitle : '',
editDictType : {}
},
computed : {},
created : function() {
},
mounted : function() {
this.initTable();
},
methods : {
initTable : function() {
var that = this;
$('.dict-manage-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/dictconfig/findDictTypeByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
dictTypeCode : that.dictTypeCode,
dictTypeName : that.dictTypeName
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'dictTypeCode',
title : '字典code'
}, {
field : 'dictTypeName',
title : '字典名称'
}, {
field : 'note',
title : '备注'
}, {
title : '操作',
formatter : function(value, row, index) {
return [ '<button type="button" class="edit-dict-data-btn btn btn-outline-primary btn-sm" style="margin-right: 4px;">编辑字典数据</button>', '<button type="button" class="edit-dict-type-btn btn btn-outline-success btn-sm" style="margin-right: 4px;">编辑</button>', '<button type="button" class="del-dict-type-btn btn btn-outline-danger btn-sm">删除</button>' ].join('');
},
events : {
'click .edit-dict-data-btn ' : function(event, value, row, index) {
that.openEditDictDataModal(row.id);
},
'click .edit-dict-type-btn' : function(event, value, row, index) {
that.openEditDictTypeModal(row.id);
},
'click .del-dict-type-btn' : function(event, value, row, index) {
that.delDictType(row.id);
}
}
} ]
});
},
refreshTable : function() {
$('.dict-manage-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},
openEditDictDataModal : function(id) {
var that = this;
that.dictTypeId = id;
that.$http.get('/dictconfig/findDictItemByDictTypeId', {
params : {
dictTypeId : id
}
}).then(function(res) {
that.dictItems = res.body.data;
this.editDictDataFlag = true;
});
},
addDictItem : function() {
this.dictItems.push({
dictItemCode : '',
dictItemName : ''
});
},
delDictItem : function(index) {
this.dictItems.splice(index, 1);
},
moveUpDictItem : function(index) {
var temp = this.dictItems[index - 1];
Vue.set(this.dictItems, index - 1, this.dictItems[index])
Vue.set(this.dictItems, index, temp)
},
moveDownDictItem : function(index) {
var i = this.dictItems[index + 1];
Vue.set(this.dictItems, index + 1, this.dictItems[index])
Vue.set(this.dictItems, index, i)
},
updateDictData : function() {
var that = this;
var dictItemCodeMap = new Map();
var dictItems = that.dictItems;
for (var i = 0; i < dictItems.length; i++) {
var dictItem = dictItems[i];
if (dictItem.dictItemCode == null || dictItem.dictItemCode == '') {
layer.alert('请输入字典项code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (dictItem.dictItemName == null || dictItem.dictItemName == '') {
layer.alert('请输入字典项名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (dictItemCodeMap.get(dictItem.dictItemCode) != null) {
layer.alert('字典项code不能重复', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
dictItemCodeMap.set(dictItem.dictItemCode, dictItem.dictItemCode);
}
that.$http.post('/dictconfig/updateDictData', {
dictTypeId : that.dictTypeId,
dictDatas : dictItems
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.editDictDataFlag = false;
that.refreshTable();
});
},
openAddDictTypeModal : function() {
this.addOrUpdateDictTypeFlag = true;
this.dictTypeActionTitle = '新增字典';
this.editDictType = {
dictTypeCode : '',
dictTypeName : '',
note : ''
};
},
openEditDictTypeModal : function(id) {
var that = this;
that.$http.get('/dictconfig/findDictTypeById', {
params : {
id : id
}
}).then(function(res) {
that.editDictType = res.body.data;
that.addOrUpdateDictTypeFlag = true;
that.dictTypeActionTitle = '编辑字典';
});
},
addOrUpdateDictType : function() {
var that = this;
var editDictType = that.editDictType;
if (editDictType.dictTypeCode == null || editDictType.dictTypeCode == '') {
layer.alert('请输入字典code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editDictType.dictTypeName == null || editDictType.dictTypeName == '') {
layer.alert('请输入字典名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
that.$http.post('/dictconfig/addOrUpdateDictType', editDictType).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdateDictTypeFlag = false;
that.refreshTable();
});
},
delDictType : function(id) {
var that = this;
layer.confirm('确定要删除吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/dictconfig/delDictTypeById', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.refreshTable();
});
});
}
}
});
\ No newline at end of file
var gatheringCodeVM = new Vue({
el : '#gathering-code',
data : {
state : '',
gatheringCodeStateDictItems : [],
gatheringChannelCode : '',
gatheringChannelDictItems : [],
payee : '',
userName : '',
addOrUpdateGatheringCodeFlag : false,
gatheringCodeActionTitle : '',
editGatheringCode : {},
viewGatheringCodeFlag : false,
viewGatheringCodeUrl : '',
},
computed : {},
created : function() {
},
mounted : function() {
var that = this;
that.loadGatheringCodeStateDictItem();
that.loadGatheringChannelDictItem();
that.initTable();
$('.gathering-code-pic').on('fileuploaded', function(event, data, previewId, index) {
that.editGatheringCode.storageId = data.response.data.join(',');
that.addOrUpdateGatheringCodeInner();
});
},
methods : {
loadGatheringCodeStateDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'gatheringCodeState'
}
}).then(function(res) {
this.gatheringCodeStateDictItems = res.body.data;
});
},
loadGatheringChannelDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'gatheringChannel'
}
}).then(function(res) {
this.gatheringChannelDictItems = res.body.data;
});
},
initTable : function() {
var that = this;
$('.gathering-code-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/gatheringCode/findGatheringCodeByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
state : that.state,
gatheringChannelCode : that.gatheringChannelCode,
payee : that.payee,
userName : that.userName
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'gatheringChannelName',
title : '收款渠道'
}, {
field : 'stateName',
title : '收款码状态'
}, {
title : '收款金额',
formatter : function(value, row, index, field) {
if (row.fixedGatheringAmount) {
return row.gatheringAmount;
}
return '不固定';
}
}, {
field : 'payee',
title : '收款人'
}, {
field : 'userName',
title : '所属账号'
}, {
field : 'createTime',
title : '创建时间'
}, {
title : '操作',
formatter : function(value, row, index) {
return [ '<button type="button" class="view-gathering-code-btn btn btn-outline-primary btn-sm" style="margin-right: 4px;">查看收款码</button>', '<button type="button" class="edit-gathering-code-btn btn btn-outline-success btn-sm" style="margin-right: 4px;">编辑</button>', '<button type="button" class="del-gathering-code-btn btn btn-outline-danger btn-sm">删除</button>' ].join('');
},
events : {
'click .view-gathering-code-btn' : function(event, value, row, index) {
that.openViewGatheringCodeModal(row);
},
'click .edit-gathering-code-btn' : function(event, value, row, index) {
that.openEditGatheringCodeModal(row.id);
},
'click .del-gathering-code-btn' : function(event, value, row, index) {
that.delGatheringCode(row.id);
}
}
} ]
});
},
refreshTable : function() {
$('.gathering-code-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},
initFileUploadWidget : function(storageId) {
var initialPreview = [];
var initialPreviewConfig = [];
if (storageId != null) {
initialPreview.push('/storage/fetch/' + storageId);
initialPreviewConfig.push({
downloadUrl : '/storage/fetch/' + storageId
});
}
$('.gathering-code-pic').fileinput('destroy').fileinput({
browseOnZoneClick : true,
showBrowse : false,
showCaption : false,
showClose : true,
showRemove : false,
showUpload : false,
dropZoneTitle : '点击选择图片',
dropZoneClickTitle : '',
layoutTemplates : {
footer : ''
},
maxFileCount : 1,
uploadUrl : '/storage/uploadPic',
enctype : 'multipart/form-data',
allowedFileExtensions : [ 'jpg', 'png', 'bmp', 'jpeg' ],
initialPreview : initialPreview,
initialPreviewAsData : true,
initialPreviewConfig : initialPreviewConfig
});
},
openViewGatheringCodeModal : function(gatheringCode) {
this.viewGatheringCodeFlag = true;
this.viewGatheringCodeUrl = '/storage/fetch/' + gatheringCode.storageId;
},
switchGatheringAmountMode : function() {
if (!this.editGatheringCode.fixedGatheringAmount) {
this.editGatheringCode.gatheringAmount = '';
}
},
openAddGatheringCodeModal : function() {
this.addOrUpdateGatheringCodeFlag = true;
this.gatheringCodeActionTitle = '新增收款码';
this.editGatheringCode = {
userName : '',
gatheringChannelCode : '',
state : '',
fixedGatheringAmount : true,
gatheringAmount : '',
payee : ''
};
this.initFileUploadWidget();
},
openEditGatheringCodeModal : function(gatheringCodeId) {
var that = this;
that.$http.get('/gatheringCode/findGatheringCodeById', {
params : {
id : gatheringCodeId,
}
}).then(function(res) {
that.addOrUpdateGatheringCodeFlag = true;
that.gatheringCodeActionTitle = '编辑收款码';
that.editGatheringCode = res.body.data;
that.initFileUploadWidget(res.body.data.storageId);
});
},
addOrUpdateGatheringCode : function() {
var that = this;
var editGatheringCode = that.editGatheringCode;
if (editGatheringCode.userName == null || editGatheringCode.userName == '') {
layer.alert('请输入所属账号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editGatheringCode.gatheringChannelCode == null || editGatheringCode.gatheringChannelCode == '') {
layer.alert('请选择收款渠道', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editGatheringCode.state == null || editGatheringCode.state == '') {
layer.alert('请选择状态', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editGatheringCode.fixedGatheringAmount == null) {
layer.alert('请选择是否固定收款金额', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editGatheringCode.fixedGatheringAmount) {
if (editGatheringCode.gatheringAmount == null || editGatheringCode.gatheringAmount == '') {
layer.alert('请输入收款金额', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
}
if (editGatheringCode.payee == null || editGatheringCode.payee == '') {
layer.alert('请选择收款人', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if ($('.gathering-code-pic').fileinput('getPreview').content.length != 0) {
that.addOrUpdateGatheringCodeInner();
} else {
var filesCount = $('.gathering-code-pic').fileinput('getFilesCount');
if (filesCount == 0) {
layer.alert('请选择要上传的图片', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
$('.gathering-code-pic').fileinput('upload');
}
},
addOrUpdateGatheringCodeInner : function() {
var that = this;
that.$http.post('/gatheringCode/addOrUpdateGatheringCode', that.editGatheringCode).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdateGatheringCodeFlag = false;
that.refreshTable();
});
},
delGatheringCode : function(gatheringCodeId) {
var that = this;
that.$http.get('/gatheringCode/delGatheringCodeById', {
params : {
id : gatheringCodeId,
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdateGatheringCodeFlag = false;
that.refreshTable();
});
}
}
});
\ No newline at end of file
var loginLogVM = new Vue({
el : '#login-log',
data : {
userName : '',
ipAddr : '',
state : '',
loginStateDictItems : [],
startTime : dayjs().format('YYYY-MM-DD'),
endTime : dayjs().format('YYYY-MM-DD'),
},
computed : {},
created : function() {
},
mounted : function() {
this.loadLoginStateDictItem();
this.initTable();
},
methods : {
loadLoginStateDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'loginState'
}
}).then(function(res) {
this.loginStateDictItems = res.body.data;
});
},
initTable : function() {
var that = this;
$('.login-log-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/userAccount/findLoginLogByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
userName : that.userName,
ipAddr : that.ipAddr,
state : that.state,
startTime : that.startTime,
endTime : that.endTime
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'userName',
title : '登录用户名'
}, {
field : 'systemName',
title : '登录系统'
}, {
field : 'ipAddr',
title : 'ip地址'
}, {
field : 'loginLocation',
title : '登录地点'
}, {
field : 'browser',
title : '浏览器'
}, {
field : 'os',
title : '操作系统'
}, {
field : 'stateName',
title : '登录状态'
}, {
field : 'msg',
title : '操作信息'
}, {
field : 'loginTime',
title : '登录时间'
} ]
});
},
refreshTable : function() {
$('.login-log-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
}
}
});
\ No newline at end of file
var platformVM = new Vue({
el : '#platform',
data : {
name : '',
addOrUpdatePlatformFlag : false,
platformActionTitle : '',
editPlatform : {},
},
computed : {},
created : function() {
},
mounted : function() {
this.initTable();
},
methods : {
initTable : function() {
var that = this;
$('.platform-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/merchant/findMerchantByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
name : that.name
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
columns : [ {
field : 'merchantNum',
title : '商户号'
}, {
field : 'name',
title : '商户名称'
}, {
field : 'secretKey',
title : '接入密钥'
}, {
field : 'createTime',
title : '接入时间'
}, {
field : 'relevanceAccountUserName',
title : '关联账号'
}, {
title : '操作',
formatter : function(value, row, index) {
return [ '<button type="button" class="platform-edit-btn btn btn-outline-primary btn-sm" style="margin-right: 4px;">编辑</button>', '<button type="button" class="del-platform-btn btn btn-outline-danger btn-sm">删除</button>' ].join('');
},
events : {
'click .platform-edit-btn' : function(event, value, row, index) {
that.showPlatformEditModal(row.id);
},
'click .del-platform-btn' : function(event, value, row, index) {
that.delPlatform(row.id);
}
}
} ]
});
},
refreshTable : function() {
$('.platform-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},
openAddPlatformModal : function() {
this.addOrUpdatePlatformFlag = true;
this.platformActionTitle = '新增商户';
this.editPlatform = {
merchantNum : '',
name : '',
secretKey : '',
relevanceAccountUserName : ''
}
},
showPlatformEditModal : function(id) {
var that = this;
that.$http.get('/merchant/findMerchantById', {
params : {
id : id
}
}).then(function(res) {
that.editPlatform = res.body.data;
that.addOrUpdatePlatformFlag = true;
that.configActionTitle = '编辑商户信息';
});
},
addOrUpdatePlatform : function() {
var that = this;
var editPlatform = that.editPlatform;
if (editPlatform.merchantNum == null || editPlatform.merchantNum == '') {
layer.alert('请输入商家号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPlatform.name == null || editPlatform.name == '') {
layer.alert('请输入商家名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPlatform.secretKey == null || editPlatform.secretKey == '') {
layer.alert('请输入接入密钥', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPlatform.relevanceAccountUserName == null || editPlatform.relevanceAccountUserName == '') {
layer.alert('请输入关联账号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
that.$http.post('/merchant/addOrUpdateMerchant', editPlatform, {
emulateJSON : true
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdatePlatformFlag = false;
that.refreshTable();
});
},
delPlatform : function(id) {
var that = this;
layer.confirm('确定要删除吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/merchant/delMerchantById', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.refreshTable();
});
});
}
}
});
\ No newline at end of file
var payChannelVM = new Vue({
el : '#pay-channel',
data : {
payTypeDicts : [],
tabWithPayType : {},
payChannels : [],
showPayChannelFlag : true,
editPayChannel : {},
addOrUpdatePayChannelFlag : false,
payChannelActionTitle : '',
payTypes : [],
showPayTypeFlag : false,
editPayType : {},
addOrUpdatePayTypeFlag : false,
payTypeActionTitle : '',
},
computed : {},
created : function() {
},
mounted : function() {
this.loadPayTypeDict();
this.loadPayChannel();
},
methods : {
loadPayTypeDict : function() {
var that = this;
that.$http.get('/recharge/findAllPayType', {}).then(function(res) {
that.payTypeDicts = res.body.data;
if (that.payTypeDicts.length > 0) {
that.tabWithPayType = that.payTypeDicts[0];
} else {
that.tabWithPayType = {};
}
});
},
loadPayChannel : function() {
var that = this;
that.$http.get('/recharge/findAllPayChannel').then(function(res) {
that.payChannels = res.body.data;
});
},
showAddPayChannelModal : function() {
this.addOrUpdatePayChannelFlag = true;
this.payChannelActionTitle = '新增通道';
this.editPayChannel = {
payTypeId : this.tabWithPayType.id,
channelCode : '',
channelName : '',
orderNo : '',
enabled : true,
bankName : '',
accountHolder : '',
bankCardAccount : '',
payPlatformCode : '',
payPlatformName : '',
payPlatformChannelCode : ''
};
},
showEditPayChannelModal : function(id) {
var that = this;
that.$http.get('/recharge/findPayChannelById', {
params : {
id : id
}
}).then(function(res) {
that.editPayChannel = res.body.data;
that.addOrUpdatePayChannelFlag = true;
that.payChannelActionTitle = '编辑通道';
});
},
addOrUpdatePayChannel : function() {
var that = this;
var editPayChannel = that.editPayChannel;
if (editPayChannel.channelCode == null || editPayChannel.channelCode == '') {
layer.alert('请输入通道code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.channelName == null || editPayChannel.channelName == '') {
layer.alert('请输入通道名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.orderNo == null || editPayChannel.orderNo == '') {
layer.alert('请选择排序号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (that.tabWithPayType.bankCardFlag) {
if (editPayChannel.bankName == null || editPayChannel.bankName == '') {
layer.alert('请输入收款银行', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.accountHolder == null || editPayChannel.accountHolder == '') {
layer.alert('请输入收款人', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.bankCardAccount == null || editPayChannel.bankCardAccount == '') {
layer.alert('请输入卡号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
} else {
if (editPayChannel.payPlatformCode == null || editPayChannel.payPlatformCode == '') {
layer.alert('请输入支付平台code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.payPlatformName == null || editPayChannel.payPlatformName == '') {
layer.alert('请输入支付平台名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayChannel.payPlatformChannelCode == null || editPayChannel.payPlatformChannelCode == '') {
layer.alert('请输入对应通道code', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
}
that.$http.post('/recharge/addOrUpdatePayChannel', editPayChannel).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdatePayChannelFlag = false;
that.loadPayChannel();
});
},
delPayChannel : function(id) {
var that = this;
layer.confirm('确定要删除吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/recharge/delPayChannelById', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.loadPayChannel();
});
});
},
toPayTypePage : function() {
var that = this;
that.$http.get('/recharge/findAllPayType', {}).then(function(res) {
that.payTypes = res.body.data;
that.showPayChannelFlag = false;
that.showPayTypeFlag = true;
});
},
backToPayChannelPage : function() {
this.showPayTypeFlag = false;
this.showPayChannelFlag = true;
this.loadPayTypeDict();
this.loadPayChannel();
},
showAddPayTypeModal : function() {
this.addOrUpdatePayTypeFlag = true;
this.payTypeActionTitle = '新增支付类型';
this.editPayType = {
type : '',
name : '',
bankCardFlag : false,
orderNo : '',
enabled : true
};
},
showEditPayTypeModal : function(id) {
var that = this;
that.$http.get('/recharge/findPayTypeById', {
params : {
id : id
}
}).then(function(res) {
that.editPayType = res.body.data;
this.addOrUpdatePayTypeFlag = true;
this.payTypeActionTitle = '编辑支付类型';
});
},
addOrUpdatePayType : function() {
var that = this;
var editPayType = that.editPayType;
if (editPayType.type == null || editPayType.type == '') {
layer.alert('请输入支付类型', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayType.name == null || editPayType.name == '') {
layer.alert('请输入名称', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
if (editPayType.orderNo == null || editPayType.orderNo == '') {
layer.alert('请输入排序号', {
title : '提示',
icon : 7,
time : 3000
});
return;
}
that.$http.post('/recharge/addOrUpdatePayType', editPayType).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.addOrUpdatePayTypeFlag = false;
that.toPayTypePage();
});
},
delPayType : function(id) {
var that = this;
layer.confirm('确定要删除吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/recharge/delPayTypeById', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.toPayTypePage();
});
});
}
}
});
\ No newline at end of file
var platformOrderVM = new Vue({
el : '#platform-order',
data : {
orderNo : '',
platformName : '',
gatheringChannelCode : '',
gatheringChannelDictItems : [],
orderState : '',
platformOrderStateDictItems : [],
receiverUserName : '',
submitStartTime : dayjs().format('YYYY-MM-DD'),
submitEndTime : dayjs().format('YYYY-MM-DD'),
auditPlatformOrderFlag : false,
auditPlatformOrder : '',
auditNote : '',
},
computed : {},
created : function() {
},
mounted : function() {
this.loadGatheringChannelDictItem();
this.loadPlatformOrderStateDictItem();
this.initTable();
},
methods : {
/**
* 加载收款渠道字典项
*/
loadGatheringChannelDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'gatheringChannel'
}
}).then(function(res) {
this.gatheringChannelDictItems = res.body.data;
});
},
/**
* 加载平台订单状态字典项
*/
loadPlatformOrderStateDictItem : function() {
var that = this;
that.$http.get('/dictconfig/findDictItemInCache', {
params : {
dictTypeCode : 'platformOrderState'
}
}).then(function(res) {
this.platformOrderStateDictItems = res.body.data;
});
},
initTable : function() {
var that = this;
$('.platform-order-table').bootstrapTable({
classes : 'table table-hover',
height : 490,
url : '/platformOrder/findPlatformOrderByPage',
pagination : true,
sidePagination : 'server',
pageNumber : 1,
pageSize : 10,
pageList : [ 10, 25, 50, 100 ],
queryParamsType : '',
queryParams : function(params) {
var condParam = {
pageSize : params.pageSize,
pageNum : params.pageNumber,
orderNo : that.orderNo,
platformName : that.platformName,
orderState : that.orderState,
gatheringChannelCode : that.gatheringChannelCode,
receiverUserName : that.receiverUserName,
submitStartTime : that.submitStartTime,
submitEndTime : that.submitEndTime
};
return condParam;
},
responseHandler : function(res) {
return {
total : res.data.total,
rows : res.data.content
};
},
detailView : true,
detailFormatter : function(index, row, element) {
var html = template('platform-order-detail', {
platformOrderInfo : row
});
return html;
},
columns : [ {
field : 'orderNo',
title : '订单号'
}, {
field : 'platformName',
title : '商户'
}, {
field : 'orderStateName',
title : '订单状态'
}, {
title : '收款渠道/收款金额/奖励金',
formatter : function(value, row, index, field) {
var text = row.gatheringChannelName + '/' + row.gatheringAmount + '元';
if (row.bounty != null) {
text += '/' + row.bounty + '元';
}
return text;
}
}, {
title : '接单人/接单时间',
formatter : function(value, row, index, field) {
if (row.receiverUserName == null) {
return;
}
var text = row.receiverUserName + '/' + row.receivedTime;
return text;
}
}, {
field : 'submitTime',
title : '提交时间'
}, {
field : 'confirmTime',
title : '确认时间'
}, {
title : '通知状态',
formatter : function(value, row, index, field) {
return row.payInfo.noticeStateName;
}
}, {
title : '操作',
formatter : function(value, row, index) {
var btns = [];
if (row.orderState == '1') {
btns.push('<button type="button" class="cancel-order-btn btn btn-outline-danger btn-sm">取消订单</button>');
}
if (row.payInfo.noticeState == '3') {
btns.push('<button type="button" class="resend-notice-btn btn btn-outline-info btn-sm">重发通知</button>');
}
if (btns.length > 0) {
return btns.join('');
}
},
events : {
'click .cancel-order-btn' : function(event, value, row, index) {
that.cancelOrder(row.id);
},
'click .resend-notice-btn' : function(event, value, row, index) {
that.resendNotice(row.id);
}
}
} ]
});
},
refreshTable : function() {
$('.platform-order-table').bootstrapTable('refreshOptions', {
pageNumber : 1
});
},
cancelOrder : function(id) {
var that = this;
layer.confirm('确定要取消订单吗?', {
icon : 7,
title : '提示'
}, function(index) {
layer.close(index);
that.$http.get('/platformOrder/cancelOrder', {
params : {
id : id
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
that.refreshTable();
});
});
},
resendNotice : function(id) {
var that = this;
layer.load(0, {
time : 8000,
shade : [ 0.1, '#fff' ]
});
that.$http.get('/platformOrder/resendNotice', {
params : {
id : id
}
}).then(function(res) {
layer.closeAll('loading');
that.refreshTable();
var result = res.body.data;
if (result == null || result == '') {
result = '无内容';
}
layer.open({
type : 1,
anim : 2,
shadeClose : true,
area : [ '420px', '240px' ],
content : '<div style="padding: 10px;">' + '<p>返回内容</p>' + '<div style="color: red;">' + result + '</div>' + '</div>'
});
});
},
showAuditOrderModal : function(platformOrder) {
this.auditPlatformOrderFlag = true;
this.auditPlatformOrder = platformOrder;
this.auditNote = '';
},
audit : function(action) {
var that = this;
var url = '/platformOrder/customerServiceConfirmToPaid';
if (action == 2) {
url = '/platformOrder/unpaidCancelOrder';
}
that.$http.get(url, {
params : {
id : that.auditPlatformOrder.id,
note : that.auditNote
}
}).then(function(res) {
layer.alert('操作成功!', {
icon : 1,
time : 3000,
shade : false
});
this.auditPlatformOrderFlag = false;
that.refreshTable();
});
}
}
});
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论