HC小区系统论坛
一个开源免费商用的小区物业管理系统

News

LINUX宝塔环境下快速部署,免编译,会用宝塔就会用HC

https://www.yuque.com/docs/share/e5863485-f2f9-4d08-8373-efde334d3fc4?# 《LINUX宝塔环境下快速部署,免编译环节。》
上个含编译的宝塔部署教程,不少用户反映编译环节还是太麻烦,特推出免编译直接下载安装的教程。感谢开发者提供jar包存储,后期有更新时,我会在这里提示大家,大家只需要下载新jar包覆盖旧版本后重启服务即可。
有问题可以留言,也可咨询文哥或者加我QQ547974317.
后期我会抽时间给大家录制宝塔部署视频。



Linux后端部署,docker-compose.yml文件需要在哪里修改?

1.安装视频中(HC小区linux环境部署建议:https://www.bilibili.com/video/BV1h7411g7mu),hcConf文件是旧版本中的的配置文件夹吗?
2.后端部署可不可以,本地打成10多个jar包放到服务器上?



HC小区管理系统0.8版sql 下载


一键部署的数据库密码在哪里看

more /tmp/hc_pwd



公众号nginx配置

server {
listen 80;
server_name m.hrttechnology.cn;
location / {
root /home/hc/owner;
}
location /callComponent
{
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://10.206.0.14:8012;
}
location /app
{

      add_header 'Access-Control-Allow-Origin' '*';
      proxy_pass    http://10.206.0.14:8012;
    }

}



4核8G服务器限制内存脚本

!/bin/bash

cd ../MicroCommunity/

cd ../

if [ -d "app" ];then
echo "app 存在";
docker-compose -f app/service-api/docker/docker-compose.yml stop;
docker-compose -f app/service-api/docker/docker-compose.yml rm -f;
docker-compose -f app/service-order/docker/docker-compose.yml stop;
docker-compose -f app/service-order/docker/docker-compose.yml rm -f;
docker-compose -f app/service-community/docker/docker-compose.yml stop;
docker-compose -f app/service-community/docker/docker-compose.yml rm -f;
docker-compose -f app/service-store/docker/docker-compose.yml stop;
docker-compose -f app/service-store/docker/docker-compose.yml rm -f;
docker-compose -f app/service-user/docker/docker-compose.yml stop;
docker-compose -f app/service-user/docker/docker-compose.yml rm -f;
docker-compose -f app/service-front/docker/docker-compose.yml stop;
docker-compose -f app/service-front/docker/docker-compose.yml rm -f;
docker-compose -f app/service-common/docker/docker-compose.yml stop;
docker-compose -f app/service-common/docker/docker-compose.yml rm -f;
docker-compose -f app/service-fee/docker/docker-compose.yml stop;
docker-compose -f app/service-fee/docker/docker-compose.yml rm -f;
docker-compose -f app/service-job/docker/docker-compose.yml stop;
docker-compose -f app/service-job/docker/docker-compose.yml rm -f;
docker-compose -f app/service-report/docker/docker-compose.yml stop;
docker-compose -f app/service-report/docker/docker-compose.yml rm -f;
rm -rf app;
fi

echo "拷贝hc_project 到 allProject";

cp -r MicroCommunity app

cd ./app

echo "模板处理 service-api 服务"

cp -r ../hcConf/service-api/docker service-api/

cp -r ../hcConf/service-api/resources/application.yml service-api/src/main/resources/
cp -r ../hcConf/service-api/resources/application-dev.yml service-api/src/main/resources/
cp -r ../hcConf/service-api/resources/application-prod.yml service-api/src/main/resources/
cp -r ../hcConf/service-api/resources/application-test.yml service-api/src/main/resources/

echo "模板处理 service-eureka 服务"

cp -r ../hcConf/service-eureka/docker service-eureka/

cp -r ../hcConf/service-eureka/resources/application.yml service-eureka/src/main/resources/
cp -r ../hcConf/service-eureka/resources/application-ha.yml service-eureka/src/main/resources/

echo "模板处理 service-order 服务"

cp -r ../hcConf/service-order/docker service-order/

cp -r ../hcConf/service-order/resources/application.yml service-order/src/main/resources/
cp -r ../hcConf/service-order/resources/application-dev.yml service-order/src/main/resources/
cp -r ../hcConf/service-order/resources/application-prod.yml service-order/src/main/resources/
cp -r ../hcConf/service-order/resources/application-test.yml service-order/src/main/resources/
cp -r ../hcConf/service-order/resources/dataSource.yml service-order/src/main/resources/

echo "模板处理 service-community 服务"

cp -r ../hcConf/service-community/docker service-community/

cp -r ../hcConf/service-community/resources/application.yml service-community/src/main/resources/
cp -r ../hcConf/service-community/resources/application-dev.yml service-community/src/main/resources/
cp -r ../hcConf/service-community/resources/application-prod.yml service-community/src/main/resources/
cp -r ../hcConf/service-community/resources/application-test.yml service-community/src/main/resources/
cp -r ../hcConf/service-community/resources/dataSource.yml service-community/src/main/resources/

echo "模板处理 service-store 服务"

cp -r ../hcConf/service-store/docker service-store/

cp -r ../hcConf/service-store/resources/application.yml service-store/src/main/resources/
cp -r ../hcConf/service-store/resources/application-dev.yml service-store/src/main/resources/
cp -r ../hcConf/service-store/resources/application-prod.yml service-store/src/main/resources/
cp -r ../hcConf/service-store/resources/application-test.yml service-store/src/main/resources/
cp -r ../hcConf/service-store/resources/dataSource.yml service-store/src/main/resources/

echo "模板处理 service-user 服务"

cp -r ../hcConf/service-user/docker service-user/

cp -r ../hcConf/service-user/resources/application.yml service-user/src/main/resources/
cp -r ../hcConf/service-user/resources/application-dev.yml service-user/src/main/resources/
cp -r ../hcConf/service-user/resources/application-prod.yml service-user/src/main/resources/
cp -r ../hcConf/service-user/resources/application-test.yml service-user/src/main/resources/
cp -r ../hcConf/service-user/resources/dataSource.yml service-user/src/main/resources/

echo "模板处理 service-common 服务"

cp -r ../hcConf/service-common/docker service-common/

cp -r ../hcConf/service-common/resources/application.yml service-common/src/main/resources/
cp -r ../hcConf/service-common/resources/application-dev.yml service-common/src/main/resources/
cp -r ../hcConf/service-common/resources/application-prod.yml service-common/src/main/resources/
cp -r ../hcConf/service-common/resources/application-test.yml service-common/src/main/resources/
cp -r ../hcConf/service-common/resources/dataSource.yml service-common/src/main/resources/
cp -r ../hcConf/service-common/resources/java110.properties service-common/src/main/resources/

echo "模板处理 service-fee 服务"
cp -r ../hcConf/service-fee/docker service-fee/

cp -r ../hcConf/service-fee/resources/application.yml service-fee/src/main/resources/
cp -r ../hcConf/service-fee/resources/application-dev.yml service-fee/src/main/resources/
cp -r ../hcConf/service-fee/resources/application-prod.yml service-fee/src/main/resources/
cp -r ../hcConf/service-fee/resources/application-test.yml service-fee/src/main/resources/
cp -r ../hcConf/service-fee/resources/dataSource.yml service-fee/src/main/resources/

echo "模板处理 service-front 服务"

cp -r ../hcConf/service-front/docker service-front/

cp -r ../hcConf/service-front/resources/application.yml service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/application-dev.yml service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/application-prod.yml service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/application-test.yml service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/dataSource.yml service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/java110.properties service-front/src/main/resources/
cp -r ../hcConf/service-front/resources/wechatAuth.properties service-front/src/main/resources/

echo "模板处理 service-job 服务"

cp -r ../hcConf/service-job/docker service-job/

cp -r ../hcConf/service-job/resources/application.yml service-job/src/main/resources/
cp -r ../hcConf/service-job/resources/application-dev.yml service-job/src/main/resources/
cp -r ../hcConf/service-job/resources/application-prod.yml service-job/src/main/resources/
cp -r ../hcConf/service-job/resources/application-test.yml service-job/src/main/resources/
cp -r ../hcConf/service-job/resources/dataSource.yml service-job/src/main/resources/

cp -r ../hcConf/service-report/docker service-report/

cp -r ../hcConf/service-report/resources/application.yml service-report/src/main/resources/
cp -r ../hcConf/service-report/resources/application-dev.yml service-report/src/main/resources/
cp -r ../hcConf/service-report/resources/application-prod.yml service-report/src/main/resources/
cp -r ../hcConf/service-report/resources/application-test.yml service-report/src/main/resources/
cp -r ../hcConf/service-report/resources/dataSource.yml service-report/src/main/resources/

mvn clean install -Dmaven.test.skip=true
mvn package -Dmaven.test.skip=true

cd ../app/

nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-eureka/target/service-eureka.jar > ../logs/eureka.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-api/target/service-api.jar > ../logs/api.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-front/target/service-front.jar > ../logs/front.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-order/target/service-order.jar > ../logs/order.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-user/target/service-user.jar > ../logs/user.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-store/target/service-store.jar > ../logs/store.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-community/target/service-community.jar > ../logs/community.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-common/target/service-common.jar > ../logs/common.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-job/target/service-job.jar > ../logs/hardware.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-fee/target/service-fee.jar > ../logs/fee.log $2 2>&1 &
nohup java -jar -Dspring.profiles.active=$1 -Dcache -Xms256m -Xmx256m service-report/target/service-report.jar > ../logs/fee.log $2 2>&1 &



LINUX宝塔环境下部署步骤,含maven编译步骤

https://www.yuque.com/docs/share/d328ebac-c91e-45aa-81b5-5c7930c47f56?# 《LINUX宝塔环境下部署步骤,含maven编译》
浏览器直接访问
目前已经更新结束



HC小区管理系统对接使用指南

说明
HC小区管理系统是一套开源免费商用的小区物业管理系统,目前已经在多家物业多个小区商用,用户反馈良好,HC物联网系统独立于物业系统 而设计的管理门禁,道闸考勤等设备的物联网管理系统,它可以和其他第三方系统对接而独立运行(可以参考HC 物联网系统对接协议 文档对接),不依赖HC小区管理系统

通信流程说明
1、在HC小区管理系统添加小区修改小区时 会通过HC小区管理系统的databus 将数据 同步(或异步)方式同步至HC物联网系统

2、在HC小区管理系统添加设备编辑设备和删除设备也会将设备信息通过databus 的方式同步至HC物联网系统,这里需要注意,在 HC小区管理系统添加设备时需要正确的填写厂家协议,HC物联网系统是根据HC小区管理系统同步的协议去找相应的设备的适配器和 设备或者平台通讯

3、在HC小区管理系统添加业主修改业主删除业主时通过HC小区管理系统的databus将数据同步至HC物联网系统,其中包括用户基本信息 和用户头像信息,具体是按照api.md 协议同步的(此时业主的同步会根据业主的位置同步到 单元门禁,大门门禁)

4、物联网系统收到设备的开门记录时会将记录上报给HC小区管理系统是通过HC 物联网系统对接协议协议中的4.1 开门上报

5、HC物联网系统收到设备心跳信息时也会将心跳时间上报给HC小区管理系统,此时可能设备的时钟和HC小区管理系统的时钟不同步,所以 HC小区管理系统在入库时没有取设备上报时间,而是获取了服务器当前时间

6、当在HC小区管理系统或者业主手机版远程开门时 HC小区管理系统将调用HC物联网系统接口实现远程开门

配置流程
1、首先开启databus,登录HC小区管理系统开发这账户(dev/密码您自己设置的),编码映射中找到域为DOMAIN.COMMON,键为DATABUS_SWITCH 的记录,点击修改将其值修改为ON,点击缓存管理刷新所有缓存

2、打开编码映射菜单下的databus 页面是否存在以下适配器,如果不存在 请添加

名称 业务类型 适配器
业主解绑房屋同步IOT 111100050001 ownerUnBindRoomToIotAdapt
业主绑定房屋同步IOT 111100030001 ownerBindRoomToIotAdapt
删除业主同步IOT 110100050001 deleteOwnerToIotAdapt
修改业主同步IOT 110100040001 editOwnerToIotAdapt
添加业主同步IOT 110100030001 addOwnerToIotAdapt
删除设备同步IOT 200200050001 deleteMachineToIotAdapt
修改设备同步IOT 200200040001 modifyMachineToIotAdapt
保存设备同步IOT 200200030001 addMachineToIotAdapt
删除小区同步IOT 500100050001 deleteCommunityToIotAdapt
修改小区同步IOT 500100040001 editCommunityToIotAdapt
添加小区同步IOT 500100030001 addCommunityToIotAdapt
点击缓存管理刷新所有缓存

3、在HC物联网系统库中 添加一条应用记录(当然测试您可以直接用HC测试这个应用)

INSERT INTO c_app(app_id, app_secret, app_name)
VALUES ('e86a6a373c354927bea5fd21a0bec617', 'ead9a2f67f96e2b8ed2fe38cc9709463', 'HC测试');
app_id 和 app_secret 请自行生成 推荐为uuId

4、在HC小区管理系统编码映射中根据域为IOT查询 到APP_ID、APP_SECRET和IOT_URL,将APP_ID 和APP_SECRET 的值 修改为HC物联网系统中app_id 和 app_secret的值,IOT_URL请填写为物联网系统地址如:http://proxy.homecommunity.cn:9006/, 点击缓存管理刷新所有缓存

5、在HC物联网系统中配置开门记录上报地址 心跳地址等(当然测试可以直接用HC测试这个应用的配置,只需要将域名修改即可)

INSERT INTO c_app_attr (attr_id, app_id, spec_cd, value)
VALUES ('1', 'e86a6a373c354927bea5fd21a0bec617', '3001001', 'https://api.demo.winqi.cn/api/machine/openDoorLog');
INSERT INTO c_app_attr (attr_id, app_id, spec_cd, value)
VALUES ('2', 'e86a6a373c354927bea5fd21a0bec617', '3002001', 'https://api.demo.winqi.cn/api/machine/cmdResult');
INSERT INTO c_app_attr (attr_id, app_id, spec_cd, value)
VALUES ('3', 'e86a6a373c354927bea5fd21a0bec617', '3003001', '992020051967020024');
INSERT INTO c_app_attr (attr_id, app_id, spec_cd, value)
VALUES ('4', 'e86a6a373c354927bea5fd21a0bec617', '3004001', 'g3kE9ggkM4Jqrs576rJS0CYg7dbtMXPT');
INSERT INTO c_app_attr (attr_id, app_id, spec_cd, value)
VALUES ('5', 'e86a6a373c354927bea5fd21a0bec617', '3005001', 'https://api.demo.winqi.cn/api/machine/heartbeat');
spec_cd 说明:

3001001 开门记录上报

3002001 设备执行命令结果上报(当设备是mqtt方式时,设备同步数据结果告知为异步,需要通过此地址上报HC小区管理系统)

3003001 HC小区管理系统中的应用ID,在开发者账户应用中查找HC小区物联网平台应用ID(一般不需要修改)

3004001 HC小区管理系统中的应用秘钥,在开发者账户应用中查找HC小区物联网平台应用秘钥

3005001 设备心跳上报HC小区管理系统地址

以上地址的就该只需要将https://api.demo.winqi.cn替换为HC小区管理系统api服务真实的url即可。



执行restart_hc.sh失败后,做了一个重启docker的动作

就是执行restart_hc.sh失败后,我做了一个重启docker的动作:pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d
systemctl restart docker

然后再执行restart_hc.sh,不知道对大家有没有帮助



HC系统上线时可能会不小心将资产倒错了批量清

delete from building_unit where floor_id in (
select floor_id from f_floor a where a.community_id = '702020111833740016'
);
delete from f_floor where community_id = '702020111833740016';
delete from building_room where community_id = '702020111833740016';
delete from building_owner where community_id = '702020111833740016';
delete from pay_fee where community_id = '702020111833740016';
delete from parking_area where community_id = '702020111833740016'
delete from parking_space where community_id = '702020111833740016'
delete from owner_car where community_id = '2020122513890012';
702020072870030001 可以在我的小区里小区编码