提交任务框架代码
This commit is contained in:
+158
@@ -0,0 +1,158 @@
|
|||||||
|
*.classpath
|
||||||
|
*.project
|
||||||
|
*.log
|
||||||
|
*.psf
|
||||||
|
*.class
|
||||||
|
*/target/classes/*
|
||||||
|
.metadata
|
||||||
|
deliverables/.pmd
|
||||||
|
/workspace
|
||||||
|
/g-workspace
|
||||||
|
/projects/goojia*
|
||||||
|
/projects/WebCrawl*
|
||||||
|
/projects/goojia-batch/.settings
|
||||||
|
/projects/goojia-batch/target
|
||||||
|
/projects/goojia-coresite/.settings
|
||||||
|
/projects/goojia-coresite/target
|
||||||
|
/projects/goojia-dal/.settings
|
||||||
|
/projects/goojia-dal/target
|
||||||
|
/projects/goojia-service/.settings
|
||||||
|
/projects/goojia-service/target
|
||||||
|
/projects/goojia-static/.settings
|
||||||
|
/projects/goojia-static/target
|
||||||
|
/projects/upload/.settings
|
||||||
|
/projects/upload/target
|
||||||
|
/projects/fangjiatong/web-app/WEB-INF/classes
|
||||||
|
/projects/goojia-bkoff/.settings
|
||||||
|
/projects/goojia-bkoff/target
|
||||||
|
/projects/goojia-bkoff/web-app/WEB-INF/classes
|
||||||
|
/projects/goojia-api/.settings
|
||||||
|
/projects/goojia-script/.settings
|
||||||
|
/projects/goojia-script/bin-groovy
|
||||||
|
/projects/logs
|
||||||
|
/projects/goojia-open/.settings
|
||||||
|
/projects/goojia-open/target
|
||||||
|
/projects/goojia-datastore/.settings
|
||||||
|
/projects/goojia-datastore/target
|
||||||
|
/projects/goojia-auto/.settings
|
||||||
|
/projects/goojia-auto/target
|
||||||
|
/projects/zhongjietong/.settings
|
||||||
|
/projects/zhongjietong/target
|
||||||
|
/projects/fangjia-script/.idea
|
||||||
|
/projects/fangjia-script/fangjia-script.iml
|
||||||
|
/projects/.idea/
|
||||||
|
|
||||||
|
|
||||||
|
*/sothis-*/test-output
|
||||||
|
*/fangjia-*/test-output
|
||||||
|
*/fangjia-*/bin
|
||||||
|
*/fangjia-*/target
|
||||||
|
*/sothis-*/bin
|
||||||
|
*/chafangtong-*/bin
|
||||||
|
|
||||||
|
/projects/WebCrawl/dist/????????.doc
|
||||||
|
/projects/goojia-etl-ui/conf/???????/??С??????.xml
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r10_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r11_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r12_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r13_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r14_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r15_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r16_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r1_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r1_c3.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r1_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r2_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r2_c5.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r2_c6.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r3_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r4_c4.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r5_c3.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r6_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r6_c2.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r7_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r8_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/daren/???????_r9_c1.jpg
|
||||||
|
/projects/goojia-static/src/main/webapp/images/demo/?????.bmp
|
||||||
|
/projects/goojia-static/src/main/webapp/images/user_center/???? button_bg_2.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r1_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r2_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r3_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r4_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r5_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r5_c2.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r5_c3.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r5_c4.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r6_c2.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r7_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/christmas_PPC/???????_r8_c1.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/search/?????.gif
|
||||||
|
/projects/goojia-static/src/main/webapp/images/v3/telephone/??????????.jpg
|
||||||
|
/projects/fangjia-static/.freemarker-ide.xml
|
||||||
|
/deliverables/*/.idea
|
||||||
|
*.iml
|
||||||
|
/projects/fangjia-open/.idea
|
||||||
|
/projects/chafangtong/target/classes/sothis.properties
|
||||||
|
/projects/fangjia-script/sdklog/sdkclient_EMAYSDK_info
|
||||||
|
/projects/fangjia-script/sdklog/sdkclient_CommunicateLog_info
|
||||||
|
/projects/fangjia-script/src/main/groovy/com/fangjia/script/dataImport/DistrictDeveloperUpdateImport.groovy
|
||||||
|
/projects/fangjia-coresite/.idea/libraries
|
||||||
|
/projects/fangjia-coresite/.idea
|
||||||
|
/projects/fangjia-coresite/sdklog/sdkclient_CommunicateLog_info
|
||||||
|
/projects/fangjia-coresite/sdklog/sdkclient_EMAYSDK_info
|
||||||
|
/projects/fangjia-script/src/main/groovy/com/fangjia/script/wenyan/sdklog
|
||||||
|
/projects/chafangtong/target/classes
|
||||||
|
/projects/chafangtong/target/classes
|
||||||
|
/projects/fangjia-crawler/.idea
|
||||||
|
/projects/fangjia-crawler/target/classes
|
||||||
|
.idea/
|
||||||
|
/projects/sdklog/sdkclient_EMAYSDK_info
|
||||||
|
/projects/fangjia-bkoff/sdklog/sdkclient_CommunicateLog_info
|
||||||
|
/projects/fangjia-bkoff/sdklog/sdkclient_EMAYSDK_info
|
||||||
|
/projects/fangjia-amp/.classpath
|
||||||
|
deliverables/fangjia/sdklog/sdkclient_EMAYSDK_info
|
||||||
|
deliverables/fangjia/sdklog/sdkclient_CommunicateLog_info
|
||||||
|
/Servers/.settings/org.eclipse.wst.server.core.prefs
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/catalina.policy
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/catalina.properties
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/context.xml
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/server.xml
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/tomcat-users.xml
|
||||||
|
/Servers/Tomcat v7.0 Server at localhost-config/web.xml
|
||||||
|
/deliverables/script/.settings/*.prefs
|
||||||
|
/projects/fangjia-amp/.settings/org.eclipse.jdt.core.
|
||||||
|
|
||||||
|
# maven ignore
|
||||||
|
target/
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.zip
|
||||||
|
*.tar
|
||||||
|
*.tar.gz
|
||||||
|
|
||||||
|
# eclipse ignore
|
||||||
|
.settings/
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
|
||||||
|
# idea ignore
|
||||||
|
.idea/
|
||||||
|
*.ipr
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# temp ignore
|
||||||
|
*.log
|
||||||
|
*.lck
|
||||||
|
http.log*
|
||||||
|
*.cache
|
||||||
|
*.diff
|
||||||
|
*.patch
|
||||||
|
*.tmp
|
||||||
|
*.java~
|
||||||
|
*.properties~
|
||||||
|
*.xml~
|
||||||
|
|
||||||
|
# system ignore
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.fangjia</groupId>
|
||||||
|
<artifactId>fangjia-job</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>fangjia-job-common</artifactId>
|
||||||
|
<name>fangjia-job-common</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>joda-time</groupId>
|
||||||
|
<artifactId>joda-time</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.openfeign</groupId>
|
||||||
|
<artifactId>feign-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.fangjia.job.common.base;
|
||||||
|
|
||||||
|
public class Response {
|
||||||
|
private Boolean status = true;
|
||||||
|
private int code = 200;
|
||||||
|
private String message;
|
||||||
|
private Object data;
|
||||||
|
public Boolean getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
public void setStatus(Boolean status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
public Object getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
public void setData(Object data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+82
@@ -0,0 +1,82 @@
|
|||||||
|
package com.fangjia.job.common.core;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小区分片KEY
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class DistrictShardingKey {
|
||||||
|
|
||||||
|
public static Map<String, List<String>> provinceCityKeys = new ConcurrentHashMap<String, List<String>>();
|
||||||
|
public static Map<String, List<String>> cityGradeKeys = new ConcurrentHashMap<String, List<String>>();
|
||||||
|
public static Map<String, List<String>> cityZiMuKeys = new ConcurrentHashMap<String, List<String>>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
provinceCityKeys.put("上海", Arrays.asList("上海"));
|
||||||
|
provinceCityKeys.put("云南", Arrays.asList("丽江","大理","临沧","保山","楚雄","西双版纳州","昆明","曲靖","玉溪","昭通","普洱","红河","文山州","德宏州","怒江州","迪庆州"));
|
||||||
|
provinceCityKeys.put("内蒙古", Arrays.asList("呼和浩特","包头","乌海","巴彦淖尔","呼伦贝尔","乌兰察布","赤峰","鄂尔多斯","通辽","兴安盟","锡林郭勒盟","阿拉善盟"));
|
||||||
|
provinceCityKeys.put("北京", Arrays.asList("北京"));
|
||||||
|
provinceCityKeys.put("吉林", Arrays.asList("长春","吉林","松原","延边","四平","辽源","白山","白城","通化"));
|
||||||
|
provinceCityKeys.put("四川", Arrays.asList("成都","绵阳","宜宾","自贡","攀枝花","南充","泸州","资阳","眉山","甘孜州","凉山州","广元","乐山","内江","达州","巴中","遂宁","德阳","广安","雅安","阿坝州"));
|
||||||
|
provinceCityKeys.put("天津", Arrays.asList("天津"));
|
||||||
|
provinceCityKeys.put("宁夏", Arrays.asList("银川","固原","吴忠","中卫","石嘴山"));
|
||||||
|
provinceCityKeys.put("安徽", Arrays.asList("合肥","芜湖","马鞍山","黄山","亳州","六安","淮北","池州","蚌埠","滁州","铜陵","淮南","阜阳","安庆","宣城","宿州"));
|
||||||
|
provinceCityKeys.put("山东", Arrays.asList("烟台","潍坊","临沂","东营","德州","济宁","聊城","莱芜","青岛","济南","威海","淄博","泰安","菏泽","日照","滨州","枣庄"));
|
||||||
|
provinceCityKeys.put("山西", Arrays.asList("太原","临汾","忻州","晋中","阳泉","运城","大同","朔州","长治","吕梁","晋城"));
|
||||||
|
provinceCityKeys.put("广东", Arrays.asList("广州","深圳","东莞","珠海","清远","江门","肇庆","潮州","河源","揭阳","茂名","韶关","梅州","云浮","佛山","中山","湛江","惠州","汕头","阳江","汕尾"));
|
||||||
|
provinceCityKeys.put("广西", Arrays.asList("南宁","桂林","北海","柳州","钦州","百色","来宾","防城港","崇左","贵港","玉林","梧州","河池","贺州"));
|
||||||
|
provinceCityKeys.put("新疆", Arrays.asList("乌鲁木齐","克拉玛依","阿克苏","喀什","昌吉","吐鲁番","哈密","塔城","阿勒泰","博尔塔拉","图木舒克","双河","铁门关","可克达拉","和田","巴音郭楞","克孜勒苏","伊犁","石河子","阿拉尔","五家渠","北屯"));
|
||||||
|
provinceCityKeys.put("江苏", Arrays.asList("扬州","无锡","徐州","镇江","盐城","南京","苏州","常州","南通","泰州","宿迁","连云港","淮安"));
|
||||||
|
provinceCityKeys.put("江西", Arrays.asList("赣州","九江","吉安","新余","萍乡","南昌","景德镇","鹰潭","上饶","宜春","抚州"));
|
||||||
|
provinceCityKeys.put("河北", Arrays.asList("石家庄","唐山","秦皇岛","沧州","张家口","邢台","邯郸","廊坊","保定","衡水","承德"));
|
||||||
|
provinceCityKeys.put("河南", Arrays.asList("洛阳","焦作","平顶山","南阳","开封","信阳","驻马店","漯河","鹤壁","周口","三门峡","济源","郑州","安阳","新乡","许昌","濮阳","商丘"));
|
||||||
|
provinceCityKeys.put("浙江", Arrays.asList("宁波","台州","金华","舟山","杭州","温州","嘉兴","绍兴","湖州","衢州","丽水"));
|
||||||
|
provinceCityKeys.put("海南", Arrays.asList("三亚","三沙","昌江","琼中","五指山","万宁","东方","海口","琼海","乐东","陵水","保亭","儋州","屯昌","澄迈","临高","文昌","白沙","定安"));
|
||||||
|
provinceCityKeys.put("湖北", Arrays.asList("武汉","襄阳","黄石","荆门","咸宁","宜昌","黄冈","鄂州","十堰","随州","孝感","荆州","恩施","仙桃","潜江","天门","神农架"));
|
||||||
|
provinceCityKeys.put("湖南", Arrays.asList("株洲","湘潭","常德","邵阳","益阳","娄底","长沙","张家界","衡阳","岳阳","怀化","郴州","永州","湘西"));
|
||||||
|
provinceCityKeys.put("甘肃", Arrays.asList("定西","白银","酒泉","金昌","陇南","兰州","武威","天水","平凉","张掖","嘉峪关","庆阳","临夏","甘南"));
|
||||||
|
provinceCityKeys.put("福建", Arrays.asList("福州","厦门","宁德","三明","龙岩","泉州","莆田","南平","漳州"));
|
||||||
|
provinceCityKeys.put("西藏", Arrays.asList("拉萨","昌都","日喀则","山南","那曲","阿里","林芝"));
|
||||||
|
provinceCityKeys.put("贵州", Arrays.asList("贵阳","安顺","铜仁","黔西南","六盘水","遵义","毕节","黔东南","黔南"));
|
||||||
|
provinceCityKeys.put("辽宁", Arrays.asList("大连","鞍山","营口","盘锦","本溪","抚顺","沈阳","丹东","铁岭","锦州","朝阳","阜新","葫芦岛","辽阳"));
|
||||||
|
provinceCityKeys.put("重庆", Arrays.asList("重庆"));
|
||||||
|
provinceCityKeys.put("陕西", Arrays.asList("西安","延安","铜川","渭南","商洛","咸阳","汉中","安康","榆林","宝鸡"));
|
||||||
|
provinceCityKeys.put("青海", Arrays.asList("西宁","海东","海北州","黄南州","海南州","玉树州","海西州","果洛州"));
|
||||||
|
provinceCityKeys.put("黑龙江", Arrays.asList("哈尔滨","牡丹江","佳木斯","双鸭山","鹤岗","黑河","大兴安岭","大庆","齐齐哈尔","绥化","鸡西","七台河","伊春"));
|
||||||
|
|
||||||
|
cityGradeKeys.put("1", Arrays.asList("北京","广州","深圳","上海"));
|
||||||
|
cityGradeKeys.put("2", Arrays.asList("成都","西安","重庆","武汉","石家庄","福州","厦门","宁波","大连","无锡","太原","东莞","合肥","贵阳","呼和浩特","哈尔滨","长春","烟台","乌鲁木齐","杭州","南京","天津","沈阳","苏州","长沙","青岛","济南","佛山","郑州","昆明","南昌","兰州","泉州"));
|
||||||
|
cityGradeKeys.put("3", Arrays.asList("扬州","银川","徐州","珠海","吉林","镇江","芜湖","洛阳","桂林","潍坊","西宁","绵阳","株洲","台州","秦皇岛","金华","马鞍山","江门","鞍山","盐城","赣州","柳州","九江","揭阳","茂名","牡丹江","平顶山","本溪","包头","常德","大同","温州","中山","威海","湛江","常州","嘉兴","海口","惠州","邯郸","南通","绍兴","泰州","保定","湖州","连云港","淄博","宜昌","大庆","汕头","衡阳","齐齐哈尔"));
|
||||||
|
cityGradeKeys.put("4", Arrays.asList("三亚","唐山","南宁","襄阳","湘潭","宜宾","自贡","清远","攀枝花","延安","北海","丽江","大理","肇庆","营口","潮州","河源","黄石","焦作","盘锦","韶关","梅州","云浮","舟山","佳木斯","南阳","临沂","临汾","咸阳","廊坊","衢州","宿迁","张家界","六盘水","莆田","玉林","安阳","曲靖","新乡","阳江","玉溪","岳阳","许昌","四平","淮南","淮安","赤峰","榆林"));
|
||||||
|
cityGradeKeys.put("5", Arrays.asList("定西","黄山","安顺","钦州","百色","沧州","东营","德州","亳州","六安","宁德","三沙","临沧","拉萨","南充","泸州","资阳","乌海","邵阳","克拉玛依","巴彦淖尔","荆门","来宾","开封","信阳","固原","驻马店","防城港","铜川","呼伦贝尔","双鸭山","崇左","白银","吉安","鹤岗","海东","黑河","抚顺","张家口","邢台","济宁","聊城","淮北","三明","龙岩","保山","池州","铜仁","乌兰察布","贵港","漯河","松原","眉山","鹤壁","忻州","晋中","益阳","酒泉","新余","周口","莱芜","阳泉","运城","蚌埠","渭南","滁州","铜陵","娄底","咸宁","三门峡","商洛","金昌","陇南","萍乡","吴忠","阿克苏","喀什","昌吉","楚雄","大兴安岭","吐鲁番","哈密","塔城","阿勒泰","博尔塔拉","黔西南","延边","海北州","黄南州","海南州","玉树州","海西州","甘孜州","凉山州","西双版纳州","图木舒克","昌江","济源","琼中","五指山","万宁","东方","双河","铁门关","可克达拉","丹东","遵义","中卫","武威","铁岭","天水","泰安","黄冈","广元","阜阳","辽源","丽水","乐山","菏泽","锦州","汉中","白山","安康","绥化","鄂尔多斯","梧州","鸡西","七台河","白城","朝阳","安庆","朔州","平凉","河池","通化","景德镇","阜新","葫芦岛","衡水","石嘴山","日照","滨州","宣城","宿州","南平","内江","达州","贺州","巴中","昭通","怀化","鄂州","伊春","毕节","十堰","遂宁","郴州","辽阳","宝鸡","张掖","随州","承德","鹰潭","孝感","枣庄","濮阳","嘉峪关","漳州","庆阳","汕尾","上饶","普洱","宜春","德阳","广安","雅安","永州","荆州","商丘","长治","吕梁","抚州","通辽","晋城","和田","巴音郭楞","克孜勒苏","伊犁","红河","昌都","日喀则","山南","那曲","阿里","林芝","兴安盟","锡林郭勒盟","阿拉善盟","临夏","甘南","黔东南","黔南","恩施","湘西","果洛州","阿坝州","文山州","德宏州","怒江州","迪庆州","石河子","仙桃","阿拉尔","琼海","五家渠","潜江","乐东","陵水","保亭","儋州","天门","屯昌","神农架","澄迈","临高","文昌","白沙","定安","北屯"));
|
||||||
|
|
||||||
|
cityZiMuKeys.put("a", Arrays.asList("鞍山","安顺","阿克苏","阿勒泰","安阳","安康","安庆","阿里","阿拉善盟","阿坝州","阿拉尔"));
|
||||||
|
cityZiMuKeys.put("b", Arrays.asList("北京","北海","本溪","包头","百色","亳州","巴彦淖尔","白银","保山","蚌埠","博尔塔拉","保定","白山","白城","滨州","巴中","毕节","宝鸡","巴音郭楞","保亭","白沙","北屯"));
|
||||||
|
cityZiMuKeys.put("c", Arrays.asList("成都","重庆","长春","潮州","常德","沧州","崇左","池州","滁州","昌吉","楚雄","昌江","长沙","常州","赤峰","朝阳","郴州","承德","长治","昌都","澄迈"));
|
||||||
|
cityZiMuKeys.put("d", Arrays.asList("大连","东莞","大理","定西","东营","德州","大同","大兴安岭","东方","大庆","丹东","达州","德阳","德宏州","迪庆州","儋州","定安"));
|
||||||
|
cityZiMuKeys.put("e", Arrays.asList("鄂尔多斯","鄂州","恩施"));
|
||||||
|
cityZiMuKeys.put("f", Arrays.asList("福州","防城港","抚顺","佛山","阜阳","阜新","抚州"));
|
||||||
|
cityZiMuKeys.put("g", Arrays.asList("广州","贵阳","桂林","赣州","固原","贵港","甘孜州","广元","广安","甘南","果洛州"));
|
||||||
|
cityZiMuKeys.put("h", Arrays.asList("合肥","呼和浩特","哈尔滨","河源","黄石","黄山","呼伦贝尔","鹤岗","海东","黑河","淮北","鹤壁","哈密","海北州","黄南州","海南州","海西州","杭州","海口","惠州","邯郸","湖州","衡阳","黄冈","淮南","淮安","菏泽","汉中","河池","葫芦岛","衡水","贺州","怀化","和田","红河"));
|
||||||
|
cityZiMuKeys.put("j", Arrays.asList("吉林","金华","江门","九江","焦作","揭阳","佳木斯","荆门","吉安","济宁","晋中","酒泉","金昌","济源","济南","嘉兴","锦州","鸡西","景德镇","嘉峪关","荆州","晋城"));
|
||||||
|
cityZiMuKeys.put("k", Arrays.asList("克拉玛依","开封","喀什","可克达拉","昆明","克孜勒苏"));
|
||||||
|
cityZiMuKeys.put("l", Arrays.asList("洛阳","柳州","丽江","临沂","临汾","六安","临沧","拉萨","泸州","来宾","聊城","龙岩","漯河","莱芜","娄底","陇南","凉山州","廊坊","兰州","连云港","六盘水","辽源","丽水","乐山","辽阳","吕梁","林芝","临夏","乐东","陵水","临高"));
|
||||||
|
cityZiMuKeys.put("m", Arrays.asList("绵阳","马鞍山","茂名","牡丹江","梅州","眉山"));
|
||||||
|
cityZiMuKeys.put("n", Arrays.asList("宁波","南宁","南阳","宁德","南充","南京","南昌","南通","南平","内江","那曲","怒江州"));
|
||||||
|
cityZiMuKeys.put("p", Arrays.asList("攀枝花","盘锦","平顶山","萍乡","莆田","平凉","濮阳","普洱"));
|
||||||
|
cityZiMuKeys.put("q", Arrays.asList("清远","秦皇岛","钦州","黔西南","琼中","青岛","衢州","泉州","曲靖","齐齐哈尔","七台河","庆阳","黔东南","黔南","琼海","潜江"));
|
||||||
|
cityZiMuKeys.put("r", Arrays.asList("日照","日喀则"));
|
||||||
|
cityZiMuKeys.put("s", Arrays.asList("深圳","石家庄","三亚","韶关","三沙","邵阳","双鸭山","三明","松原","三门峡","商洛","双河","上海","沈阳","苏州","绍兴","宿迁","汕头","四平","绥化","朔州","石嘴山","宿州","十堰","遂宁","随州","汕尾","上饶","商丘","山南","石河子","神农架"));
|
||||||
|
cityZiMuKeys.put("t", Arrays.asList("太原","唐山","台州","铜川","铜仁","铜陵","吐鲁番","塔城","图木舒克","铁门关","天津","泰州","铁岭","天水","泰安","通化","通辽","天门","屯昌"));
|
||||||
|
cityZiMuKeys.put("w", Arrays.asList("全国","武汉","无锡","芜湖","潍坊","乌海","乌兰察布","渭南","吴忠","五指山","万宁","温州","威海","武威","梧州","文山州","五家渠","文昌"));
|
||||||
|
cityZiMuKeys.put("x", Arrays.asList("西安","厦门","徐州","西宁","襄阳","湘潭","乌鲁木齐","信阳","邢台","忻州","新余","咸宁","西双版纳州","咸阳","新乡","许昌","宣城","孝感","兴安盟","锡林郭勒盟","湘西","仙桃"));
|
||||||
|
cityZiMuKeys.put("y", Arrays.asList("扬州","银川","烟台","宜宾","盐城","延安","营口","云浮","益阳","阳泉","运城","延边","玉树州","宜昌","玉林","阳江","玉溪","岳阳","榆林","伊春","鹰潭","宜春","雅安","永州","伊犁"));
|
||||||
|
cityZiMuKeys.put("z", Arrays.asList("珠海","镇江","株洲","自贡","肇庆","舟山","资阳","驻马店","张家口","周口","郑州","中山","湛江","淄博","张家界","遵义","中卫","昭通","张掖","枣庄","漳州"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.fangjia.job.common.core;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.Module;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.RuntimeJsonMappingException;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Collections;
|
||||||
|
import feign.Response;
|
||||||
|
import feign.Util;
|
||||||
|
import feign.codec.Decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feign调用Rest API解码用
|
||||||
|
* @author yinjihuan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class JacksonDecoder implements Decoder {
|
||||||
|
|
||||||
|
private final ObjectMapper mapper;
|
||||||
|
|
||||||
|
public JacksonDecoder() {
|
||||||
|
this(Collections.<Module> emptyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public JacksonDecoder(Iterable<Module> modules) {
|
||||||
|
this(new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
|
.registerModules(modules));
|
||||||
|
}
|
||||||
|
|
||||||
|
public JacksonDecoder(ObjectMapper mapper) {
|
||||||
|
this.mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object decode(Response response, Type type) throws IOException {
|
||||||
|
if (response.status() == 404)
|
||||||
|
return Util.emptyValueOf(type);
|
||||||
|
if (response.body() == null)
|
||||||
|
return null;
|
||||||
|
Reader reader = response.body().asReader();
|
||||||
|
if (!reader.markSupported()) {
|
||||||
|
reader = new BufferedReader(reader, 1);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// Read the first byte to see if we have any data
|
||||||
|
reader.mark(1);
|
||||||
|
if (reader.read() == -1) {
|
||||||
|
return null; // Eagerly returning null avoids "No content to map
|
||||||
|
// due to end-of-input"
|
||||||
|
}
|
||||||
|
reader.reset();
|
||||||
|
return mapper.readValue(reader, mapper.constructType(type));
|
||||||
|
} catch (RuntimeJsonMappingException e) {
|
||||||
|
if (e.getCause() != null && e.getCause() instanceof IOException) {
|
||||||
|
throw IOException.class.cast(e.getCause());
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.fangjia.job.common.core;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.JavaType;
|
||||||
|
import com.fasterxml.jackson.databind.Module;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Collections;
|
||||||
|
import feign.RequestTemplate;
|
||||||
|
import feign.codec.EncodeException;
|
||||||
|
import feign.codec.Encoder;
|
||||||
|
/**
|
||||||
|
* Feign调用Rest API编码用
|
||||||
|
* @author yinjihuan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class JacksonEncoder implements Encoder {
|
||||||
|
|
||||||
|
private final ObjectMapper mapper;
|
||||||
|
|
||||||
|
public JacksonEncoder() {
|
||||||
|
this(Collections.<Module> emptyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public JacksonEncoder(Iterable<Module> modules) {
|
||||||
|
this(new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||||
|
.configure(SerializationFeature.INDENT_OUTPUT, true).registerModules(modules));
|
||||||
|
}
|
||||||
|
|
||||||
|
public JacksonEncoder(ObjectMapper mapper) {
|
||||||
|
this.mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void encode(Object object, Type bodyType, RequestTemplate template) {
|
||||||
|
try {
|
||||||
|
JavaType javaType = mapper.getTypeFactory().constructType(bodyType);
|
||||||
|
template.body(mapper.writerFor(javaType).writeValueAsString(object));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new EncodeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
package com.fangjia.job.common.util;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
public class DateUtilCustom {
|
||||||
|
/**
|
||||||
|
* 获取昨天的时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, String> getYesterday() {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
DateTime dt = new DateTime();
|
||||||
|
// 昨天
|
||||||
|
DateTime yesterday = dt.minusDays(1);
|
||||||
|
String start = yesterday.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
String end = dt.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
map.put("start", start);
|
||||||
|
map.put("end", end);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本月时间范围,截止到当前时间那天
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, String> getCurrentMonth() {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
DateTime dt = new DateTime();
|
||||||
|
// 获取当前时间月的第一天
|
||||||
|
LocalDate firstDayOfMonth = dt.toLocalDate().withDayOfMonth(1);
|
||||||
|
String start = firstDayOfMonth.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
String end = dt.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
map.put("start", start);
|
||||||
|
map.put("end", end);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上月时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, String> getTopMonth() {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
DateTime dt = new DateTime();
|
||||||
|
LocalDate d = LocalDate.now();
|
||||||
|
LocalDate lastDayOfPreviousMonth = d.minusMonths(1).dayOfMonth().withMinimumValue();
|
||||||
|
String start = lastDayOfPreviousMonth.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
// 获取当前时间月的第一天
|
||||||
|
LocalDate firstDayOfMonth = dt.toLocalDate().withDayOfMonth(1);
|
||||||
|
String end = firstDayOfMonth.toString("yyyy-MM-dd") + " 00:00:00";
|
||||||
|
map.put("start", start);
|
||||||
|
map.put("end", end);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
getTopMonth();
|
||||||
|
}
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
package com.fangjia.job.common.util;
|
||||||
|
|
||||||
|
import feign.Headers;
|
||||||
|
import feign.Param;
|
||||||
|
import feign.RequestLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钉钉机器人发送消息
|
||||||
|
* https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.karFPe&treeId=257&articleId=105735&docType=1
|
||||||
|
* @author yinjihuan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DingDingMessageUtil {
|
||||||
|
public static String access_token = "899b3d41c3b235684339e6b6d40333f3f522e513df923e9a5771a704287cef16";
|
||||||
|
|
||||||
|
public static void sendTextMessage(String access_token, String msg) {
|
||||||
|
try {
|
||||||
|
Message message = new Message();
|
||||||
|
message.setMsgtype("text");
|
||||||
|
message.setText(new MessageInfo(msg));
|
||||||
|
DingDingRemoteApi client = RestApiCallUtils.getRestClient(DingDingRemoteApi.class, "https://oapi.dingtalk.com");
|
||||||
|
client.send(access_token, message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendTextMessage(String msg) {
|
||||||
|
try {
|
||||||
|
Message message = new Message();
|
||||||
|
message.setMsgtype("text");
|
||||||
|
message.setText(new MessageInfo(msg));
|
||||||
|
DingDingRemoteApi client = RestApiCallUtils.getRestClient(DingDingRemoteApi.class, "https://oapi.dingtalk.com");
|
||||||
|
client.send(access_token, message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Message {
|
||||||
|
private String msgtype;
|
||||||
|
private MessageInfo text;
|
||||||
|
public String getMsgtype() {
|
||||||
|
return msgtype;
|
||||||
|
}
|
||||||
|
public void setMsgtype(String msgtype) {
|
||||||
|
this.msgtype = msgtype;
|
||||||
|
}
|
||||||
|
public MessageInfo getText() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
public void setText(MessageInfo text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MessageInfo {
|
||||||
|
private String content;
|
||||||
|
public MessageInfo(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DingDingRemoteApi {
|
||||||
|
|
||||||
|
@RequestLine("POST /robot/send?access_token={access_token}")
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
public void send(@Param("access_token") String access_token, Message message);
|
||||||
|
|
||||||
|
}
|
||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
package com.fangjia.job.common.util;
|
||||||
|
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
/**
|
||||||
|
* Json 工具类
|
||||||
|
* @author yinjihuan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class JsonUtils {
|
||||||
|
private static ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
|
public static String toString(Object obj){
|
||||||
|
return toJson(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toJson(Object obj){
|
||||||
|
try{
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
mapper.writeValue(writer, obj);
|
||||||
|
return writer.toString();
|
||||||
|
}catch(Exception e){
|
||||||
|
throw new RuntimeException("序列化对象【"+obj+"】时出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T toBean(Class<T> entityClass, String jsonString){
|
||||||
|
try {
|
||||||
|
return mapper.readValue(jsonString, entityClass);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("JSON【"+jsonString+"】转对象时出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于对象通过其他工具已转为JSON的字符形式,这里不需要再加上引号
|
||||||
|
* @param obj
|
||||||
|
* @param isObject
|
||||||
|
*/
|
||||||
|
public static String getJsonSuccess(Object obj){
|
||||||
|
String jsonString = null;
|
||||||
|
if(obj == null){
|
||||||
|
jsonString = "{\"success\":true}";
|
||||||
|
}else{
|
||||||
|
jsonString = "{\"success\":true,\"data\":"+toJson(obj)+"}";
|
||||||
|
}
|
||||||
|
return jsonString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public static String getJsonSuccess(Object obj){
|
||||||
|
return getJsonSuccess(obj, null);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public static String getJsonSuccess(Object obj, String message) {
|
||||||
|
if(obj == null){
|
||||||
|
return "{\"success\":true,\"message\":\""+message+"\"}";
|
||||||
|
}else{
|
||||||
|
try{
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("success", true);
|
||||||
|
return "{\"success\":true,"+toString(obj)+",\"message\":\""+message+"\"}";
|
||||||
|
}catch(Exception e){
|
||||||
|
throw new RuntimeException("序列化对象【"+obj+"】时出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getJsonError(Object obj){
|
||||||
|
return getJsonError(obj, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getJsonError(Object obj, String message) {
|
||||||
|
if(obj == null){
|
||||||
|
return "{\"success\":false,\"message\":\""+message+"\"}";
|
||||||
|
}else{
|
||||||
|
try{
|
||||||
|
obj = parseIfException(obj);
|
||||||
|
return "{\"success\":false,\"data\":"+toString(obj)+",\"message\":\""+message+"\"}";
|
||||||
|
}catch(Exception e){
|
||||||
|
throw new RuntimeException("序列化对象【"+obj+"】时出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Object parseIfException(Object obj){
|
||||||
|
if(obj instanceof Exception){
|
||||||
|
return getErrorMessage((Exception) obj, null);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getErrorMessage(Exception e, String defaultMessage){
|
||||||
|
return defaultMessage != null ? defaultMessage : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObjectMapper getMapper() {
|
||||||
|
return mapper;
|
||||||
|
}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package com.fangjia.job.common.util;
|
||||||
|
|
||||||
|
import com.fangjia.job.common.core.JacksonDecoder;
|
||||||
|
import com.fangjia.job.common.core.JacksonEncoder;
|
||||||
|
|
||||||
|
import feign.Feign;
|
||||||
|
import feign.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rest API 调用工具类<br>
|
||||||
|
* 文档:https://github.com/OpenFeign/feign
|
||||||
|
*
|
||||||
|
* @author yinjihuan
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class RestApiCallUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取API 接口代理对象
|
||||||
|
* @param apiType 接口类
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T getRestClient(Class<T> apiType, String url) {
|
||||||
|
return Feign.builder().encoder(new JacksonEncoder()).decoder(new JacksonDecoder())
|
||||||
|
.logger(new Logger.JavaLogger().appendToFile("D:\\logs\\fangjia-job-http.log"))
|
||||||
|
.logLevel(Logger.Level.FULL)
|
||||||
|
.target(apiType, url);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package org.fangjia.job.common;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit test for simple App.
|
||||||
|
*/
|
||||||
|
public class AppTest
|
||||||
|
extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create the test case
|
||||||
|
*
|
||||||
|
* @param testName name of the test case
|
||||||
|
*/
|
||||||
|
public AppTest( String testName )
|
||||||
|
{
|
||||||
|
super( testName );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the suite of tests being tested
|
||||||
|
*/
|
||||||
|
public static Test suite()
|
||||||
|
{
|
||||||
|
return new TestSuite( AppTest.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rigourous Test :-)
|
||||||
|
*/
|
||||||
|
public void testApp()
|
||||||
|
{
|
||||||
|
assertTrue( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.fangjia</groupId>
|
||||||
|
<artifactId>fangjia-job</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>fangjia-job-fsh</artifactId>
|
||||||
|
<name>fangjia-job-fsh</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fangjia</groupId>
|
||||||
|
<artifactId>fangjia-job-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dangdang</groupId>
|
||||||
|
<artifactId>elastic-job-lite-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dangdang</groupId>
|
||||||
|
<artifactId>elastic-job-lite-spring</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbcp</groupId>
|
||||||
|
<artifactId>commons-dbcp</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cxytiandi</groupId>
|
||||||
|
<artifactId>cxytiandi-jdbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.fangjia.job.fsh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房生活定时作业启动入口
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.context.annotation.ImportResource;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@ImportResource(locations = { "classpath:applicationContext*.xml" })
|
||||||
|
public class FshJobApp {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new SpringApplicationBuilder().sources(FshJobApp.class).web(false).run(args);
|
||||||
|
try {
|
||||||
|
new CountDownLatch(1).await();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
package com.fangjia.job.fsh.config;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.data.mongodb.MongoDbFactory;
|
||||||
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
|
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
|
||||||
|
import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper;
|
||||||
|
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
|
||||||
|
import com.mongodb.MongoClient;
|
||||||
|
import com.mongodb.MongoClientOptions;
|
||||||
|
import com.mongodb.ServerAddress;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class SpringMongoConfig {
|
||||||
|
|
||||||
|
public @Bean MongoDbFactory mongoDbFactory() throws Exception {
|
||||||
|
List<ServerAddress> seeds = Arrays.asList(new ServerAddress("mongo.db.fangjia.com", 27017));
|
||||||
|
MongoClientOptions.Builder builder = new MongoClientOptions.Builder();
|
||||||
|
int connPerHost = 20;
|
||||||
|
builder.connectionsPerHost(connPerHost);
|
||||||
|
int threadCount = 20;
|
||||||
|
builder.threadsAllowedToBlockForConnectionMultiplier(threadCount);
|
||||||
|
int maxWaitTime = 1000;
|
||||||
|
builder.maxWaitTime(maxWaitTime);
|
||||||
|
int timeOut = 1000;
|
||||||
|
builder.connectTimeout(timeOut);
|
||||||
|
MongoClientOptions options = builder.build();
|
||||||
|
MongoClient mongoClient = new MongoClient(seeds, options);
|
||||||
|
return new SimpleMongoDbFactory(mongoClient, "fangjia_fsh");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public @Bean MongoTemplate mongoTemplate() throws Exception {
|
||||||
|
//remove _class
|
||||||
|
MappingMongoConverter converter = new MappingMongoConverter(mongoDbFactory(), new MongoMappingContext());
|
||||||
|
converter.setTypeMapper(new DefaultMongoTypeMapper(null));
|
||||||
|
MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory(), converter);
|
||||||
|
return mongoTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+405
@@ -0,0 +1,405 @@
|
|||||||
|
package com.fangjia.job.fsh.document;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.springframework.data.annotation.Id;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业相关数据统计
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
@Document(collection="enterprise_stat")
|
||||||
|
public class EnterpriseStat {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业编号
|
||||||
|
*/
|
||||||
|
@Field(value="eid")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昨日新增数量
|
||||||
|
*/
|
||||||
|
@Field(value="td_add_u_count")
|
||||||
|
private Long terdayAddUserCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总用户数
|
||||||
|
*/
|
||||||
|
@Field(value="total_u_count")
|
||||||
|
private Long totalUserCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日登录数
|
||||||
|
*/
|
||||||
|
@Field(value="td_login_count")
|
||||||
|
private Long terdayLoginCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总登录数
|
||||||
|
*/
|
||||||
|
@Field(value="total_login_count")
|
||||||
|
private Long totalLoginCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日新增贷款评估数量
|
||||||
|
*/
|
||||||
|
@Field(value="td_le_count")
|
||||||
|
private Long terdayLoanEvalCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总贷款评估数量
|
||||||
|
*/
|
||||||
|
@Field(value="total_le_count")
|
||||||
|
private Long totalLoanEvalCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日新增意向申请数量
|
||||||
|
*/
|
||||||
|
@Field(value="td_it_count")
|
||||||
|
private Long terdayIntentionCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月新增意向申请数量
|
||||||
|
*/
|
||||||
|
@Field(value="mt_it_count")
|
||||||
|
private Long monthIntentionCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日意向申请金额(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="td_it_money")
|
||||||
|
private Double terdayIntentionMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月意向申请金额(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="mt_it_money")
|
||||||
|
private Double monthIntentionMoney;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月pv
|
||||||
|
*/
|
||||||
|
@Field(value="mt_pv_count")
|
||||||
|
private Long monthPvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上月pv
|
||||||
|
*/
|
||||||
|
@Field(value="tmt_pv_count")
|
||||||
|
private Long topMonthPvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月uv
|
||||||
|
*/
|
||||||
|
@Field(value="mt_uv_count")
|
||||||
|
private Long monthUvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上月uv
|
||||||
|
*/
|
||||||
|
@Field(value="tmt_uv_count")
|
||||||
|
private Long topMonthUvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月广告pv
|
||||||
|
*/
|
||||||
|
@Field(value="mt_ad_pv_count")
|
||||||
|
private Long monthAdPvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上月广告pv
|
||||||
|
*/
|
||||||
|
@Field(value="tmt_ad_pv_count")
|
||||||
|
private Long topMonthAdPvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月广告uv
|
||||||
|
*/
|
||||||
|
@Field(value="mt_ad_uv_count")
|
||||||
|
private Long monthAdUvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上月广告uv
|
||||||
|
*/
|
||||||
|
@Field(value="tmt_ad_uv_count")
|
||||||
|
private Long topMonthAdUvCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日新增房产数量
|
||||||
|
*/
|
||||||
|
@Field(value="td_add_house_count")
|
||||||
|
private Long terdayAddHouseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日新增房产估值(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="td_add_house_price")
|
||||||
|
private Double terdayAddHousePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产总数
|
||||||
|
*/
|
||||||
|
@Field(value="hosue_count")
|
||||||
|
private Long houseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产总估值(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="house_total_price")
|
||||||
|
private Double houseTotalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人均房产数量
|
||||||
|
*/
|
||||||
|
@Field(value="avg_house_count")
|
||||||
|
private Double avgHouseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人均身价(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="avg_worth")
|
||||||
|
private Double avgWorth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房屋状态
|
||||||
|
*/
|
||||||
|
@Field(value="house_status")
|
||||||
|
private HouseStatus houseStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Field(value="m_date")
|
||||||
|
private Date modifyDate;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTerdayAddUserCount() {
|
||||||
|
return terdayAddUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayAddUserCount(Long terdayAddUserCount) {
|
||||||
|
this.terdayAddUserCount = terdayAddUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotalUserCount() {
|
||||||
|
return totalUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalUserCount(Long totalUserCount) {
|
||||||
|
this.totalUserCount = totalUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTerdayLoginCount() {
|
||||||
|
return terdayLoginCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayLoginCount(Long terdayLoginCount) {
|
||||||
|
this.terdayLoginCount = terdayLoginCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotalLoginCount() {
|
||||||
|
return totalLoginCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalLoginCount(Long totalLoginCount) {
|
||||||
|
this.totalLoginCount = totalLoginCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTerdayLoanEvalCount() {
|
||||||
|
return terdayLoanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayLoanEvalCount(Long terdayLoanEvalCount) {
|
||||||
|
this.terdayLoanEvalCount = terdayLoanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotalLoanEvalCount() {
|
||||||
|
return totalLoanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalLoanEvalCount(Long totalLoanEvalCount) {
|
||||||
|
this.totalLoanEvalCount = totalLoanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTerdayIntentionCount() {
|
||||||
|
return terdayIntentionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayIntentionCount(Long terdayIntentionCount) {
|
||||||
|
this.terdayIntentionCount = terdayIntentionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonthIntentionCount() {
|
||||||
|
return monthIntentionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthIntentionCount(Long monthIntentionCount) {
|
||||||
|
this.monthIntentionCount = monthIntentionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTerdayIntentionMoney() {
|
||||||
|
return terdayIntentionMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayIntentionMoney(Double terdayIntentionMoney) {
|
||||||
|
this.terdayIntentionMoney = terdayIntentionMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getMonthIntentionMoney() {
|
||||||
|
return monthIntentionMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthIntentionMoney(Double monthIntentionMoney) {
|
||||||
|
this.monthIntentionMoney = monthIntentionMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonthPvCount() {
|
||||||
|
return monthPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthPvCount(Long monthPvCount) {
|
||||||
|
this.monthPvCount = monthPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTopMonthPvCount() {
|
||||||
|
return topMonthPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTopMonthPvCount(Long topMonthPvCount) {
|
||||||
|
this.topMonthPvCount = topMonthPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonthUvCount() {
|
||||||
|
return monthUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthUvCount(Long monthUvCount) {
|
||||||
|
this.monthUvCount = monthUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTopMonthUvCount() {
|
||||||
|
return topMonthUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTopMonthUvCount(Long topMonthUvCount) {
|
||||||
|
this.topMonthUvCount = topMonthUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonthAdPvCount() {
|
||||||
|
return monthAdPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthAdPvCount(Long monthAdPvCount) {
|
||||||
|
this.monthAdPvCount = monthAdPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTopMonthAdPvCount() {
|
||||||
|
return topMonthAdPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTopMonthAdPvCount(Long topMonthAdPvCount) {
|
||||||
|
this.topMonthAdPvCount = topMonthAdPvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMonthAdUvCount() {
|
||||||
|
return monthAdUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonthAdUvCount(Long monthAdUvCount) {
|
||||||
|
this.monthAdUvCount = monthAdUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTopMonthAdUvCount() {
|
||||||
|
return topMonthAdUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTopMonthAdUvCount(Long topMonthAdUvCount) {
|
||||||
|
this.topMonthAdUvCount = topMonthAdUvCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTerdayAddHouseCount() {
|
||||||
|
return terdayAddHouseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayAddHouseCount(Long terdayAddHouseCount) {
|
||||||
|
this.terdayAddHouseCount = terdayAddHouseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getTerdayAddHousePrice() {
|
||||||
|
return terdayAddHousePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerdayAddHousePrice(Double terdayAddHousePrice) {
|
||||||
|
this.terdayAddHousePrice = terdayAddHousePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getHouseCount() {
|
||||||
|
return houseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseCount(Long houseCount) {
|
||||||
|
this.houseCount = houseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getHouseTotalPrice() {
|
||||||
|
return houseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseTotalPrice(Double houseTotalPrice) {
|
||||||
|
this.houseTotalPrice = houseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getAvgHouseCount() {
|
||||||
|
return avgHouseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvgHouseCount(Double avgHouseCount) {
|
||||||
|
this.avgHouseCount = avgHouseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getAvgWorth() {
|
||||||
|
return avgWorth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvgWorth(Double avgWorth) {
|
||||||
|
this.avgWorth = avgWorth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HouseStatus getHouseStatus() {
|
||||||
|
return houseStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseStatus(HouseStatus houseStatus) {
|
||||||
|
this.houseStatus = houseStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getModifyDate() {
|
||||||
|
return modifyDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyDate(Date modifyDate) {
|
||||||
|
this.modifyDate = modifyDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
package com.fangjia.job.fsh.document;
|
||||||
|
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产状态统计,内嵌到企业统计中
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class HouseStatus {
|
||||||
|
/**
|
||||||
|
* 自住
|
||||||
|
*/
|
||||||
|
@Field(value="zz")
|
||||||
|
private Long ziZhu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空置
|
||||||
|
*/
|
||||||
|
@Field(value="kz")
|
||||||
|
private Long kongZhi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出租
|
||||||
|
*/
|
||||||
|
@Field(value="cz")
|
||||||
|
private Long chuZu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我是租客
|
||||||
|
*/
|
||||||
|
@Field(value="wszk")
|
||||||
|
private Long zuKe;
|
||||||
|
|
||||||
|
public Long getZiZhu() {
|
||||||
|
return ziZhu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZiZhu(Long ziZhu) {
|
||||||
|
this.ziZhu = ziZhu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getKongZhi() {
|
||||||
|
return kongZhi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKongZhi(Long kongZhi) {
|
||||||
|
this.kongZhi = kongZhi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getChuZu() {
|
||||||
|
return chuZu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChuZu(Long chuZu) {
|
||||||
|
this.chuZu = chuZu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getZuKe() {
|
||||||
|
return zuKe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZuKe(Long zuKe) {
|
||||||
|
this.zuKe = zuKe;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
package com.fangjia.job.fsh.document;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import org.springframework.data.annotation.Id;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户相关数据统计
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
@Document(collection="user_stat")
|
||||||
|
public class UserStat {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业ID
|
||||||
|
*/
|
||||||
|
@Field(value="eid")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@Field(value="uid")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户添加时间
|
||||||
|
*/
|
||||||
|
@Field(value="u_at")
|
||||||
|
private Date userAddTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 城市
|
||||||
|
*/
|
||||||
|
@Field(value="city")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
@Field(value="region")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产总数量
|
||||||
|
*/
|
||||||
|
@Field(value="h_count")
|
||||||
|
private Long houseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产总价格(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="h_price")
|
||||||
|
private Double housePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置换总次数
|
||||||
|
*/
|
||||||
|
@Field(value="s_count")
|
||||||
|
private Long substitutionCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置换最高价格(买房预算)(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="s_mprice")
|
||||||
|
private Double substitutionMaxPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 贷款评估总次数
|
||||||
|
*/
|
||||||
|
@Field(value="le_count")
|
||||||
|
private Long loanEvalCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 贷款评估最高价格(万元)
|
||||||
|
*/
|
||||||
|
@Field(value="le_mprice")
|
||||||
|
private Double loanEvalMaxPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 贷款申请次数
|
||||||
|
*/
|
||||||
|
@Field(value="la_count")
|
||||||
|
private Long loanCount;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUserAddTime() {
|
||||||
|
return userAddTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserAddTime(Date userAddTime) {
|
||||||
|
this.userAddTime = userAddTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getHouseCount() {
|
||||||
|
return houseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseCount(Long houseCount) {
|
||||||
|
this.houseCount = houseCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getHousePrice() {
|
||||||
|
return housePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHousePrice(Double housePrice) {
|
||||||
|
this.housePrice = housePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getSubstitutionCount() {
|
||||||
|
return substitutionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubstitutionCount(Long substitutionCount) {
|
||||||
|
this.substitutionCount = substitutionCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getSubstitutionMaxPrice() {
|
||||||
|
return substitutionMaxPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubstitutionMaxPrice(Double substitutionMaxPrice) {
|
||||||
|
this.substitutionMaxPrice = substitutionMaxPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanEvalCount() {
|
||||||
|
return loanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanEvalCount(Long loanEvalCount) {
|
||||||
|
this.loanEvalCount = loanEvalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLoanEvalMaxPrice() {
|
||||||
|
return loanEvalMaxPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanEvalMaxPrice(Double loanEvalMaxPrice) {
|
||||||
|
this.loanEvalMaxPrice = loanEvalMaxPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanCount() {
|
||||||
|
return loanCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanCount(Long loanCount) {
|
||||||
|
this.loanCount = loanCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+140
@@ -0,0 +1,140 @@
|
|||||||
|
package com.fangjia.job.fsh.job;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.util.PageBean;
|
||||||
|
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||||
|
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||||
|
import com.fangjia.job.common.util.DateUtilCustom;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.fsh.document.EnterpriseStat;
|
||||||
|
import com.fangjia.job.fsh.document.HouseStatus;
|
||||||
|
import com.fangjia.job.fsh.po.Enterprise;
|
||||||
|
import com.fangjia.job.fsh.service.AdVisitLogService;
|
||||||
|
import com.fangjia.job.fsh.service.EnterpriseProductUserService;
|
||||||
|
import com.fangjia.job.fsh.service.EnterpriseService;
|
||||||
|
import com.fangjia.job.fsh.service.EnterpriseStatService;
|
||||||
|
import com.fangjia.job.fsh.service.HouseInfoService;
|
||||||
|
import com.fangjia.job.fsh.service.LoanApplyService;
|
||||||
|
import com.fangjia.job.fsh.service.VisitLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业统计任务,每天0点1分开始执行<br>
|
||||||
|
* 主要统计企业相关的数据,统计内容参考 EnterpriseStat
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class EnterpriseStatJob implements SimpleJob {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(EnterpriseStatJob.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EnterpriseService enterpriseService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EnterpriseStatService enterpriseStatService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EnterpriseProductUserService enterpriseProductUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VisitLogService visitLogService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LoanApplyService loanApplyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AdVisitLogService adVisitLogService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HouseInfoService houseInfoService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(ShardingContext shardingContext) {
|
||||||
|
logger.info("开始执行EnterpriseStatJob");
|
||||||
|
long total = enterpriseService.queryCount();
|
||||||
|
int pages = PageBean.calcPages(total, 1000);
|
||||||
|
for (int i = 1; i <= pages; i++) {
|
||||||
|
List<Enterprise> ens = enterpriseService.queryByPage(i, 1000);
|
||||||
|
for (Enterprise enterprise : ens) {
|
||||||
|
try {
|
||||||
|
processStat(enterprise);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("企业统计任务异常", e);
|
||||||
|
DingDingMessageUtil.sendTextMessage("企业统计任务异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("EnterpriseStatJob执行结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processStat(Enterprise enterprise) {
|
||||||
|
Map<String, String> dateMap = DateUtilCustom.getYesterday();
|
||||||
|
String start = dateMap.get("start");
|
||||||
|
String end = dateMap.get("end");
|
||||||
|
|
||||||
|
Map<String, String> monthMap = DateUtilCustom.getCurrentMonth();
|
||||||
|
String startMonth = monthMap.get("start");
|
||||||
|
String endMonth = monthMap.get("end");
|
||||||
|
|
||||||
|
Map<String, String> topMonthMap = DateUtilCustom.getTopMonth();
|
||||||
|
String topStartMonth = topMonthMap.get("start");
|
||||||
|
String topEndMonth = topMonthMap.get("end");
|
||||||
|
|
||||||
|
Long eid = enterprise.getId();
|
||||||
|
EnterpriseStat stat = enterpriseStatService.getByEid(eid);
|
||||||
|
if (stat == null) {
|
||||||
|
stat = new EnterpriseStat();
|
||||||
|
stat.setEid(eid);
|
||||||
|
}
|
||||||
|
|
||||||
|
stat.setModifyDate(new Date());
|
||||||
|
stat.setTerdayAddUserCount(enterpriseProductUserService.queryAddUserCount(eid, start, end));
|
||||||
|
stat.setTotalUserCount(enterpriseProductUserService.queryUserCount(eid));
|
||||||
|
stat.setTerdayLoginCount(visitLogService.queryPvCount(eid, "/index", start, end));
|
||||||
|
stat.setTotalLoginCount(visitLogService.queryPvCount(eid, "/index"));
|
||||||
|
stat.setTerdayLoanEvalCount(loanApplyService.queryCountByType(eid, 2, start, end));
|
||||||
|
stat.setTotalLoanEvalCount(loanApplyService.queryCountByType(eid, 2));
|
||||||
|
stat.setTerdayIntentionCount(loanApplyService.queryCountByType(eid, 1, start, end));
|
||||||
|
stat.setMonthIntentionCount(loanApplyService.queryCountByType(eid, 1, startMonth, endMonth));
|
||||||
|
stat.setTerdayIntentionMoney(loanApplyService.queryLoanMoney(eid, start, end));
|
||||||
|
stat.setMonthIntentionMoney(loanApplyService.queryLoanMoney(eid, startMonth, endMonth));
|
||||||
|
stat.setMonthPvCount(visitLogService.queryPvCount(eid, startMonth, endMonth));
|
||||||
|
stat.setTopMonthPvCount(visitLogService.queryPvCount(eid, topStartMonth, topEndMonth));
|
||||||
|
stat.setMonthUvCount(visitLogService.queryUvCount(eid, startMonth, endMonth));
|
||||||
|
stat.setTopMonthUvCount(visitLogService.queryUvCount(eid, topStartMonth, topEndMonth));
|
||||||
|
stat.setMonthAdPvCount(adVisitLogService.queryPvCount(eid, startMonth, endMonth));
|
||||||
|
stat.setTopMonthAdPvCount(adVisitLogService.queryPvCount(eid, topStartMonth, topEndMonth));
|
||||||
|
stat.setMonthAdUvCount(adVisitLogService.queryUvCount(eid, startMonth, endMonth));
|
||||||
|
stat.setTopMonthAdUvCount(adVisitLogService.queryUvCount(eid, topStartMonth, topEndMonth));
|
||||||
|
stat.setTerdayAddHouseCount(houseInfoService.queryHouseCount(eid, start, end));
|
||||||
|
stat.setTerdayAddHousePrice(houseInfoService.queryHouseSumMoney(eid, start, end));
|
||||||
|
stat.setHouseCount(houseInfoService.queryHouseAllCount(eid));
|
||||||
|
stat.setHouseTotalPrice(houseInfoService.queryHouseAllSumMoney(eid));
|
||||||
|
|
||||||
|
if (stat.getTotalUserCount() > 0) {
|
||||||
|
double avgHouseCount = stat.getHouseCount() / stat.getTotalUserCount();
|
||||||
|
stat.setAvgHouseCount(avgHouseCount);
|
||||||
|
double avgWorth = stat.getHouseTotalPrice() / stat.getTotalUserCount();
|
||||||
|
stat.setAvgWorth(avgWorth);
|
||||||
|
} else {
|
||||||
|
stat.setAvgHouseCount(0.0);
|
||||||
|
stat.setAvgWorth(0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 居住状态统计
|
||||||
|
HouseStatus houseStatus = new HouseStatus();
|
||||||
|
houseStatus.setChuZu(houseInfoService.queryCountByLiveStatus(eid, "出租"));
|
||||||
|
houseStatus.setKongZhi(houseInfoService.queryCountByLiveStatus(eid, "空置"));
|
||||||
|
houseStatus.setZiZhu(houseInfoService.queryCountByLiveStatus(eid, "自住"));
|
||||||
|
houseStatus.setZuKe(houseInfoService.queryCountByLiveStatus(eid, "我是租客"));
|
||||||
|
stat.setHouseStatus(houseStatus);
|
||||||
|
enterpriseStatService.save(stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.fangjia.job.fsh.job;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||||
|
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||||
|
import com.fangjia.job.common.base.Response;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.common.util.JsonUtils;
|
||||||
|
import com.fangjia.job.common.util.RestApiCallUtils;
|
||||||
|
import com.fangjia.job.fsh.remote.FshApiRemoteService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产租金提醒任务<br>
|
||||||
|
* 每天触发一次,逻辑在服务端
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class HouseRentNoticeJob implements SimpleJob {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(HouseRentNoticeJob.class);
|
||||||
|
|
||||||
|
@Value("${fsh.url}")
|
||||||
|
private String fshApiUrl;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(ShardingContext shardingContext) {
|
||||||
|
logger.info("开始执行HouseRentNoticeJob");
|
||||||
|
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, fshApiUrl);
|
||||||
|
for (int i = 0; i < 300; i++) {
|
||||||
|
try {
|
||||||
|
Response response = fshApiRemoteService.sendHouseRentNotice("goojia123456");
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产租金提醒任务发送结果:" + JsonUtils.toJson(response));
|
||||||
|
if (response.getStatus()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("房产租金提醒任务异常:", e);
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产租金提醒任务异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000 * 60);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("HouseRentNoticeJob执行结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
package com.fangjia.job.fsh.job;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||||
|
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||||
|
import com.fangjia.job.common.base.Response;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.common.util.JsonUtils;
|
||||||
|
import com.fangjia.job.common.util.RestApiCallUtils;
|
||||||
|
import com.fangjia.job.fsh.remote.FshApiRemoteService;
|
||||||
|
/**
|
||||||
|
* 房产月涨幅通知任务<br>
|
||||||
|
* 每个月1号触发,目前计算逻辑在服务端
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class HouseRoseMonthNoticeJob implements SimpleJob {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(HouseRoseMonthNoticeJob.class);
|
||||||
|
|
||||||
|
@Value("${fsh.url}")
|
||||||
|
private String fshApiUrl;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(ShardingContext shardingContext) {
|
||||||
|
logger.info("开始执行HouseRoseMonthNoticeJob");
|
||||||
|
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, fshApiUrl);
|
||||||
|
for (int i = 0; i < 300; i++) {
|
||||||
|
try {
|
||||||
|
Response response = fshApiRemoteService.sendHouseRoseMonthNotice("goojia123456");
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产月涨幅通知任务发送结果:" + JsonUtils.toJson(response));
|
||||||
|
if (response.getStatus()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("房产月涨幅通知任务异常:", e);
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产月涨幅通知任务异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000 * 60);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("HouseRoseMonthNoticeJob执行结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.fangjia.job.fsh.job;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||||
|
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||||
|
import com.fangjia.job.common.base.Response;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.common.util.JsonUtils;
|
||||||
|
import com.fangjia.job.common.util.RestApiCallUtils;
|
||||||
|
import com.fangjia.job.fsh.remote.FshApiRemoteService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房产每周一定时估价任务<br>
|
||||||
|
* 逻辑在服务端,同时需要算出周涨幅通知
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class HouseWeekEvalJob implements SimpleJob {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(HouseWeekEvalJob.class);
|
||||||
|
|
||||||
|
@Value("${fsh.url}")
|
||||||
|
private String fshApiUrl;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(ShardingContext shardingContext) {
|
||||||
|
logger.info("开始执行HouseWeekEvalJob");
|
||||||
|
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, fshApiUrl);
|
||||||
|
for (int i = 0; i < 300; i++) {
|
||||||
|
try {
|
||||||
|
Response response = fshApiRemoteService.evalAllHousePrice("goojia123456");
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产每周一定时估价任务发送结果:" + JsonUtils.toJson(response));
|
||||||
|
if (response.getStatus()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("房产每周一定时估价任务异常:", e);
|
||||||
|
DingDingMessageUtil.sendTextMessage("房产每周一定时估价任务异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000 * 60);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("HouseWeekEvalJob执行结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.fangjia.job.fsh.job;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.util.PageBean;
|
||||||
|
import com.dangdang.ddframe.job.api.ShardingContext;
|
||||||
|
import com.dangdang.ddframe.job.api.simple.SimpleJob;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.fsh.document.UserStat;
|
||||||
|
import com.fangjia.job.fsh.po.EnterpriseProductUser;
|
||||||
|
import com.fangjia.job.fsh.service.EnterpriseProductUserService;
|
||||||
|
import com.fangjia.job.fsh.service.HouseInfoService;
|
||||||
|
import com.fangjia.job.fsh.service.HouseSubstitutionService;
|
||||||
|
import com.fangjia.job.fsh.service.LoanApplyService;
|
||||||
|
import com.fangjia.job.fsh.service.UserStatService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户维度统计任务<br>统计出用户的房产,置换,贷款等信息
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class UserStatJob implements SimpleJob {
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(UserStatJob.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EnterpriseProductUserService enterpriseProductUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserStatService userStatService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HouseInfoService houseInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HouseSubstitutionService houseSubstitutionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LoanApplyService loanApplyService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(ShardingContext shardingContext) {
|
||||||
|
logger.info("开始执行UserStatJob");
|
||||||
|
long total = enterpriseProductUserService.queryCount();
|
||||||
|
int pages = PageBean.calcPages(total, 1000);
|
||||||
|
for (int i = 1; i <= pages; i++) {
|
||||||
|
List<EnterpriseProductUser> users = enterpriseProductUserService.queryByPage(i, 1000);
|
||||||
|
for (EnterpriseProductUser user : users) {
|
||||||
|
try {
|
||||||
|
processStat(user);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("用户维度统计任务异常", e);
|
||||||
|
DingDingMessageUtil.sendTextMessage("用户维度统计任务异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("UserStatJob执行结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processStat(EnterpriseProductUser user) {
|
||||||
|
UserStat stat = userStatService.getByUid(user.getUid());
|
||||||
|
Long eid = user.getEid();
|
||||||
|
String uid = user.getUid();
|
||||||
|
if (stat == null) {
|
||||||
|
stat = new UserStat();
|
||||||
|
stat.setEid(eid);
|
||||||
|
stat.setUid(uid);
|
||||||
|
stat.setUserAddTime(user.getAddTime());
|
||||||
|
stat.setCity(user.getCity());
|
||||||
|
stat.setRegion(user.getRegion());
|
||||||
|
}
|
||||||
|
stat.setHouseCount(houseInfoService.queryCountByEidAndUid(eid, uid));
|
||||||
|
stat.setHousePrice(houseInfoService.querySumMoneyByEidAndUid(eid, uid));
|
||||||
|
stat.setSubstitutionCount(houseSubstitutionService.queryCount(eid, uid));
|
||||||
|
stat.setSubstitutionMaxPrice(houseSubstitutionService.queryMaxBudget(eid, uid));
|
||||||
|
stat.setLoanEvalCount(loanApplyService.queryUserCountByType(eid, uid, 2));
|
||||||
|
stat.setLoanEvalMaxPrice(loanApplyService.queryMaxEvalMoney(eid, uid));
|
||||||
|
stat.setLoanCount(loanApplyService.queryUserCountByType(eid, uid, 1));
|
||||||
|
|
||||||
|
userStatService.save(stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
package com.fangjia.job.fsh.listener;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.cxytiandi.jdbc.util.DateUtils;
|
||||||
|
import com.dangdang.ddframe.job.executor.ShardingContexts;
|
||||||
|
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
|
||||||
|
import com.fangjia.job.common.util.DingDingMessageUtil;
|
||||||
|
import com.fangjia.job.common.util.JsonUtils;
|
||||||
|
/**
|
||||||
|
* 作业监听器, 执行前后发送钉钉消息进行通知
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public class MessageElasticJobListener implements ElasticJobListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeJobExecuted(ShardingContexts shardingContexts) {
|
||||||
|
String date = DateUtils.date2Str(new Date());
|
||||||
|
String msg = date + " 【FSH-" + shardingContexts.getJobName() + "】任务开始执行====" + JsonUtils.toJson(shardingContexts);
|
||||||
|
DingDingMessageUtil.sendTextMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterJobExecuted(ShardingContexts shardingContexts) {
|
||||||
|
String date = DateUtils.date2Str(new Date());
|
||||||
|
String msg = date + " 【FSH-" + shardingContexts.getJobName() + "】任务执行结束====" + JsonUtils.toJson(shardingContexts);
|
||||||
|
DingDingMessageUtil.sendTextMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.Orders;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "ad_visit_log", author = "yinjihuan", desc = "广告访问日志表")
|
||||||
|
public class AdVisitLog implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7721155919354832229L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@Field(value="visit_time", desc="访问时间")
|
||||||
|
private Date visitTime;
|
||||||
|
|
||||||
|
@Field(value="url", desc="广告url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Field(value="adid", desc="广告ID")
|
||||||
|
private Long adid;
|
||||||
|
|
||||||
|
@Field(value="ad_position", desc="AdvertisementPositionEnum-广告位(0:我的房产-投资收益-底部, 1:我的房产-均价排名-底部, 2:我的房产-租售比-底部,3:我的房产-流动性评级-底部, 4:我的房产-均价相似小区-底部, 5:我的房产-位置及周边-底部, 6:以房换钱, 7:以房换房-小区位置及周边-底部)")
|
||||||
|
private int adPosition = -1;
|
||||||
|
|
||||||
|
public int getAdPosition() {
|
||||||
|
return adPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdPosition(int adPosition) {
|
||||||
|
this.adPosition = adPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getVisitTime() {
|
||||||
|
return visitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisitTime(Date visitTime) {
|
||||||
|
this.visitTime = visitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAdid() {
|
||||||
|
return adid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdid(Long adid) {
|
||||||
|
this.adid = adid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Orders[] id_orders = new Orders[] { new Orders("id", Orders.OrderyType.DESC)};
|
||||||
|
}
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.Orders;
|
||||||
|
import com.cxytiandi.jdbc.Orders.OrderyType;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "enterprise", author = "yinjihuan", desc = "企业表")
|
||||||
|
public class Enterprise implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 3415389324075143092L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="企业编号")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="name", desc="企业名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Field(value="address", desc="办公地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Field(value="website", desc="企业官网")
|
||||||
|
private String website;
|
||||||
|
|
||||||
|
@Field(value="open_api_token", desc="申请TOKEN的APPKEY")
|
||||||
|
private String openApiToken;
|
||||||
|
|
||||||
|
@Field(value="open_api_uname", desc="申请TOKEN的账号")
|
||||||
|
private String openApiName;
|
||||||
|
|
||||||
|
@Field(value="open_api_pass", desc="申请TOKEN的密码")
|
||||||
|
private String openApiPass;
|
||||||
|
|
||||||
|
@Field(value="enterprise_person", desc="企业负责人")
|
||||||
|
private String enterprisePerson;
|
||||||
|
|
||||||
|
@Field(value="enterprise_person_mobile", desc="联系手机")
|
||||||
|
private String enterprisePersonMobile;
|
||||||
|
|
||||||
|
@Field(value="enterprise_person_telphone", desc="办公座机")
|
||||||
|
private String enterprisePersonTelPhone;
|
||||||
|
|
||||||
|
@Field(value="enterprise_person_email", desc="联系邮箱")
|
||||||
|
private String enterprisePersonEmail;
|
||||||
|
|
||||||
|
@Field(value="product_name", desc="产品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Field(value="product_type", desc="产品类型")
|
||||||
|
private String productType;
|
||||||
|
|
||||||
|
@Field(value="status", desc="企业状态(0 禁用 1启用)")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
@Field(value="sales_person", desc="销售负责人")
|
||||||
|
private String salesPerson;
|
||||||
|
|
||||||
|
@Field(value="sales_mobile", desc="销售联系手机")
|
||||||
|
private String salesMobile;
|
||||||
|
|
||||||
|
@Field(value="open_status", desc="开通情况(0试用 1正式)")
|
||||||
|
private int openStatus;
|
||||||
|
|
||||||
|
@Field(value="open_date", desc="开通日期")
|
||||||
|
private Date openDate;
|
||||||
|
|
||||||
|
@Field(value="start_date", desc="有效期开始时间")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
@Field(value="end_date", desc="有效期结束时间")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
@Field(value="add_date", desc="添加时间")
|
||||||
|
private Date addDate;
|
||||||
|
|
||||||
|
@Field(value="modify_date", desc="修改时间")
|
||||||
|
private Date modifyDate;
|
||||||
|
|
||||||
|
@Field(value="remarks", desc="备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenApiToken() {
|
||||||
|
return openApiToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenApiToken(String openApiToken) {
|
||||||
|
this.openApiToken = openApiToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterprisePerson() {
|
||||||
|
return enterprisePerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterprisePerson(String enterprisePerson) {
|
||||||
|
this.enterprisePerson = enterprisePerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterprisePersonMobile() {
|
||||||
|
return enterprisePersonMobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterprisePersonMobile(String enterprisePersonMobile) {
|
||||||
|
this.enterprisePersonMobile = enterprisePersonMobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterprisePersonTelPhone() {
|
||||||
|
return enterprisePersonTelPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterprisePersonTelPhone(String enterprisePersonTelPhone) {
|
||||||
|
this.enterprisePersonTelPhone = enterprisePersonTelPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnterprisePersonEmail() {
|
||||||
|
return enterprisePersonEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterprisePersonEmail(String enterprisePersonEmail) {
|
||||||
|
this.enterprisePersonEmail = enterprisePersonEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productName) {
|
||||||
|
this.productName = productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductType() {
|
||||||
|
return productType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductType(String productType) {
|
||||||
|
this.productType = productType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSalesPerson() {
|
||||||
|
return salesPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSalesPerson(String salesPerson) {
|
||||||
|
this.salesPerson = salesPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSalesMobile() {
|
||||||
|
return salesMobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSalesMobile(String salesMobile) {
|
||||||
|
this.salesMobile = salesMobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOpenStatus() {
|
||||||
|
return openStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenStatus(int openStatus) {
|
||||||
|
this.openStatus = openStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getOpenDate() {
|
||||||
|
return openDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenDate(Date openDate) {
|
||||||
|
this.openDate = openDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getStartDate() {
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartDate(Date startDate) {
|
||||||
|
this.startDate = startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(Date endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAddDate() {
|
||||||
|
return addDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddDate(Date addDate) {
|
||||||
|
this.addDate = addDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getModifyDate() {
|
||||||
|
return modifyDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyDate(Date modifyDate) {
|
||||||
|
this.modifyDate = modifyDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemarks() {
|
||||||
|
return remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemarks(String remarks) {
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWebsite() {
|
||||||
|
return website;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWebsite(String website) {
|
||||||
|
this.website = website;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenApiName() {
|
||||||
|
return openApiName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenApiName(String openApiName) {
|
||||||
|
this.openApiName = openApiName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenApiPass() {
|
||||||
|
return openApiPass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenApiPass(String openApiPass) {
|
||||||
|
this.openApiPass = openApiPass;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Orders[] id_orders = new Orders[] { new Orders("id", OrderyType.DESC)};
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "enterprise_product_user", author = "yinjihuan", desc = "企业产品中的用户表")
|
||||||
|
public class EnterpriseProductUser implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5813079687876757814L;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
@Field(value="add_time", desc="保存时间")
|
||||||
|
private Date addTime;
|
||||||
|
|
||||||
|
@Field(value="remarks", desc="备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
@Field(value="city", desc="城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@Field(value="region", desc="区域")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddTime(Date addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemarks() {
|
||||||
|
return remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemarks(String remarks) {
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,537 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.Orders;
|
||||||
|
import com.cxytiandi.jdbc.Orders.OrderyType;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "house_info", author = "yinjihuan", desc = "我的房产信息表")
|
||||||
|
public class HouseInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 9044745992169573318L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="city", desc="城市")
|
||||||
|
private String city = "";
|
||||||
|
|
||||||
|
@Field(value="region", desc="区域")
|
||||||
|
private String region = "";
|
||||||
|
|
||||||
|
@Field(value="name", desc="小区")
|
||||||
|
private String name = "";
|
||||||
|
|
||||||
|
@Field(value="address", desc="地址")
|
||||||
|
private String address = "";
|
||||||
|
|
||||||
|
@Field(value="lng", desc="经度")
|
||||||
|
private double lng = 0;
|
||||||
|
|
||||||
|
@Field(value="lat", desc="纬度")
|
||||||
|
private double lat = 0;
|
||||||
|
|
||||||
|
@Field(value="estate_type", desc="物业类型")
|
||||||
|
private String estatetype = "";
|
||||||
|
|
||||||
|
@Field(value="house_num", desc="楼栋")
|
||||||
|
private String houseNum = "";
|
||||||
|
|
||||||
|
@Field(value="room_num", desc="室号")
|
||||||
|
private String roomNum = "";
|
||||||
|
|
||||||
|
@Field(value="floor", desc="当前楼层")
|
||||||
|
private int floor = 0;
|
||||||
|
|
||||||
|
@Field(value="height", desc="总共层数")
|
||||||
|
private int height = 0;
|
||||||
|
|
||||||
|
@Field(value="area", desc="面积")
|
||||||
|
private double area = 0;
|
||||||
|
|
||||||
|
@Field(value="room_count", desc="几室")
|
||||||
|
private int roomCount = 0;
|
||||||
|
|
||||||
|
@Field(value="hall_count", desc="几厅")
|
||||||
|
private int hallCount = 0;
|
||||||
|
|
||||||
|
@Field(value="rent", desc="租金,单位元")
|
||||||
|
private int rent = 0;
|
||||||
|
|
||||||
|
@Field(value="purchase_date", desc="购入时间")
|
||||||
|
private Date purchaseDate;
|
||||||
|
|
||||||
|
@Field(value="purchase_price", desc="购入价格,单位元")
|
||||||
|
private int purchasePrice = 0;
|
||||||
|
|
||||||
|
@Field(value="price", desc="评估单价,单位元")
|
||||||
|
private int price = 0;
|
||||||
|
|
||||||
|
@Field(value="total_price", desc="评估总价,单位元")
|
||||||
|
private int totalPrice = 0;
|
||||||
|
|
||||||
|
@Field(value="eval_date", desc="评估时间")
|
||||||
|
private Date evalDate = new Date();
|
||||||
|
|
||||||
|
@Field(value="add_date", desc="添加时间")
|
||||||
|
private Date addDate = new Date();
|
||||||
|
|
||||||
|
@Field(value="live_status", desc="居住状态(自住,我是租客,出租,空置)")
|
||||||
|
private String liveStatus = "自住";
|
||||||
|
|
||||||
|
@Field(value="remove_status", desc="是否删除 0正常 1删除")
|
||||||
|
private int removeStatus = 0;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid = "";
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private Long eid = 0L;
|
||||||
|
|
||||||
|
@Field(value="level", desc="HouseLevelEnum:房产等级(1:豪宅级、2:公寓级、3:平房级、4:草屋级、5:山洞级)")
|
||||||
|
private int level = 100;
|
||||||
|
|
||||||
|
@Field(value="growth_rate", desc="复合增长率")
|
||||||
|
private double growthRate = 0;
|
||||||
|
|
||||||
|
@Field(value="appreciation", desc="房屋已升值")
|
||||||
|
private int appreciation = 0;
|
||||||
|
|
||||||
|
@Field(value="rose_ranking", desc="均价排名涨幅")
|
||||||
|
private double roseRanking = 0;
|
||||||
|
|
||||||
|
@Field(value="avgprice_ranking", desc="均价排名均价")
|
||||||
|
private double avgpriceRanking = 0;
|
||||||
|
|
||||||
|
@Field(value="rental_ratio", desc="租售比(1:650)")
|
||||||
|
private String rentalRatio = "";
|
||||||
|
|
||||||
|
@Field(value="max_loan_money", desc="最高可贷,单位万元")
|
||||||
|
private double maxloanMoney = 0;
|
||||||
|
|
||||||
|
@Field(value="tag", desc="小区标签,下环线分割")
|
||||||
|
private String tag = "";
|
||||||
|
|
||||||
|
@Field(value="liquidity_rating", desc="流动性评级(0:0-26很差, 1:26-38较差, 2:38-70良好 3:70-100很好)")
|
||||||
|
private int liquidityRating = 0;
|
||||||
|
|
||||||
|
@Field(value="one_year_total_price", desc="1年前的总价")
|
||||||
|
private int oneYearTotalPrice = 0;
|
||||||
|
|
||||||
|
@Field(value="house_room_num", desc="楼栋室号联合字段")
|
||||||
|
private String houseRoomNum;
|
||||||
|
|
||||||
|
@Field(value = "lease_start_date", desc = "起租日期")
|
||||||
|
private Date leaseStartDate;
|
||||||
|
|
||||||
|
@Field(value = "lease_end_date", desc = "到期日期")
|
||||||
|
private Date leaseEndDate;
|
||||||
|
|
||||||
|
@Field(value = "rent_cycle", desc = "收租周期")
|
||||||
|
private Integer rentCycle;
|
||||||
|
|
||||||
|
@Field(value = "rent_cycle_unit", desc = "收租周期单位(年,季,月)")
|
||||||
|
private String rentCycleUnit;
|
||||||
|
|
||||||
|
@Field(value = "last_rent_date", desc = "下次收租日期")
|
||||||
|
private Date lastRentDate;
|
||||||
|
|
||||||
|
|
||||||
|
@Field(value = "min_sell_price", desc = "城市相对最低均价")
|
||||||
|
private int minSellPrice = 0;
|
||||||
|
|
||||||
|
@Field(value = "max_sell_price", desc = "城市相对最高均价")
|
||||||
|
private int maxSellPrice = 0;
|
||||||
|
|
||||||
|
@Field(value="total_score", desc="流动性评级得分")
|
||||||
|
private double totalScore = 0;
|
||||||
|
|
||||||
|
@Field(value="min_advice_value", desc="挂牌建议总价下限")
|
||||||
|
private double minAdviceValue = 0;
|
||||||
|
|
||||||
|
@Field(value="max_advice_value", desc="挂牌建议总价上限")
|
||||||
|
private double maxAdviceValue = 0;
|
||||||
|
|
||||||
|
public Date getAddDate() {
|
||||||
|
return addDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddDate(Date addDate) {
|
||||||
|
this.addDate = addDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getMinAdviceValue() {
|
||||||
|
return minAdviceValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinAdviceValue(double minAdviceValue) {
|
||||||
|
this.minAdviceValue = minAdviceValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getMaxAdviceValue() {
|
||||||
|
return maxAdviceValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxAdviceValue(double maxAdviceValue) {
|
||||||
|
this.maxAdviceValue = maxAdviceValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTotalScore() {
|
||||||
|
return totalScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalScore(double totalScore) {
|
||||||
|
this.totalScore = totalScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinSellPrice() {
|
||||||
|
return minSellPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinSellPrice(int minSellPrice) {
|
||||||
|
this.minSellPrice = minSellPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxSellPrice() {
|
||||||
|
return maxSellPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxSellPrice(int maxSellPrice) {
|
||||||
|
this.maxSellPrice = maxSellPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHouseRoomNum() {
|
||||||
|
return houseRoomNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseRoomNum(String houseRoomNum) {
|
||||||
|
this.houseRoomNum = houseRoomNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOneYearTotalPrice() {
|
||||||
|
return oneYearTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOneYearTotalPrice(int oneYearTotalPrice) {
|
||||||
|
this.oneYearTotalPrice = oneYearTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLevel() {
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLevel(int level) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegion() {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegion(String region) {
|
||||||
|
this.region = region;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLng() {
|
||||||
|
return lng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLng(double lng) {
|
||||||
|
this.lng = lng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLat() {
|
||||||
|
return lat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLat(double lat) {
|
||||||
|
this.lat = lat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEstatetype() {
|
||||||
|
return estatetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstatetype(String estatetype) {
|
||||||
|
this.estatetype = estatetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHouseNum() {
|
||||||
|
return houseNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseNum(String houseNum) {
|
||||||
|
this.houseNum = houseNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoomNum() {
|
||||||
|
return roomNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomNum(String roomNum) {
|
||||||
|
this.roomNum = roomNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFloor() {
|
||||||
|
return floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFloor(int floor) {
|
||||||
|
this.floor = floor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeight(int height) {
|
||||||
|
this.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getArea() {
|
||||||
|
return area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArea(double area) {
|
||||||
|
this.area = area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoomCount() {
|
||||||
|
return roomCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomCount(int roomCount) {
|
||||||
|
this.roomCount = roomCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHallCount() {
|
||||||
|
return hallCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHallCount(int hallCount) {
|
||||||
|
this.hallCount = hallCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRent() {
|
||||||
|
return rent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRent(int rent) {
|
||||||
|
this.rent = rent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getPurchaseDate() {
|
||||||
|
return purchaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchaseDate(Date purchaseDate) {
|
||||||
|
this.purchaseDate = purchaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPurchasePrice() {
|
||||||
|
return purchasePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurchasePrice(int purchasePrice) {
|
||||||
|
this.purchasePrice = purchasePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(int price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalPrice() {
|
||||||
|
return totalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPrice(int totalPrice) {
|
||||||
|
this.totalPrice = totalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEvalDate() {
|
||||||
|
return evalDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEvalDate(Date evalDate) {
|
||||||
|
this.evalDate = evalDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiveStatus() {
|
||||||
|
return liveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiveStatus(String liveStatus) {
|
||||||
|
this.liveStatus = liveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRemoveStatus() {
|
||||||
|
return removeStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemoveStatus(int removeStatus) {
|
||||||
|
this.removeStatus = removeStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getGrowthRate() {
|
||||||
|
return growthRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrowthRate(double growthRate) {
|
||||||
|
this.growthRate = growthRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAppreciation() {
|
||||||
|
return appreciation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppreciation(int appreciation) {
|
||||||
|
this.appreciation = appreciation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getRoseRanking() {
|
||||||
|
return roseRanking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoseRanking(double roseRanking) {
|
||||||
|
this.roseRanking = roseRanking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAvgpriceRanking() {
|
||||||
|
return avgpriceRanking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvgpriceRanking(double avgpriceRanking) {
|
||||||
|
this.avgpriceRanking = avgpriceRanking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRentalRatio() {
|
||||||
|
return rentalRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRentalRatio(String rentalRatio) {
|
||||||
|
this.rentalRatio = rentalRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getMaxloanMoney() {
|
||||||
|
return maxloanMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxloanMoney(double maxloanMoney) {
|
||||||
|
this.maxloanMoney = maxloanMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLiquidityRating() {
|
||||||
|
return liquidityRating;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLiquidityRating(int liquidityRating) {
|
||||||
|
this.liquidityRating = liquidityRating;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Orders[] level_orders = new Orders[] { new Orders("level", OrderyType.ASC)};
|
||||||
|
|
||||||
|
public Date getLeaseStartDate() {
|
||||||
|
return leaseStartDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeaseStartDate(Date leaseStartDate) {
|
||||||
|
this.leaseStartDate = leaseStartDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLeaseEndDate() {
|
||||||
|
return leaseEndDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLeaseEndDate(Date leaseEndDate) {
|
||||||
|
this.leaseEndDate = leaseEndDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRentCycle() {
|
||||||
|
return rentCycle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRentCycle(Integer rentCycle) {
|
||||||
|
this.rentCycle = rentCycle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRentCycleUnit() {
|
||||||
|
return rentCycleUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRentCycleUnit(String rentCycleUnit) {
|
||||||
|
this.rentCycleUnit = rentCycleUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastRentDate() {
|
||||||
|
return lastRentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastRentDate(Date lastRentDate) {
|
||||||
|
this.lastRentDate = lastRentDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
+214
@@ -0,0 +1,214 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "house_substitution", author = "yinjihuan", desc = "房产置换信息表")
|
||||||
|
public class HouseSubstitution implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -5535708206578110561L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="house_id", desc="置换房产ID,house_info中的主键")
|
||||||
|
private Long houseId;
|
||||||
|
|
||||||
|
@Field(value="substitution_type", desc="置换方式(0先买后卖, 1先卖后买)")
|
||||||
|
private int substitutionType;
|
||||||
|
|
||||||
|
@Field(value="cur_money", desc="当前资金,单位万元")
|
||||||
|
private double curMoney;
|
||||||
|
|
||||||
|
@Field(value="budget", desc="买房预算,单位万元")
|
||||||
|
private double budget;
|
||||||
|
|
||||||
|
@Field(value="shoufu", desc="首付比例,数字存储,30就代表30%")
|
||||||
|
private int shoufu;
|
||||||
|
|
||||||
|
@Field(value="intention_district", desc="意向小区")
|
||||||
|
private String intentionDistrict;
|
||||||
|
|
||||||
|
@Field(value="reason", desc="置换原因")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Field(value="intention_area", desc="意向面积(0:50平以下,1:50-70,2:70-90,3:90-110,4:110-150,5:150-200,6:200-300,7:300以上)")
|
||||||
|
private int intentionArea;
|
||||||
|
|
||||||
|
@Field(value="intention_city", desc="意向城市")
|
||||||
|
private String intentionCity;
|
||||||
|
|
||||||
|
@Field(value="intention_region", desc="意向区域")
|
||||||
|
private String intentionRegion;
|
||||||
|
|
||||||
|
@Field(value="intention_tags", desc="意向小区标签")
|
||||||
|
private String intentionTags;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private String eid;
|
||||||
|
|
||||||
|
@Field(value="add_time", desc="添加时间")
|
||||||
|
private Date addTime;
|
||||||
|
|
||||||
|
@Field(value="match_count", desc="匹配结果总数")
|
||||||
|
private int matchCount;
|
||||||
|
|
||||||
|
@Field(value="dis_click_count", desc="结果小区点击次数")
|
||||||
|
private int disClickCount;
|
||||||
|
|
||||||
|
|
||||||
|
@Field(value="tax_rate", desc="税费占比,数字存储,30就代表30%")
|
||||||
|
private int taxRate;
|
||||||
|
|
||||||
|
public int getDisClickCount() {
|
||||||
|
return disClickCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisClickCount(int disClickCount) {
|
||||||
|
this.disClickCount = disClickCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMatchCount() {
|
||||||
|
return matchCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMatchCount(int matchCount) {
|
||||||
|
this.matchCount = matchCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getHouseId() {
|
||||||
|
return houseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHouseId(Long houseId) {
|
||||||
|
this.houseId = houseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSubstitutionType() {
|
||||||
|
return substitutionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubstitutionType(int substitutionType) {
|
||||||
|
this.substitutionType = substitutionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCurMoney() {
|
||||||
|
return curMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurMoney(double curMoney) {
|
||||||
|
this.curMoney = curMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBudget() {
|
||||||
|
return budget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBudget(double budget) {
|
||||||
|
this.budget = budget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getShoufu() {
|
||||||
|
return shoufu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShoufu(int shoufu) {
|
||||||
|
this.shoufu = shoufu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntentionDistrict() {
|
||||||
|
return intentionDistrict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntentionDistrict(String intentionDistrict) {
|
||||||
|
this.intentionDistrict = intentionDistrict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReason(String reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIntentionArea() {
|
||||||
|
return intentionArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntentionArea(int intentionArea) {
|
||||||
|
this.intentionArea = intentionArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntentionCity() {
|
||||||
|
return intentionCity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntentionCity(String intentionCity) {
|
||||||
|
this.intentionCity = intentionCity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntentionRegion() {
|
||||||
|
return intentionRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntentionRegion(String intentionRegion) {
|
||||||
|
this.intentionRegion = intentionRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(String eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddTime(Date addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTaxRate() {
|
||||||
|
return taxRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaxRate(int taxRate) {
|
||||||
|
this.taxRate = taxRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntentionTags() {
|
||||||
|
return intentionTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntentionTags(String intentionTags) {
|
||||||
|
this.intentionTags = intentionTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "loan_apply", author = "yinjihuan", desc = "贷款申请表")
|
||||||
|
public class LoanApply implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8945420378322104237L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="type", desc="1:贷款申请 2:贷款评估")
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@Field(value="eval_money", desc="评估金额(万元")
|
||||||
|
private double evalMoney;
|
||||||
|
|
||||||
|
@Field(value="city", desc="所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@Field(value="apply_money", desc="申请金额(万元)")
|
||||||
|
private double applyMoney;
|
||||||
|
|
||||||
|
@Field(value="mortgage", desc="是否接收抵押(0否 1是)")
|
||||||
|
private int mortgage;
|
||||||
|
|
||||||
|
@Field(value="hid", desc="抵押房产编号")
|
||||||
|
private Long hid;
|
||||||
|
|
||||||
|
@Field(value="add_time", desc="添加时间")
|
||||||
|
private Date addTime;
|
||||||
|
|
||||||
|
@Field(value="purpose", desc="贷款用途(1买房 2买车 3个人消费 4企业经营)")
|
||||||
|
private int purpose;
|
||||||
|
|
||||||
|
@Field(value="work", desc="职业(1上班族 2企业主 3学生 4无业)")
|
||||||
|
private int work;
|
||||||
|
|
||||||
|
@Field(value="wages", desc="月收入(1:5千以下 2:5千到1万 3:1万到2万 4:2万以上)")
|
||||||
|
private int wages;
|
||||||
|
|
||||||
|
@Field(value="assets", desc="我的资产(1我有房 2我有车 3有信用卡 4都没有)")
|
||||||
|
private int assets;
|
||||||
|
|
||||||
|
@Field(value="credit", desc="信用情况(1:无信用卡无贷款 2:有信用卡或贷款,无逾期 3:1年内逾期少于3次且少于90天 4:1年内逾期超过3次或超过90天)")
|
||||||
|
private int credit;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getEvalMoney() {
|
||||||
|
return evalMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEvalMoney(double evalMoney) {
|
||||||
|
this.evalMoney = evalMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getApplyMoney() {
|
||||||
|
return applyMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplyMoney(double applyMoney) {
|
||||||
|
this.applyMoney = applyMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMortgage() {
|
||||||
|
return mortgage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMortgage(int mortgage) {
|
||||||
|
this.mortgage = mortgage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getHid() {
|
||||||
|
return hid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHid(Long hid) {
|
||||||
|
this.hid = hid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddTime(Date addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPurpose() {
|
||||||
|
return purpose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPurpose(int purpose) {
|
||||||
|
this.purpose = purpose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWork() {
|
||||||
|
return work;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWork(int work) {
|
||||||
|
this.work = work;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWages() {
|
||||||
|
return wages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWages(int wages) {
|
||||||
|
this.wages = wages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAssets() {
|
||||||
|
return assets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssets(int assets) {
|
||||||
|
this.assets = assets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCredit() {
|
||||||
|
return credit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCredit(int credit) {
|
||||||
|
this.credit = credit;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.fangjia.job.fsh.po;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.cxytiandi.jdbc.Orders;
|
||||||
|
import com.cxytiandi.jdbc.annotation.AutoId;
|
||||||
|
import com.cxytiandi.jdbc.annotation.Field;
|
||||||
|
import com.cxytiandi.jdbc.annotation.TableName;
|
||||||
|
|
||||||
|
@TableName(value = "visit_log", author = "yinjihuan", desc = "访问日志表")
|
||||||
|
public class VisitLog implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7402223049704716248L;
|
||||||
|
|
||||||
|
@AutoId
|
||||||
|
@Field(value="id", desc="ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Field(value="uri", desc="uri")
|
||||||
|
private String uri;
|
||||||
|
|
||||||
|
@Field(value="page", desc="访问的页面")
|
||||||
|
private String page;
|
||||||
|
|
||||||
|
@Field(value="visit_time", desc="访问的时间")
|
||||||
|
private Date visitTime;
|
||||||
|
|
||||||
|
@Field(value="eid", desc="企业ID")
|
||||||
|
private Long eid;
|
||||||
|
|
||||||
|
@Field(value="uid", desc="用户ID")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@Field(value="ip", desc="用户IP")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUri(String uri) {
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(String page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getVisitTime() {
|
||||||
|
return visitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVisitTime(Date visitTime) {
|
||||||
|
this.visitTime = visitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEid() {
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEid(Long eid) {
|
||||||
|
this.eid = eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIp() {
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIp(String ip) {
|
||||||
|
this.ip = ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Orders[] id_orders = new Orders[] { new Orders("id", Orders.OrderyType.DESC)};
|
||||||
|
|
||||||
|
public static String[] query_params = new String[] { "eid", "uid" };
|
||||||
|
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
package com.fangjia.job.fsh.remote;
|
||||||
|
|
||||||
|
import com.fangjia.job.common.base.Response;
|
||||||
|
import feign.Param;
|
||||||
|
import feign.RequestLine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API调用接口定义
|
||||||
|
* @author yinjihuan
|
||||||
|
*/
|
||||||
|
public interface FshApiRemoteService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送月涨幅计算通知
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestLine("GET /rest/houses/rose/month?token={token}")
|
||||||
|
public Response sendHouseRoseMonthNotice(@Param("token")String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送租金提醒计算通知
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestLine("GET /rest/houses/rent/notice?token={token}")
|
||||||
|
public Response sendHouseRentNotice(@Param("token")String token);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时估价操作,并算出周涨跌幅通知
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestLine("GET /rest/houses/eval?token={token}")
|
||||||
|
public Response evalAllHousePrice(@Param("token")String token);
|
||||||
|
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
public interface AdVisitLogService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业时间范围内的PV
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryPvCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业时间范围内的UV
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryUvCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.fangjia.job.fsh.po.AdVisitLog;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AdVisitLogServiceImpl extends EntityService<AdVisitLog> implements AdVisitLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryPvCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(id) from ad_visit_log where eid = ? and visit_time between ? and ?";
|
||||||
|
return super.count(sql, new Object[] { eid, start, end });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryUvCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(distinct(uid)) from ad_visit_log where eid = ? and visit_time between ? and ?";
|
||||||
|
return super.count(sql, new Object[] { eid, start, end });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fangjia.job.fsh.po.EnterpriseProductUser;
|
||||||
|
|
||||||
|
public interface EnterpriseProductUserService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询总用户数量
|
||||||
|
* @param eid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryUserCount(Long eid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新增用户数量
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryAddUserCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询总用户数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询用户信息
|
||||||
|
* @param page
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EnterpriseProductUser> queryByPage(int page, int limit);
|
||||||
|
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.cxytiandi.jdbc.util.PageBean;
|
||||||
|
import com.fangjia.job.fsh.po.EnterpriseProductUser;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class EnterpriseProductUserServiceImpl extends EntityService<EnterpriseProductUser> implements EnterpriseProductUserService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryUserCount(Long eid) {
|
||||||
|
return super.count("eid", eid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryAddUserCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(uid) from enterprise_product_user where eid = ? and add_time between ? and ?";
|
||||||
|
return super.count(sql, new Object[] { eid, start, end });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCount() {
|
||||||
|
return super.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EnterpriseProductUser> queryByPage(int page, int limit) {
|
||||||
|
int start = PageBean.page2Start(page, limit);
|
||||||
|
return super.listForPage(start, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.fangjia.job.fsh.po.Enterprise;
|
||||||
|
|
||||||
|
public interface EnterpriseService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询企业信息
|
||||||
|
* @param page
|
||||||
|
* @param limit
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Enterprise> queryByPage(int page, int limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业数量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCount();
|
||||||
|
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.cxytiandi.jdbc.util.PageBean;
|
||||||
|
import com.fangjia.job.fsh.po.Enterprise;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class EnterpriseServiceImpl extends EntityService<Enterprise> implements EnterpriseService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Enterprise> queryByPage(int page, int limit) {
|
||||||
|
int start = PageBean.page2Start(page, limit);
|
||||||
|
return super.listForPage("status", 1, start, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCount() {
|
||||||
|
return super.count("status", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import com.fangjia.job.fsh.document.EnterpriseStat;
|
||||||
|
|
||||||
|
public interface EnterpriseStatService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存企业统计信息
|
||||||
|
* @param stat
|
||||||
|
*/
|
||||||
|
void save(EnterpriseStat stat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除企业统计信息
|
||||||
|
* @param eid
|
||||||
|
*/
|
||||||
|
void remove(String eid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业的统计信息
|
||||||
|
* @param eid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EnterpriseStat getByEid(Long eid);
|
||||||
|
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
|
import org.springframework.data.mongodb.core.query.Criteria;
|
||||||
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.fangjia.job.fsh.document.EnterpriseStat;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class EnterpriseStatServiceImpl implements EnterpriseStatService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MongoTemplate mongoTemplate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(EnterpriseStat stat) {
|
||||||
|
mongoTemplate.save(stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(String eid) {
|
||||||
|
mongoTemplate.remove(Query.query(Criteria.where("eid").is(eid)), EnterpriseStat.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnterpriseStat getByEid(Long eid) {
|
||||||
|
return mongoTemplate.findOne(Query.query(Criteria.where("eid").is(eid)), EnterpriseStat.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
public interface HouseInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按时间查询房产数量
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryHouseCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按时间查询房产总金额
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double queryHouseSumMoney(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有房产数量
|
||||||
|
* @param eid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryHouseAllCount(Long eid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有房产总金额
|
||||||
|
* @param eid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double queryHouseAllSumMoney(Long eid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据居住状态查询房产数量
|
||||||
|
* @param eid
|
||||||
|
* @param liveStatus
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCountByLiveStatus(Long eid, String liveStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业下用户的房产数量
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCountByEidAndUid(Long eid, String uid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业下用户的房产总价值
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double querySumMoneyByEidAndUid(Long eid, String uid);
|
||||||
|
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.fangjia.job.fsh.po.HouseInfo;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HouseInfoServiceImpl extends EntityService<HouseInfo> implements HouseInfoService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryHouseCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(id) from house_info where eid = ? and add_date between ? and ?";
|
||||||
|
return super.count(sql, new Object[] { eid, start, end });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double queryHouseSumMoney(Long eid, String start, String end) {
|
||||||
|
String sql = "select sum(total_price) from house_info where eid = ? and add_date between ? and ?";
|
||||||
|
Long sum = super.getJdbcTemplate().queryForObject(sql, Long.class, new Object[] { eid, start, end });
|
||||||
|
if (sum == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return sum / 10000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryHouseAllCount(Long eid) {
|
||||||
|
String sql = "select count(id) from house_info where eid = ?";
|
||||||
|
return super.count(sql, new Object[] { eid });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double queryHouseAllSumMoney(Long eid) {
|
||||||
|
String sql = "select sum(total_price) from house_info where eid = ?";
|
||||||
|
Long sum = super.getJdbcTemplate().queryForObject(sql, Long.class, new Object[] { eid });
|
||||||
|
if (sum == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return sum / 10000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCountByLiveStatus(Long eid, String liveStatus) {
|
||||||
|
String sql = "select count(id) from house_info where eid = ? and live_status = ?";
|
||||||
|
return super.count(sql, new Object[] { eid, liveStatus });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCountByEidAndUid(Long eid, String uid) {
|
||||||
|
return super.count(new String[] { "eid", "uid" }, new Object[] { eid, uid });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double querySumMoneyByEidAndUid(Long eid, String uid) {
|
||||||
|
String sql = "select sum(total_price) from house_info where eid = ? and uid = ?";
|
||||||
|
Long sum = super.getJdbcTemplate().queryForObject(sql, Long.class, new Object[] { eid, uid });
|
||||||
|
if (sum == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return sum / 10000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
public interface HouseSubstitutionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询置换次数
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCount(Long eid, String uid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询最大的买房预算金额
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double queryMaxBudget(Long eid, String uid);
|
||||||
|
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.fangjia.job.fsh.po.HouseSubstitution;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HouseSubstitutionServiceImpl extends EntityService<HouseSubstitution> implements HouseSubstitutionService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCount(Long eid, String uid) {
|
||||||
|
return super.count(new String[] { "eid", "uid" }, new Object[] { eid, uid });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double queryMaxBudget(Long eid, String uid) {
|
||||||
|
String sql = "select max(budget) from house_substitution where eid = ? and uid = ?";
|
||||||
|
Double price = super.getJdbcTemplate().queryForObject(sql, Double.class, new Object[] { eid, uid });
|
||||||
|
if (price == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
public interface LoanApplyService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次数
|
||||||
|
* @param eid
|
||||||
|
* @param type 1:贷款申请 2:贷款评估
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCountByType(Long eid, int type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次数
|
||||||
|
* @param eid
|
||||||
|
* @param type 1:贷款申请 2:贷款评估
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryCountByType(Long eid, int type, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 贷款申请金额
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double queryLoanMoney(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户贷款次数
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @param type 1:贷款申请 2:贷款评估
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryUserCountByType(Long eid, String uid, int type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询贷款评估最高金额
|
||||||
|
* @param eid
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Double queryMaxEvalMoney(Long eid, String uid);
|
||||||
|
|
||||||
|
}
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.fangjia.job.fsh.po.LoanApply;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LoanApplyServiceImpl extends EntityService<LoanApply> implements LoanApplyService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCountByType(Long eid, int type) {
|
||||||
|
return super.count(new String[] { "eid", "type" }, new Object[] { eid, type });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryCountByType(Long eid, int type, String start, String end) {
|
||||||
|
String sql = "select count(id) from loan_apply where eid = ? and type = ? and add_time between ? and ?";
|
||||||
|
return super.count(sql, new Object[] { eid, type, start, end });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double queryLoanMoney(Long eid, String start, String end) {
|
||||||
|
String sql = "select sum(apply_money) from loan_apply where eid = ? and type = 1";
|
||||||
|
Double money = super.getJdbcTemplate().queryForObject(sql, new Object[] { eid }, Double.class);
|
||||||
|
if (money == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryUserCountByType(Long eid, String uid, int type) {
|
||||||
|
return super.count(new String[] { "eid", "uid", "type" }, new Object[] { eid, uid, type });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double queryMaxEvalMoney(Long eid, String uid) {
|
||||||
|
String sql = "select max(eval_money) from loan_apply where eid = ? and uid = ?";
|
||||||
|
Double money = super.getJdbcTemplate().queryForObject(sql, new Object[] { eid, uid }, Double.class);
|
||||||
|
if (money == null) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import com.fangjia.job.fsh.document.UserStat;
|
||||||
|
|
||||||
|
public interface UserStatService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询统计信息
|
||||||
|
* @param uid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
UserStat getByUid(String uid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存数据
|
||||||
|
* @param userStat
|
||||||
|
*/
|
||||||
|
void save(UserStat userStat);
|
||||||
|
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
|
import org.springframework.data.mongodb.core.query.Criteria;
|
||||||
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.fangjia.job.fsh.document.UserStat;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserStatServiceImpl implements UserStatService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MongoTemplate mongoTemplate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserStat getByUid(String uid) {
|
||||||
|
return mongoTemplate.findOne(Query.query(Criteria.where("uid").is(uid)), UserStat.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(UserStat userStat) {
|
||||||
|
mongoTemplate.save(userStat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
public interface VisitLogService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业具体页面的PV
|
||||||
|
* @param eid
|
||||||
|
* @param uri
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryPvCount(Long eid, String uri, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业具体页面的PV
|
||||||
|
* @param eid
|
||||||
|
* @param uri
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryPvCount(Long eid, String uri);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业的PV
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryPvCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业的UV
|
||||||
|
* @param eid
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
long queryUvCount(Long eid, String start, String end);
|
||||||
|
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
package com.fangjia.job.fsh.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cxytiandi.jdbc.EntityService;
|
||||||
|
import com.fangjia.job.fsh.po.VisitLog;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class VisitLogServiceImpl extends EntityService<VisitLog> implements VisitLogService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryPvCount(Long eid, String uri, String start, String end) {
|
||||||
|
String sql = "select count(id) from visit_log where eid = ? and uri = ? and visit_time between ? and ?";
|
||||||
|
return super.count(sql.toString(), new Object[] {eid, uri, start, end});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryPvCount(Long eid, String uri) {
|
||||||
|
String sql = "select count(id) from visit_log where eid = ? and uri = ?";
|
||||||
|
return super.count(sql.toString(), new Object[] {eid, uri});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryPvCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(id) from visit_log where eid = ? and visit_time between ? and ?";
|
||||||
|
return super.count(sql.toString(), new Object[] {eid, start, end});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long queryUvCount(Long eid, String start, String end) {
|
||||||
|
String sql = "select count(distinct(uid)) from visit_log where eid = ? and visit_time between ? and ?";
|
||||||
|
return super.count(sql.toString(), new Object[] {eid, start, end});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
spring.data.mongodb.uri=mongodb://192.168.0.136/fangjia_fsh
|
||||||
|
|
||||||
|
spring.datasource.url=jdbc:mysql://192.168.0.132:4306/fangjia_fsh
|
||||||
|
spring.datasource.username=sa
|
||||||
|
spring.datasource.password=G00jia
|
||||||
|
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
spring.datasource.log.url=jdbc:mysql://192.168.0.132:4306/batch_log
|
||||||
|
spring.datasource.log.username=sa
|
||||||
|
spring.datasource.log.password=G00jia
|
||||||
|
spring.datasource.log.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
fsh.url=http://192.168.0.251:8084
|
||||||
|
|
||||||
|
zk.server-lists=192.168.10.47:2181
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
spring.data.mongodb.uri=mongodb://mongo.db.fangjia.com/fangjia_fsh
|
||||||
|
|
||||||
|
spring.datasource.url=jdbc:mysql://mysql.db.fangjia.com:4306/fangjia_fsh
|
||||||
|
spring.datasource.username=sa
|
||||||
|
spring.datasource.password=G00jia
|
||||||
|
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
spring.datasource.log.url=jdbc:mysql://192.168.0.41:4306/batch_log
|
||||||
|
spring.datasource.log.username=root
|
||||||
|
spring.datasource.log.password=Ga041243
|
||||||
|
spring.datasource.log.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
fsh.url=http://fsh.fangjia.com
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
spring.data.mongodb.uri=mongodb://192.168.0.136/fangjia_fsh
|
||||||
|
|
||||||
|
spring.datasource.url=jdbc:mysql://192.168.0.132:4306/fangjia_fsh
|
||||||
|
spring.datasource.username=sa
|
||||||
|
spring.datasource.password=G00jia
|
||||||
|
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
spring.datasource.log.url=jdbc:mysql://192.168.0.132:4306/batch_log
|
||||||
|
spring.datasource.log.username=sa
|
||||||
|
spring.datasource.log.password=G00jia
|
||||||
|
spring.datasource.log.driver-class-name=com.mysql.jdbc.Driver
|
||||||
|
|
||||||
|
fsh.url=http://192.168.0.251:8084
|
||||||
|
|
||||||
|
zk.server-lists=192.168.10.47:2181
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
spring.profiles.active=test
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:reg="http://www.dangdang.com/schema/ddframe/reg" xmlns:job="http://www.dangdang.com/schema/ddframe/job"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context.xsd
|
||||||
|
http://www.dangdang.com/schema/ddframe/reg
|
||||||
|
http://www.dangdang.com/schema/ddframe/reg/reg.xsd
|
||||||
|
http://www.dangdang.com/schema/ddframe/job
|
||||||
|
http://www.dangdang.com/schema/ddframe/job/job.xsd
|
||||||
|
">
|
||||||
|
<context:component-scan base-package="com.fangjia.job" />
|
||||||
|
|
||||||
|
<beans profile="dev">
|
||||||
|
<context:property-placeholder location="classpath:application-dev.properties" />
|
||||||
|
</beans>
|
||||||
|
|
||||||
|
<beans profile="test">
|
||||||
|
<context:property-placeholder location="classpath:application-test.properties" />
|
||||||
|
</beans>
|
||||||
|
|
||||||
|
<beans profile="prod">
|
||||||
|
<context:property-placeholder location="classpath:application-prod.properties" />
|
||||||
|
</beans>
|
||||||
|
|
||||||
|
</beans>
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:reg="http://www.dangdang.com/schema/ddframe/reg"
|
||||||
|
xmlns:job="http://www.dangdang.com/schema/ddframe/job"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context.xsd
|
||||||
|
http://www.dangdang.com/schema/ddframe/reg
|
||||||
|
http://www.dangdang.com/schema/ddframe/reg/reg.xsd
|
||||||
|
http://www.dangdang.com/schema/ddframe/job
|
||||||
|
http://www.dangdang.com/schema/ddframe/job/job.xsd
|
||||||
|
">
|
||||||
|
|
||||||
|
<bean id="elasticJobLog" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||||
|
<property name="driverClassName" value="${spring.datasource.log.driver-class-name}"/>
|
||||||
|
<property name="url" value="${spring.datasource.log.url}"/>
|
||||||
|
<property name="username" value="${spring.datasource.log.username}"/>
|
||||||
|
<property name="password" value="${spring.datasource.log.password}"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" primary="true">
|
||||||
|
<property name="driverClassName" value="${spring.datasource.driver-class-name}"/>
|
||||||
|
<property name="url" value="${spring.datasource.url}"/>
|
||||||
|
<property name="username" value="${spring.datasource.username}"/>
|
||||||
|
<property name="password" value="${spring.datasource.password}"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="CxytiandiJdbcTemplate" class="com.cxytiandi.jdbc.CxytiandiJdbcTemplate">
|
||||||
|
<constructor-arg>
|
||||||
|
<value>com.fangjia.job.fsh.po</value>
|
||||||
|
</constructor-arg>
|
||||||
|
<property name="dataSource" ref="dataSource"></property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<reg:zookeeper id="regCenter" server-lists="${zk.server-lists}" namespace="fangjia-job-fsh"
|
||||||
|
base-sleep-time-milliseconds="1000" max-sleep-time-milliseconds="3000" max-retries="3" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 企业统计任务 每天0点1分执行 -->
|
||||||
|
<job:simple id="enterpriseStatJob" class="com.fangjia.job.fsh.job.EnterpriseStatJob" registry-center-ref="regCenter"
|
||||||
|
sharding-total-count="1" cron="0 1 0 * * ?" sharding-item-parameters=""
|
||||||
|
monitor-execution="false" failover="true" description="【房生活】企业统计任务,每天0点1分开始执行,主要统计企业相关的数据,统计内容参考 EnterpriseStat"
|
||||||
|
disabled="false" overwrite="true" event-trace-rdb-data-source="elasticJobLog" >
|
||||||
|
|
||||||
|
<job:listener class="com.fangjia.job.fsh.listener.MessageElasticJobListener"></job:listener>
|
||||||
|
|
||||||
|
</job:simple>
|
||||||
|
|
||||||
|
<!-- 用户统计任务 每天1点10分执行 -->
|
||||||
|
<job:simple id="userStatJob" class="com.fangjia.job.fsh.job.UserStatJob" registry-center-ref="regCenter"
|
||||||
|
sharding-total-count="1" cron="0 10 1 * * ?" sharding-item-parameters=""
|
||||||
|
monitor-execution="false" failover="true" description="【房生活】用户维度统计任务,统计出用户的房产,置换,贷款等信息 UserStatJob"
|
||||||
|
disabled="false" overwrite="true" event-trace-rdb-data-source="elasticJobLog" >
|
||||||
|
|
||||||
|
<job:listener class="com.fangjia.job.fsh.listener.MessageElasticJobListener"></job:listener>
|
||||||
|
|
||||||
|
</job:simple>
|
||||||
|
|
||||||
|
<!-- 房产月涨幅通知任务 每个月1号凌晨1点10分执行 -->
|
||||||
|
<job:simple id="houseRoseMonthNoticeJob" class="com.fangjia.job.fsh.job.HouseRoseMonthNoticeJob" registry-center-ref="regCenter"
|
||||||
|
sharding-total-count="1" cron="0 10 1 1 * ?" sharding-item-parameters=""
|
||||||
|
monitor-execution="false" failover="true" description="【房生活】房产月涨幅通知任务, 每个月1号触发,目前计算逻辑在服务端"
|
||||||
|
disabled="false" overwrite="true" event-trace-rdb-data-source="elasticJobLog" >
|
||||||
|
|
||||||
|
<job:listener class="com.fangjia.job.fsh.listener.MessageElasticJobListener"></job:listener>
|
||||||
|
|
||||||
|
</job:simple>
|
||||||
|
|
||||||
|
<!-- 租金提醒通知任务 每天2点10分执行 -->
|
||||||
|
<job:simple id="houseRentNoticeJob" class="com.fangjia.job.fsh.job.HouseRentNoticeJob" registry-center-ref="regCenter"
|
||||||
|
sharding-total-count="1" cron="0 10 2 * * ?" sharding-item-parameters=""
|
||||||
|
monitor-execution="false" failover="true" description="【房生活】房产租金提醒任务,每天触发一次,逻辑在服务端"
|
||||||
|
disabled="false" overwrite="true" event-trace-rdb-data-source="elasticJobLog" >
|
||||||
|
|
||||||
|
<job:listener class="com.fangjia.job.fsh.listener.MessageElasticJobListener"></job:listener>
|
||||||
|
|
||||||
|
</job:simple>
|
||||||
|
|
||||||
|
<!-- 房产每周一定时估价任务 每周一2点10分执行 -->
|
||||||
|
<job:simple id="houseWeekEvalJob" class="com.fangjia.job.fsh.job.HouseWeekEvalJob" registry-center-ref="regCenter"
|
||||||
|
sharding-total-count="1" cron="0 10 2 ? * 2" sharding-item-parameters=""
|
||||||
|
monitor-execution="false" failover="true" description="【房生活】房产每周一定时估价任务,逻辑在服务端,同时需要算出周涨幅通知"
|
||||||
|
disabled="false" overwrite="true" event-trace-rdb-data-source="elasticJobLog" >
|
||||||
|
|
||||||
|
<job:listener class="com.fangjia.job.fsh.listener.MessageElasticJobListener"></job:listener>
|
||||||
|
|
||||||
|
</job:simple>
|
||||||
|
|
||||||
|
</beans>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false">
|
||||||
|
|
||||||
|
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
|
||||||
|
<property name="LOG_HOME" value="/home/goojia/logs" />
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/fsh-job.log.%d{yyyy-MM-dd}.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<MaxHistory>7</MaxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<!--日志文件最大的大小-->
|
||||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||||
|
<MaxFileSize>100MB</MaxFileSize>
|
||||||
|
</triggeringPolicy>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 日志输出级别 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.fangjia</groupId>
|
||||||
|
<artifactId>fangjia-job</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>fangjia-job-fsh</module>
|
||||||
|
<module>fangjia-job-common</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<springboot.version>1.4.2.RELEASE</springboot.version>
|
||||||
|
<elastic-job.version>2.1.5</elastic-job.version>
|
||||||
|
<curator.version>2.10.0</curator.version>
|
||||||
|
<springframework.version>4.3.4.RELEASE</springframework.version>
|
||||||
|
<slf4j.version>1.7.7</slf4j.version>
|
||||||
|
<logback.version>1.1.2</logback.version>
|
||||||
|
<commons-dbcp.version>1.4</commons-dbcp.version>
|
||||||
|
<mysql.version>5.1.30</mysql.version>
|
||||||
|
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
|
||||||
|
<jdbc.version>1.0.0</jdbc.version>
|
||||||
|
<feign.version>9.5.0</feign.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>1.4.2.RELEASE</version>
|
||||||
|
</parent>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fangjia</groupId>
|
||||||
|
<artifactId>fangjia-job-common</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dangdang</groupId>
|
||||||
|
<artifactId>elastic-job-lite-core</artifactId>
|
||||||
|
<version>${elastic-job.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dangdang</groupId>
|
||||||
|
<artifactId>elastic-job-lite-spring</artifactId>
|
||||||
|
<version>${elastic-job.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>${mysql.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbcp</groupId>
|
||||||
|
<artifactId>commons-dbcp</artifactId>
|
||||||
|
<version>${commons-dbcp.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cxytiandi</groupId>
|
||||||
|
<artifactId>cxytiandi-jdbc</artifactId>
|
||||||
|
<version>${jdbc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>joda-time</groupId>
|
||||||
|
<artifactId>joda-time</artifactId>
|
||||||
|
<version>2.9.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.openfeign</groupId>
|
||||||
|
<artifactId>feign-core</artifactId>
|
||||||
|
<version>${feign.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
</project>
|
||||||
Reference in New Issue
Block a user