assertThat("user card biz init " + response.getRetcode() + response.getRetmsg() + response.getException(),
response.getRetcode(), equalTo(0));
+ System.out.println("biz init accdate " + response.getAccdate() + " , refno " + response.getRefno()
+ + ", description " + response.getDescription() + " summary " + response.getRetmsg());
+
param.setAccdate(response.getAccdate());
param.setRefno(response.getRefno());
response = userProxy.bizConfirm(param);
assertThat("user card biz confirm " + response.getRetcode() + response.getRetmsg() + response.getException(),
response.getRetcode(), equalTo(0));
+ System.out.println("biz confirm accdate " + response.getAccdate() + " , refno " + response.getRefno()
+ + ", description " + response.getDescription() + " summary " + response.getRetmsg());
+
}
@Test
setTransInfo(request.transdate, request.transtime, TradeCode.TRANSCODE_CARD_BIZ, "balance")
setOutTransInfo(request.operid, request.operSeqno)
dtltype = "cardservice"
- description = request.summary
}
+ val transDesc = arrayListOf<String>()
+ transDesc.add(request.summary)
val result = PublishCardResponse()
val user = useService.findAccountByUserid(request.userid, null)
TradeErrorCode.INPUT_DATA_ERROR,
"交易金额错误")
}
- if (depositAmount != 0 && request.totalAmount != 0) {
+ if (request.totalAmount != 0) {
if (depositAmount > 0) {
- builder.addDebitCreditRecord(capitalSubj.subjno, capitalSubj.subjname,
+ builder.addDebitCreditRecord(capitalSubj.subjno, capitalSubj.subjno,
user.accno, Subject.SUBJNO_PERSONAL_DEPOSIT, request.totalAmount / 100.0, request.summary)
}
- val transDesc = arrayListOf<String>()
if (request.cost > 0) {
val subject = accountUtilServcie.readSubject(Subject.SUBJNO_CARD_COST)
builder.addDebitCreditRecord(user.accno, Subject.SUBJNO_PERSONAL_DEPOSIT,
request.summary)
transDesc.add("手续费" + "%.2f".format(request.charge / 100.0) + " 元")
}
- builder.description += transDesc.joinToString(";")
}
+ builder.description = transDesc.joinToString(";")
val transaction = transactionService.init(builder)
result.apply {
val response = PublishCardResponse().apply {
accdate = transaction.accdate
refno = transaction.refno
+ description = transaction.personDtl.transdesc
}
return ResponseBodyBuilder.successEntity(response, "${request.summary}确认成功")
}
import com.supwisdom.dlpay.framework.domain.TSubject
import com.supwisdom.dlpay.framework.util.TradeDict
import com.supwisdom.dlpay.framework.util.TradeErrorCode
+import org.apache.commons.lang3.StringUtils
import kotlin.math.abs
open class SubTransactionBuilder<T : SubTransactionBuilder<T>>(val parent: TransactionBuilder) {
var remark: String = ""
var dtltype: String = ""
+
+ private fun checkSubjectNo(subjno: String) {
+ if (!StringUtils.isNumeric(subjno)) {
+ throw TransactionCheckException(TradeErrorCode.INPUT_DATA_ERROR, "科目号<$subjno>不合法")
+ }
+ }
+
fun person(): PersonTranactionBuilder {
return this.personBuilder
}
fun addDebitCreditRecord(debitAccNo: String, debitSubjNo: String,
creditAccNo: String, creditSubjNo: String,
amount: Double, summary: String): TransactionBuilder {
+ checkSubjectNo(debitSubjNo)
+ checkSubjectNo(creditSubjNo)
debitCreditLines.add(DebitCreditLine(debitAccNo, debitSubjNo,
creditAccNo, creditSubjNo,
amount, summary, debitCreditLines.size + 1))