"from tb_subjectday where accdate=:accdate and tenantid=:tenantid and subjno in (select subjno from tb_subject where subjlevel=1 and tenantid=:tenantid) ", nativeQuery = true)
FSubjectInfoBean getAllParentSubjectSumInfo(@Param("accdate") String accdate, @Param("tenantid") String tenantid);
- @Query(value = "SELECT t.subjno AS subjno, t.subjname AS subjname,t.fsubjno AS fsubjno,t.subjlevel AS subjlevel,t.displayflag, " +
+ @Query(value = "SELECT t.subjno AS subjno, t.subjname AS subjname,t.fsubjno AS fsubjno,t.subjlevel AS subjlevel,t.balflag,t. displayflag, " +
"a.begindrbal AS lastdaydrbal,a.begincrbal AS lastdaycrbal, " +
"b.dramt AS dramt,b.cramt AS cramt,c.drbal AS drbal,c.crbal AS crbal " +
"FROM tb_subject t " +
}
org.apache.commons.beanutils.BeanUtils.populate(bean, data);
}
+
+ /**
+ * 企业营业执照编号有15位和18位,自2016年7月1日后,“三证合一、一照一码”后统一为18位社会信用代码
+ * */
+ public static boolean checkBusinessLicenseNo(String blno) {
+ if (isEmpty(blno)) return false;
+ String businessLicenseNo = blno.trim();
+ if (businessLicenseNo.length() != 15 && businessLicenseNo.length() != 18) return false; //历史企业注册码15位,社会信用代码长度为18位
+
+ if (businessLicenseNo.length() == 15) {
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("^[0-9A-Za-z]\\w{14}$");
+ java.util.regex.Matcher match = pattern.matcher(businessLicenseNo);
+ return match.matches(); //15位注册码为历史问题,只校验格式
+ }
+
+ //18位社会信用代码判断
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("^([0-9ABCDEFGHJKLMNPQRTUWXY]{2})([0-9]{6})([0-9ABCDEFGHJKLMNPQRTUWXY]{9})([0-9Y])$");
+ java.util.regex.Matcher match = pattern.matcher(businessLicenseNo);
+ if (!match.matches()) return false; //社会信用代码校验错误!
+
+ //验证最后一位
+ String codeStr = "0123456789ABCDEFGHJKLMNPQRTUWXY"; //字符字典(字符下标为代码字符数值)
+ int[] ws = {1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28}; //权值
+ String lastChar = businessLicenseNo.substring(businessLicenseNo.length() - 1);
+// String prefixStr = businessLicenseNo.substring(0, businessLicenseNo.length() - 1);
+ int sum = 0;
+ for (int i = 0; i < 17; i++) {
+ sum += (codeStr.indexOf(businessLicenseNo.charAt(i)) * ws[i]);
+ }
+ int c18 = 31 - (sum % 31);
+ if (c18 == 31) {
+ if ("0".equals(lastChar)) return true; //第18位为0
+ } else {
+ //0~30 查字典
+ String cs18=String.valueOf(codeStr.charAt(c18)); //c18代表的字符
+ if(cs18.equals(lastChar)) return true;
+ }
+ return false;
+ }
}
Integer getSubjlevel();
+ Integer getBalflag();
+
String getDisplayflag();
Double getLastdaydrbal();
private String subjname;
private String fsubjno;
private Integer subjlevel;
+ private Integer balflag;
private String displayflag;
private Double lastdaydrbal;
private Double lastdaycrbal;
this.subjlevel = subjlevel;
}
+ public Integer getBalflag() {
+ return balflag;
+ }
+
+ public void setBalflag(Integer balflag) {
+ this.balflag = balflag;
+ }
+
public String getDisplayflag() {
return displayflag;
}
} else if (ShopTypes.NORMAL.toString().equals(shoptype) && (StringUtil.isEmpty(businessLicenseNo) || StringUtil.isEmpty(taxRegistrationNo)
|| StringUtil.isEmpty(addr) || StringUtil.isEmpty(legalPersonName) || StringUtil.isEmpty(legalPersonIdtype) || StringUtil.isEmpty(legalPersonIdno))) {
return JsonResult.error("参数传递错误,结算商户必须填写商户营业信息!");
+ }else if(!StringUtil.isEmpty(businessLicenseNo) && !StringUtil.checkBusinessLicenseNo(businessLicenseNo.trim())){
+ return JsonResult.error("参数错误,请正确填写营业执照编号!");
}
+
TShop shop = new TShop();
shop.setFshopid(fshopid);
shop.setShopname(shopname);
if (ShopTypes.NORMAL.toString().equals(oldShop.getShoptype()) && (StringUtil.isEmpty(businessLicenseNo) || StringUtil.isEmpty(taxRegistrationNo)
|| StringUtil.isEmpty(addr) || StringUtil.isEmpty(legalPersonName) || StringUtil.isEmpty(legalPersonIdtype) || StringUtil.isEmpty(legalPersonIdno))) {
return JsonResult.error("参数传递错误,结算商户必须填写商户营业信息!");
+ }else if(!StringUtil.isEmpty(businessLicenseNo) && !StringUtil.checkBusinessLicenseNo(businessLicenseNo.trim())){
+ return JsonResult.error("参数错误,请正确填写营业执照编号!");
}
TShop shop=new TShop();
bean.setSubjname(info.getSubjname());
bean.setFsubjno(info.getFsubjno() == null ? "-1" : info.getFsubjno());
bean.setSubjlevel(info.getSubjlevel());
+ bean.setBalflag(info.getBalflag());
bean.setDisplayflag(info.getDisplayflag());
bean.setLastdaydrbal(info.getLastdaydrbal() == null ? 0.00 : info.getLastdaydrbal());
bean.setLastdaycrbal(info.getLastdaycrbal() == null ? 0.00 : info.getLastdaycrbal());
}
dtl.befbal = account.availbal
doRecalcAccountBalance(dtl, amount, account)
- account.availbal += dtl. amount
- account.balance += dtl. amount
+ account.availbal += amount
+ account.balance += amount
val sameDay = DateUtil.sameDay(account.lasttranstime,
systemUtilServcie.sysdatetime.sysdate) ?: false
import com.supwisdom.dlpay.api.domain.*
import com.supwisdom.dlpay.api.repositories.AccountService
import com.supwisdom.dlpay.api.service.AccountUtilServcie
-import com.supwisdom.dlpay.api.service.KafkaSendMsgService
import com.supwisdom.dlpay.api.service.SourceTypeService
import com.supwisdom.dlpay.api.service.TransactionService
import com.supwisdom.dlpay.exception.TransactionCheckException
@Autowired
private lateinit var sourceTypeService: SourceTypeService
- @Autowired
- private lateinit var kafkaSendMsgService: KafkaSendMsgService
-
/// 公共函数部分
private fun preCheck(builder: TransactionBuilder) {
transaction.endTime = systemUtilService.sysdatetime.sysdate
transactionMainDao.save(transaction)
- if (transaction.person && !transaction.personDtl.userid.isNullOrEmpty()) {
- kafkaSendMsgService.sendJpushMessage(transaction.personDtl.userid, "交易提醒", "你有一笔${transaction.personDtl.amount}元的支出,点击查看详情", transaction.refno, mutableMapOf(), transaction.tenantid)
- }
return transaction
}
@Autowired
private lateinit var shopAccBalanceAsyncTask: ShopAccBalanceAsyncTask
+ @Autowired
+ private lateinit var kafkaSendMsgService: KafkaSendMsgService
+
fun init(builder: TransactionBuilder): TTransactionMain {
try {
if (it.shop) {
shopAccBalanceAsyncTask.updateShopBalance(it.shopDtl)
}
+
+ if (it.person && !it.personDtl.userid.isNullOrEmpty()) {
+ kafkaSendMsgService.sendJpushMessage(it.personDtl.userid, "交易提醒", "你有一笔${it.personDtl.amount}元的支出,点击查看详情", it.refno, mutableMapOf(), it.tenantid)
+ }
}
}
cols: [
[
{field: 'refno', title: '参考号', align: 'center', width: 200, sort: true},
- {field: 'accdate', title: '记账日期', align: 'center', width: 10 0, sort: true},
+ {field: 'accdate', title: '记账日期', align: 'center', width: 11 0, sort: true},
{field: 'transdesc', title: '交易描述', align: 'center', width: 175},
{field: 'shopname', title: '商户名称', align: 'center', width: 250},
{
}
}
},
- {
- field: 'tradeflag',
- title: '类型',
- align: 'center',
- width: 60,
- templet: function (item) {
- if (item.tradeflag === 'in') {
- return '<span style="color: green;">收入</span>';
- } else if (item.tradeflag === 'out') {
- return '<span style="color: red;">支出</span>';
- } else {
- return item.tradeflag;
- }
- }
- },
- {field: 'transdate', title: '交易日期', align: 'center', width: 10 0, sort: true},
- {field: 'transtime', title: '交易时间', align: 'center', width: 10 0, sort: true},
+ // {
+ // field: 'tradeflag',
+ // title: '类型',
+ // align: 'center',
+ // width: 60,
+ // templet: function (item) {
+ // if (item.tradeflag === 'in') {
+ // return '<span style="color: green;">收入</span>';
+ // } else if (item.tradeflag === 'out') {
+ // return '<span style="color: red;">支出</span>';
+ // } else {
+ // return item.tradeflag;
+ // }
+ // }
+ // },
+ {field: 'transdate', title: '交易日期', align: 'center', width: 11 0, sort: true},
+ {field: 'transtime', title: '交易时间', align: 'center', width: 11 0, sort: true},
{
field: 'sourceType',
title: '支付方式',
{field: 'oppositeAccName', title: '交易对象', align: 'center', width: 150},
// {field: 'outtradeno', title: '子系统订单号', align: 'center', width: 200},
{field: 'transcode', title: '交易码', align: 'center', width: 100},
- {field: 'remark', title: '备注信息', align: 'center', width: 20 0}
+ {field: 'remark', title: '备注信息', align: 'center', width: 25 0}
]
]
});
cols: [
[
{field: 'refno', title: '参考号', align: 'center', width: 200, sort: true},
- {field: 'accdate', title: '记账日期', align: 'center', width: 10 0, sort: true},
+ {field: 'accdate', title: '记账日期', align: 'center', width: 11 0, sort: true},
{field: 'transdesc', title: '交易描述', align: 'center', width: 175},
{field: 'userName', title: '姓名', align: 'center', width: 150},
{
}
}
},
- {
- field: 'tradeflag',
- title: '类型',
- align: 'center',
- width: 60,
- templet: function (item) {
- if (item.tradeflag === 'in') {
- return '<span style="color: green;">收入</span>';
- } else if (item.tradeflag === 'out') {
- return '<span style="color: red;">支出</span>';
- } else {
- return item.tradeflag;
- }
- }
- },
- {field: 'transdate', title: '交易日期', align: 'center', width: 10 0, sort: true},
- {field: 'transtime', title: '交易时间', align: 'center', width: 10 0, sort: true},
+ // {
+ // field: 'tradeflag',
+ // title: '类型',
+ // align: 'center',
+ // width: 60,
+ // templet: function (item) {
+ // if (item.tradeflag === 'in') {
+ // return '<span style="color: green;">收入</span>';
+ // } else if (item.tradeflag === 'out') {
+ // return '<span style="color: red;">支出</span>';
+ // } else {
+ // return item.tradeflag;
+ // }
+ // }
+ // },
+ {field: 'transdate', title: '交易日期', align: 'center', width: 11 0, sort: true},
+ {field: 'transtime', title: '交易时间', align: 'center', width: 11 0, sort: true},
{
field: 'sourceType',
title: '支付方式',
{field: 'oppositeAccName', title: '交易对象', align: 'center', width: 250},
{field: 'outtradeno', title: '子系统订单号', align: 'center', width: 200},
{field: 'transcode', title: '交易码', align: 'center', width: 100},
- {field: 'remark', title: '备注信息', align: 'center', width: 20 0}
+ {field: 'remark', title: '备注信息', align: 'center', width: 25 0}
]
]
});
},
{
field: 'consumeEnable',
- title: '能否 消费',
+ title: '允许 消费',
align: 'center',
templet: '#consumeenable-tpl-state',
sort: true
},
{
field: 'reversable',
- title: '能否冲正 ',
+ title: '允许撤销 ',
align: 'center',
templet: '#reversable-tpl-state',
sort: true
<div class="layui-form-item" th:if="${configlist.size()} gt 0" th:each="config:${configlist}">
<div class="layui-input-block" style="margin:0;display: inline;float: left;width: 25%;">
- <label class="layui-form-label" style="float: right;width: 100%;" th:text="${config.configid }">参数名</label>
+ <label class="layui-form-label" style="float: right;width: 100%;" th:text="${config.configName }">参数名</label>
</div>
<div class="layui-input-block" style="margin:0;display: inline;float: right;width: 75%;">
- <input type="text" th:name="${config.configid}" class="layui-input" th:value="${config.configValue}" th:placeholder="${config.configName }" autocomplete="off"/>
+ <input type="text" th:name="${config.configid}" class="layui-input" th:value="${config.configValue}" th:placeholder="${config.configid }" autocomplete="off"/>
</div>
</div>
</div>
<div class="layui-form-item">
- <label class="layui-form-label">能否 消费</label>
+ <label class="layui-form-label">允许 消费</label>
<div class="layui-input-block">
<input name="consumeEnable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
lay-verify="required" checked/>
</div>
<div class="layui-form-item">
- <label class="layui-form-label">能否冲正 </label>
+ <label class="layui-form-label">允许撤销 </label>
<div class="layui-input-block">
<input name="reversable" type="checkbox" lay-skin="switch" lay-text="启用|关闭" value="yes"
lay-verify="required" checked/>
},
// {align: 'center', title: '期初余额', colspan: 2},
{align: 'center', title: '本期发生额', colspan: 2},
- {align: 'center', title: '期末扎差', colspan: 2}
+ {
+ align: 'center', title: '期末扎差', rowspan: 2, templet: function (e) {
+ if(e.balflag == 1){
+ return parseFloat(e.drbal).toFixed(2);
+ }else{
+ return parseFloat(e.crbal).toFixed(2);
+ }
+
+ }
+ }
], [
// {field: 'lastdaydrbal', title: '借方', align: 'center'},
// {field: 'lastdaycrbal', title: '贷方', align: 'center'},
field: 'cramt', title: '贷方', align: 'center', templet: function (e) {
return parseFloat(e.cramt).toFixed(2);
}
- },
- {
- field: 'drbal', title: '借方', align: 'center', templet: function (e) {
- return parseFloat(e.drbal).toFixed(2);
- }
- },
- {
- field: 'crbal', title: '贷方', align: 'center', templet: function (e) {
- return parseFloat(e.crbal).toFixed(2);
- }
}
+ // ,{
+ // field: 'drbal', title: '借方', align: 'center', templet: function (e) {
+ // return parseFloat(e.drbal).toFixed(2);
+ // }
+ // },
+ // {
+ // field: 'crbal', title: '贷方', align: 'center', templet: function (e) {
+ // return parseFloat(e.crbal).toFixed(2);
+ // }
+ // }
]
],
// cols: [
</select>
</div>
<div class="layui-form-mid layui-word-aux">
- 注意:商户组无商户账号,且能创建下级商户。结算商户是叶子商户,会创建商户账号 。保存后无法修改!!!
+ 注意:商户组无商户编码,且能创建下级商户。结算商户是叶子商户,会创建商户编码 。保存后无法修改!!!
Content-type: text/html
Supwisdom Source - epayment/food_payapi.git/commitdiff
500 - Internal Server Error
Unknown encoding 'gb18030' at /usr/local/share/gitweb/gitweb.cgi line 1539