现场要求修改
authorXia Kaixiang <kaixiang.xia@supwisdom.com>
Thu, 24 Oct 2019 07:54:51 +0000 (15:54 +0800)
committerXia Kaixiang <kaixiang.xia@supwisdom.com>
Thu, 24 Oct 2019 07:59:49 +0000 (15:59 +0800)
23 files changed:
payapi/src/main/java/com/supwisdom/dlpay/framework/dao/SubjectdayDao.java
payapi/src/main/java/com/supwisdom/dlpay/framework/util/StringUtil.java
payapi/src/main/java/com/supwisdom/dlpay/system/bean/SubjectDayInfo.java
payapi/src/main/java/com/supwisdom/dlpay/system/bean/SubjectDayShowBean.java
payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java
payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/SettleReportServiceImpl.java
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/account_service_impl.kt
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_service_impl.kt
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/transaction_service.kt
payapi/src/main/resources/templates/system/dtl/shopdtl.html
payapi/src/main/resources/templates/system/dtl/userdtl.html
payapi/src/main/resources/templates/system/param/sourcetype.html
payapi/src/main/resources/templates/system/param/sourcetypeconfig.html
payapi/src/main/resources/templates/system/param/sourcetypeform.html
payapi/src/main/resources/templates/system/report/subjectday.html
payapi/src/main/resources/templates/system/shop/addshop.html
payapi/src/main/resources/templates/system/shop/config.html
payapi/src/main/resources/templates/system/shop/configform.html
payapi/src/main/resources/templates/system/shop/configpara.html
payapi/src/main/resources/templates/system/shop/index.html
payapi/src/main/resources/templates/system/shop/opercheck.html
payapi/src/main/resources/templates/system/shop/shopdetail.html
payapi/src/main/resources/templates/system/shop/updateshop.html

index fb65662..34deede 100644 (file)
@@ -36,7 +36,7 @@ public interface SubjectdayDao extends JpaRepository<TSubjectday, TSubjectdayPK>
       "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 " +
index ec68890..628137b 100644 (file)
@@ -182,4 +182,43 @@ public class StringUtil {
     }
     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;
+  }
 }
index f31d5b5..34aa0af 100644 (file)
@@ -9,6 +9,8 @@ public interface SubjectDayInfo {
 
   Integer getSubjlevel();
 
+  Integer getBalflag();
+
   String getDisplayflag();
 
   Double getLastdaydrbal();
index c36c212..94ec1f1 100644 (file)
@@ -5,6 +5,7 @@ public class SubjectDayShowBean {
   private String subjname;
   private String fsubjno;
   private Integer subjlevel;
+  private Integer balflag;
   private String displayflag;
   private Double lastdaydrbal;
   private Double lastdaycrbal;
@@ -45,6 +46,14 @@ public class SubjectDayShowBean {
     this.subjlevel = subjlevel;
   }
 
+  public Integer getBalflag() {
+    return balflag;
+  }
+
+  public void setBalflag(Integer balflag) {
+    this.balflag = balflag;
+  }
+
   public String getDisplayflag() {
     return displayflag;
   }
index 3d1a963..399d728 100644 (file)
@@ -146,7 +146,10 @@ public class ShopController {
     } 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);
@@ -227,6 +230,8 @@ public class ShopController {
     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();
index e85609c..7aaac69 100644 (file)
@@ -59,6 +59,7 @@ public class SettleReportServiceImpl implements SettleReportService {
       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());
index af77132..5bc63a9 100644 (file)
@@ -65,8 +65,8 @@ class AccountServiceImpl : AccountService {
                     }
                     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
index 2b43122..5e431b7 100644 (file)
@@ -5,7 +5,6 @@ import com.supwisdom.dlpay.api.dao.TransactionMainDao
 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
@@ -36,9 +35,6 @@ class TransactionServiceImpl : TransactionService {
     @Autowired
     private lateinit var sourceTypeService: SourceTypeService
 
-    @Autowired
-    private lateinit var kafkaSendMsgService: KafkaSendMsgService
-
 
     /// 公共函数部分
     private fun preCheck(builder: TransactionBuilder) {
@@ -388,9 +384,6 @@ class TransactionServiceImpl : TransactionService {
 
         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
     }
 
index 4ab8b65..861212a 100644 (file)
@@ -63,6 +63,9 @@ class TransactionServiceProxy {
     @Autowired
     private lateinit var shopAccBalanceAsyncTask: ShopAccBalanceAsyncTask
 
+    @Autowired
+    private lateinit var kafkaSendMsgService: KafkaSendMsgService
+
 
     fun init(builder: TransactionBuilder): TTransactionMain {
         try {
@@ -95,6 +98,10 @@ class TransactionServiceProxy {
             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)
+            }
         }
     }
 
index 553409a..e606eae 100644 (file)
             cols: [
                 [
                     {field: 'refno', title: '参考号', align: 'center', width: 200, sort: true},
-                    {field: 'accdate', title: '记账日期', align: 'center', width: 100, sort: true},
+                    {field: 'accdate', title: '记账日期', align: 'center', width: 110, 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: 100, sort: true},
-                    {field: 'transtime', title: '交易时间', align: 'center', width: 100, 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: 110, sort: true},
+                    {field: 'transtime', title: '交易时间', align: 'center', width: 110, 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: 200}
+                    {field: 'remark', title: '备注信息', align: 'center', width: 250}
                 ]
             ]
         });
index 6d2ea96..dfd3526 100644 (file)
             cols: [
                 [
                     {field: 'refno', title: '参考号', align: 'center', width: 200, sort: true},
-                    {field: 'accdate', title: '记账日期', align: 'center', width: 100, sort: true},
+                    {field: 'accdate', title: '记账日期', align: 'center', width: 110, 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: 100, sort: true},
-                    {field: 'transtime', title: '交易时间', align: 'center', width: 100, 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: 110, sort: true},
+                    {field: 'transtime', title: '交易时间', align: 'center', width: 110, 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: 200}
+                    {field: 'remark', title: '备注信息', align: 'center', width: 250}
                 ]
             ]
         });
index 74087c2..ec041be 100644 (file)
                     },
                     {
                         field: 'consumeEnable',
-                        title: '能否消费',
+                        title: '允许消费',
                         align: 'center',
                         templet: '#consumeenable-tpl-state',
                         sort: true
                     },
                     {
                         field: 'reversable',
-                        title: '能否冲正',
+                        title: '允许撤销',
                         align: 'center',
                         templet: '#reversable-tpl-state',
                         sort: true
index 2924cdb..4cc1461 100644 (file)
@@ -9,10 +9,10 @@
 
     <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>
 
index ca3f5df..60fd97d 100644 (file)
@@ -52,7 +52,7 @@
     </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/>
@@ -68,7 +68,7 @@
     </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/>
index 8767b73..9ff137c 100644 (file)
                         },
                         // {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: [
index 1a1bd62..9a2a8cc 100644 (file)
                     </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