From a658b298e36615c98db805db6e2bcfc90fb05f2b Mon Sep 17 00:00:00 2001 From: infin_caishuxiao Date: Sat, 24 Feb 2018 18:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5fastjson,=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=BE=E6=9C=9F=E5=A4=A9=E6=95=B0=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor-collection-dispatcher/pom.xml | 5 ++ .../collection/CronCollectionServiceImpl.java | 20 +++++++ .../cron/collection/table/TBizCollection.java | 20 +++++++ .../prd/TBizCollectionRecordMapper.xml | 56 ++++++------------- infintech-executors/pom.xml | 1 + 5 files changed, 64 insertions(+), 38 deletions(-) diff --git a/infintech-executors/executor-collection-dispatcher/pom.xml b/infintech-executors/executor-collection-dispatcher/pom.xml index 084ebdb4..bb48c418 100644 --- a/infintech-executors/executor-collection-dispatcher/pom.xml +++ b/infintech-executors/executor-collection-dispatcher/pom.xml @@ -91,6 +91,11 @@ guava ${guava.version} + + com.alibaba + fastjson + ${fastjson.version} + com.xuxueli diff --git a/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/CronCollectionServiceImpl.java b/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/CronCollectionServiceImpl.java index 2a4aa85e..7a304aea 100644 --- a/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/CronCollectionServiceImpl.java +++ b/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/CronCollectionServiceImpl.java @@ -62,11 +62,31 @@ public class CronCollectionServiceImpl implements CronCollectionService String userRealName = (String) tmpMap.get("real_name"); s.setFkSystemUser(userId); s.setCollectorLoginName(userRealName); + long ll = dateSubstract(new Date(), s.getRepaymentDate()); + s.setOverdueDayCount(Short.valueOf("" + ll)); + String tmp = ""; + tmp += s.getDeadline(); + if("0".equals(s.getUnit().trim())) { + //天 + tmp += " Day"; + + } else if ("1".equals(s.getUnit().trim())) { + //月 + tmp += " Month"; + } else { + throw new InfintechException("getUnit error! unit:" + s.getUnit()); + } + s.setProjectPeriod(tmp); a++; } //拼接List resultList.addAll(list); } + if (resultList.size()==0) { + throw new InfintechException("resultList empty!"); + } + XxlJobLogger.log("new"); + XxlJobLogger.log(resultList.get(0).toString()); collectionMapper.insertBatch(resultList); } diff --git a/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/table/TBizCollection.java b/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/table/TBizCollection.java index 36972c38..500eead8 100644 --- a/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/table/TBizCollection.java +++ b/infintech-executors/executor-collection-dispatcher/src/main/java/com/infincash/cron/collection/table/TBizCollection.java @@ -3,6 +3,8 @@ package com.infincash.cron.collection.table; import java.math.BigDecimal; import java.util.Date; +import com.alibaba.fastjson.JSON; + public class TBizCollection { private Long id; @@ -24,6 +26,8 @@ public class TBizCollection { private Integer deadline; + private String projectPeriod; + private String unit; private BigDecimal firstPriceLoan; @@ -237,4 +241,20 @@ public class TBizCollection { { this.unit = unit; } + + public String getProjectPeriod() + { + return projectPeriod; + } + + public void setProjectPeriod(String projectPeriod) + { + this.projectPeriod = projectPeriod; + } + + @Override + public String toString() { + return JSON.toJSONString(this); + } + } \ No newline at end of file diff --git a/infintech-executors/executor-collection-dispatcher/src/main/resources/mapping/prd/TBizCollectionRecordMapper.xml b/infintech-executors/executor-collection-dispatcher/src/main/resources/mapping/prd/TBizCollectionRecordMapper.xml index c1515a17..11f73fc6 100644 --- a/infintech-executors/executor-collection-dispatcher/src/main/resources/mapping/prd/TBizCollectionRecordMapper.xml +++ b/infintech-executors/executor-collection-dispatcher/src/main/resources/mapping/prd/TBizCollectionRecordMapper.xml @@ -34,10 +34,13 @@ t_u.login_name user_login_name, t_ub.real_name user_real_name, t_u.phone user_phone, + t_biz.user_id fk_t_user, + t_biz.fk_t_project, t_biz.loan_time, t_biz.deadline, t_biz.unit, - t_biz.first_price_loan, t_biz.repayment_date + t_biz.first_price_loan, + t_biz.repayment_date from ( select @@ -67,51 +70,31 @@ insert into t_biz_collection_record + + "collectorLoginName": "HARRY", + "deadline": 1, + "firstPriceLoan": 1800000.00, + "fkSystemUser": "00101519376707262349", + "loanTime": 1511663497000, + "projectNumber": "GO20171125435400", + "repaymentDate": 1514217600000, + "unit": "1", + "userLoginName": "MF_qmjoqz", + "userPhone": "085934509604", + "userRealName": "Sandhi Trisnadi" + - - id, - - fk_t_project, - - fk_t_user, - - fk_system_user, - - - wait_or_record, - - project_number, - - user_login_name, - - user_real_name, - - user_phone, - - loan_time, - - project_period, - - first_price_loan, - - - repayment_date, - - - overdue_day_count, - - - fk_t_biz_collection_overdue_bucket_interval_id, + repayment_date collector_login_name, @@ -141,9 +124,6 @@ VALUES ( - - #{oneItem.id,jdbcType=BIGINT}, - #{oneItem.fkTProject,jdbcType=VARCHAR}, diff --git a/infintech-executors/pom.xml b/infintech-executors/pom.xml index ad9f9006..9af08e1f 100644 --- a/infintech-executors/pom.xml +++ b/infintech-executors/pom.xml @@ -17,6 +17,7 @@ 23.6-jre + 1.2.46 \ No newline at end of file