implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-oauth2-client'
implementation 'org.springframework.security:spring-security-oauth2-jose'
- implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
- implementation 'org.springframework.session:spring-session-data-redis:2.0.10.RELEASE'
+ implementation 'org.springframework.session:spring-session-data-redis'
+ implementation 'org.springframework.social:spring-social-web:1.1.6.RELEASE'
implementation 'org.jetbrains.kotlin:kotlin-reflect'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
+ implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
+
implementation 'org.postgresql:postgresql:42.2.5'
+ implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation 'com.jcabi:jcabi-manifests:1.1'
implementation 'org.bitbucket.b_c:jose4j:0.6.3'
- implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
- implementation 'org.springframework.social:spring-social-web:1.1.6.RELEASE'
implementation 'io.github.microutils:kotlin-logging:1.6.26'
+ implementation 'org.slf4j:slf4j-parent:1.7.26'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19'
implementation group: 'javax.servlet', name: 'jstl', version: '1.2'
implementation group: 'taglibs', name: 'standard', version: '1.1.2'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.6'
implementation 'org.flywaydb:flyway-core'
-// implementation group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.1'
- implementation group: 'log4j', name: 'log4j', version: '1.2.16'
implementation files('libs/ojdbc6.jar')
springbootVersion = 2.1.3.RELEASE
-kotlinVersion = 1.2.41
+kotlinVersion = 1.3.31
payapiVersion = 1.0
jdkVersion = 1.8
\ No newline at end of file
import com.supwisdom.dlpay.framework.service.DayendSettleService;
import com.supwisdom.dlpay.framework.service.SystemUtilService;
import com.supwisdom.dlpay.framework.util.StringUtil;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class DayendSettleTask {
private TSettleLog settleLog;
- private static final Logger logger = Logger.getLogger(DayendSettleTask.class);
+ private static final Logger logger = LoggerFactory.getLogger(DayendSettleTask.class);
public void doSettleTask() {
//step2: 对账判断
long t3 = System.currentTimeMillis();
- if(!checkChkfiles()){
+ if (!checkChkfiles()) {
logger.error("对账未完成,退出结算!");
return;
}
}
}
- private boolean checkAccounts(){
+ private boolean checkAccounts() {
//TODO: 账户余额校验,生成账户日结表数据
return true;
}
- private boolean checkChkfiles(){
+ private boolean checkChkfiles() {
//TODO: 结算前是否要求所有对账完成
return true;
}
import com.supwisdom.dlpay.api.dao.DebitCreditDtlDao;
import com.supwisdom.dlpay.framework.dao.*;
-import com.supwisdom.dlpay.framework.data.*;
+import com.supwisdom.dlpay.framework.data.FSubjectInfoBean;
+import com.supwisdom.dlpay.framework.data.MerchBean;
+import com.supwisdom.dlpay.framework.data.SubjectInfoBean;
+import com.supwisdom.dlpay.framework.data.VoucherTemp;
import com.supwisdom.dlpay.framework.domain.*;
import com.supwisdom.dlpay.framework.service.DayendSettleService;
import com.supwisdom.dlpay.framework.service.SystemUtilService;
-import com.supwisdom.dlpay.framework.util.*;
-import org.apache.log4j.Logger;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.MoneyUtil;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.framework.util.Subject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
private DebitCreditDtlDao debitCreditDtlDao;
- private static final Logger logger = Logger.getLogger(DayendSettleServiceImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(DayendSettleServiceImpl.class);
private int hostdate;
private int periodYear; // 记账年份
import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.framework.util.NumberUtil;
import com.supwisdom.dlpay.framework.util.StringUtil;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
@Autowired
private BusinessparaDao businessparaDao;
- private static final Logger logger = Logger.getLogger(SystemUtilServiceImpl.class);
+ private static final Logger logger = LoggerFactory.getLogger(SystemUtilServiceImpl.class);
public static class SystemDateTimeImpl implements SystemDateTime {
private Date now;
package com.supwisdom.dlpay.framework.util;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.beans.Introspector;
import java.lang.reflect.Field;
@Sign
private String version;
- private static final Logger logger = Logger.getLogger(APIRequestParam.class);
+ private static final Logger logger = LoggerFactory.getLogger(APIRequestParam.class);
public String getSign() {
return sign;
package com.supwisdom.dlpay.framework.util;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
public class DateUtil {
- private static final Logger logger = Logger.getLogger(DateUtil.class);
+ private static final Logger logger = LoggerFactory.getLogger(DateUtil.class);
public static final String DATE_FMT = "yyyyMMdd";
public static final String TIME_FMT = "HHmmss";
public static final String DATETIME_FMT = "yyyyMMddHHmmss";
this.extendMap.plus(param)
return this
}
+
fun addResult(key: String, value: String): PersonTransBuilder {
this.resultMap.plus(mapOf(key to value))
return this
it.accno to it.subjno
}
AccountHolder.IDTYPE_SHOP -> holder.withLock<TShopacc>().let {
- if(null==this.shopaccno) this.shopaccno=it.shopaccno
+ if (this.shopaccno.isEmpty()) {
+ this.shopaccno = it.shopaccno
+ }
it.shopaccno to it.subjno
}
AccountHolder.IDTYPE_SUBJECT -> holder.withLock<TSubject>().let {
it.accno to it.subjno
}
AccountHolder.IDTYPE_SHOP -> holder.get<TShopacc>().let {
- if(null==this.shopaccno) this.shopaccno=it.shopaccno
+ if (this.shopaccno.isEmpty()) {
+ this.shopaccno = it.shopaccno
+ }
it.shopaccno to it.subjno
}
AccountHolder.IDTYPE_SUBJECT -> holder.get<TSubject>().let {
debit.builder = this
credit.builder = this
- var debitAccNo = ""
- var debitSubjNo = ""
+ var debitAccNo: String
+ var debitSubjNo: String
getAccountAndSubjNo(debit).apply {
debitAccNo = first
debitSubjNo = second
}
- var creditAccNo = ""
- var creditSubjNo = ""
+ var creditAccNo: String
+ var creditSubjNo: String
getAccountAndSubjNo(credit).apply {
creditAccNo = first
creditSubjNo = second
return service.process(this)
}
- fun init(service: PersonBalancePayService) : TUserdtl{
+ fun init(service: PersonBalancePayService): TUserdtl {
prepareData()
preCheckAccount()
return service.init(this)
}
fun wip(service: PersonBalancePayService): TUserdtl {
- if (null == this.refno)
+ if (this.refno.isEmpty())
throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR, "交易参考号<refno>未指定")
return service.wip(this)
}
fun finish(service: PersonBalancePayService, status: String): TUserdtl {
- if (null == this.refno)
+ if (this.refno.isEmpty())
throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR, "交易参考号<refno>未指定")
this.status = status
return service.finish(this)
}
- fun success(service: PersonBalancePayService): TUserdtl{
- if (null == this.refno)
+ fun success(service: PersonBalancePayService): TUserdtl {
+ if (this.refno.isEmpty())
throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR, "交易参考号<refno>未指定")
this.status = TradeDict.DTL_STATUS_SUCCESS
return service.finish(this)
.fail(TradeErrorCode.REQUEST_SIGN_ERROR, "参数签名错误"))
}
- val person = param.uid?.let { userService.findByThirdUniqueIdenty(it) } ?: null //没注册,可能匿名?
+ val person = param.uid?.let { userService.findByThirdUniqueIdenty(it) } //没注册,可能匿名?
if (consumePayService.checkShopPaytype(param.shopaccno, TradeDict.PAYTYPE_YKT_CARD, person==null)) {
val dtl = PersonTransBuilder.newBuilder(accountUtilServcie)
.chooseTradetype(Tradetype.CONSUME) //消费
@Autowired
lateinit var accountUtilServcie: AccountUtilServcie
- @RequestMapping(value = "/wechat")
+ @RequestMapping(value = ["/wechat"])
@ResponseBody
fun index(@PathVariable schema: String, request: HttpServletRequest,
response: HttpServletResponse): String {
.fail(TradeErrorCode.BUSINESS_SHOP_EXISTS, "该商户唯一号[${param.shopUniqueId}]已经存在"))
}
- param.shopname = param.shopname?.let { URLDecoder.decode(param.shopname, Charsets.UTF_8.toString()) } //解码
+ param.shopname = param.shopname.let { URLDecoder.decode(param.shopname, Charsets.UTF_8.toString()) } //解码
param.contactman = param.contactman?.let { URLDecoder.decode(param.contactman, Charsets.UTF_8.toString()) } //解码
param.address = param.address?.let { URLDecoder.decode(param.address, Charsets.UTF_8.toString()) } //解码
- shopService.registerShop(param)?.let {
+ shopService.registerShop(param).let {
ResponseEntity.ok(ResponseBodyBuilder.create()
.data("shopid", it.shopid)
.data("shopaccno", it.shopaccno ?: "")
import com.supwisdom.dlpay.exception.TransactionCheckException
import com.supwisdom.dlpay.exception.TransactionException
import com.supwisdom.dlpay.framework.util.TradeErrorCode
-import org.apache.log4j.Logger
+import mu.KotlinLogging
class ResponseBodyBuilder private constructor() {
companion object {
private const val INVALIDE_RETCODE = -0x7FFFFFFF
private val RESERVED_KEY = setOf("retcode", "retmsg", "exception")
- private val LOGGER = Logger.getLogger(ResponseBodyBuilder::class.java)
+ private val LOGGER = KotlinLogging.logger {}
fun create() = ResponseBodyBuilder()
}
*/
@Bean
fun flywayInitializer(flyway: Flyway): FlywayMigrationInitializer {
- return FlywayMigrationInitializer(flyway) { f -> }
+ return FlywayMigrationInitializer(flyway) { }
}