Commit 32777e56 authored by “yiyousong”'s avatar “yiyousong”
parents 6ba104fa c6b8b131
...@@ -360,7 +360,7 @@ INSERT INTO `mortals_xhx_product` VALUES (null, '窗口屏', 'ckp', '窗口屏', ...@@ -360,7 +360,7 @@ INSERT INTO `mortals_xhx_product` VALUES (null, '窗口屏', 'ckp', '窗口屏',
INSERT INTO `mortals_xhx_product` VALUES (null, '呼叫器', 'hjq', '呼叫器', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '呼叫器', 'hjq', '呼叫器', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '集中显示屏', 'jzxsp', '集中显示屏', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '集中显示屏', 'jzxsp', '集中显示屏', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '导视机', 'dsj', '导视机', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '导视机', 'dsj', '导视机', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '评级器', 'pjq', '评级器', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '评价器', 'pjq', '评价器', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '自助服务终端', 'zzfwzd', '自助服务终端', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '自助服务终端', 'zzfwzd', '自助服务终端', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '填单机', 'tdj', '填单机', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '填单机', 'tdj', '填单机', 1, now(), NULL, NULL);
INSERT INTO `mortals_xhx_product` VALUES (null, '样表机', 'ybj', '样表机', 1, now(), NULL, NULL); INSERT INTO `mortals_xhx_product` VALUES (null, '样表机', 'ybj', '样表机', 1, now(), NULL, NULL);
......
...@@ -128,5 +128,7 @@ public final class Constant { ...@@ -128,5 +128,7 @@ public final class Constant {
*/ */
public final static String PARAM_SERVER_HTTP_URL = "server_http_url"; public final static String PARAM_SERVER_HTTP_URL = "server_http_url";
public final static String CUSTAPP_ROOT_PATH = "app";
} }
...@@ -23,5 +23,9 @@ public class AppVo extends BaseEntityLong { ...@@ -23,5 +23,9 @@ public class AppVo extends BaseEntityLong {
private List<Long> siteIdList; private List<Long> siteIdList;
private List <Long> idList; private List <Long> idList;
/**
* 自主应用访问地址
*/
private String custUrl;
} }
\ No newline at end of file
package com.mortals.xhx.module.app.service.impl; package com.mortals.xhx.module.app.service.impl;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil; import cn.hutool.core.util.ZipUtil;
...@@ -36,6 +37,8 @@ import java.io.File; ...@@ -36,6 +37,8 @@ import java.io.File;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
/** /**
* AppService * AppService
* 自助终端应用 service实现 * 自助终端应用 service实现
...@@ -78,13 +81,30 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -78,13 +81,30 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} }
} }
} }
//统计站点 //统计站点
list.forEach(item -> { list.forEach(item -> {
List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context); List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context);
item.setApplianceSiteScope(appEntityList.size()); item.setApplianceSiteScope(appEntityList.size());
item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList())); item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
//构建访问地址
SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString());
if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
item.setCustUrl(UrlBuilder.of(domainUrl)
.addPath(CUSTAPP_ROOT_PATH)
.addPath(siteEntity.getSiteCode())
.addPath(item.getAppCode())
.addPath(item.getVersion().toString())
.toString());
} else {
item.setCustUrl("");
}
}); });
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
} }
......
package com.mortals.xhx.module.app.web; package com.mortals.xhx.module.app.web;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.ZipUtil; import cn.hutool.core.util.ZipUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -8,6 +10,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; ...@@ -8,6 +10,7 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.AppTypeEnum; import com.mortals.xhx.common.code.AppTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.app.model.AppEntity; import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery; import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.service.AppService; import com.mortals.xhx.module.app.service.AppService;
...@@ -25,6 +28,8 @@ import java.util.List; ...@@ -25,6 +28,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
/** /**
* 自助终端应用 * 自助终端应用
* *
...@@ -60,6 +65,22 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -60,6 +65,22 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
List<AppEntity> appEntityList = this.service.find(new AppQuery().appCode(entity.getAppCode()), context); List<AppEntity> appEntityList = this.service.find(new AppQuery().appCode(entity.getAppCode()), context);
entity.setApplianceSiteScope(appEntityList.size()); entity.setApplianceSiteScope(appEntityList.size());
entity.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList())); entity.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
SiteEntity siteEntity = siteService.getCache(entity.getSiteId().toString());
if(!ObjectUtils.isEmpty(siteEntity)){
//请求地址 http://domian/app/siteCode/appcode/html
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
entity.setCustUrl(UrlBuilder.of(domainUrl)
.addPath(CUSTAPP_ROOT_PATH)
.addPath(siteEntity.getSiteCode())
.addPath(entity.getAppCode())
.addPath(entity.getVersion().toString())
.toString());
}else{
entity.setCustUrl("");
}
return super.infoAfter(id, model, entity, context); return super.infoAfter(id, model, entity, context);
} }
...@@ -131,6 +152,11 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -131,6 +152,11 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
} }
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
/** /**
* 自助终端应用版本历史 * 自助终端应用版本历史
...@@ -130,7 +131,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV ...@@ -130,7 +131,7 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
//请求地址 http://domian/app/siteCode/appcode/html //请求地址 http://domian/app/siteCode/appcode/html
String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078"); String domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
rest.setData(UrlBuilder.of(domainUrl) rest.setData(UrlBuilder.of(domainUrl)
.addPath("app") .addPath(CUSTAPP_ROOT_PATH)
.addPath(siteEntity.getSiteCode()) .addPath(siteEntity.getSiteCode())
.addPath(appEntity.getAppCode()) .addPath(appEntity.getAppCode())
.addPath(appEntity.getVersion().toString()) .addPath(appEntity.getVersion().toString())
......
...@@ -1485,7 +1485,7 @@ public class MatterEntity extends MatterVo { ...@@ -1485,7 +1485,7 @@ public class MatterEntity extends MatterVo {
public void initAttrValue(){ public void initAttrValue(){
this.siteId = null; this.siteId = -1L;
this.tid = null; this.tid = null;
...@@ -1503,7 +1503,7 @@ public class MatterEntity extends MatterVo { ...@@ -1503,7 +1503,7 @@ public class MatterEntity extends MatterVo {
this.deptCode = ""; this.deptCode = "";
this.deptName = null; this.deptName = "";
this.powerCode = null; this.powerCode = null;
...@@ -1627,12 +1627,12 @@ public class MatterEntity extends MatterVo { ...@@ -1627,12 +1627,12 @@ public class MatterEntity extends MatterVo {
this.superviseShow = null; this.superviseShow = null;
this.sort = null; this.sort = 0;
this.source = 1; this.source = 1;
this.evaluationUrl = null; this.evaluationUrl = "";
this.netApplyUrl = null; this.netApplyUrl = "";
} }
} }
\ No newline at end of file
...@@ -43,6 +43,7 @@ MYSQL_HOST="127.0.0.1" ...@@ -43,6 +43,7 @@ MYSQL_HOST="127.0.0.1"
MYSQL_PORT="3306" MYSQL_PORT="3306"
MYSQL_USER="root" MYSQL_USER="root"
MYSQL_PASSWORD="xhx@2022" MYSQL_PASSWORD="xhx@2022"
MYSQL_SERVICE="${SERVICE_PATH}/mysql.service"
#rabbitmq #rabbitmq
RABBITMQ="rabbitmq" RABBITMQ="rabbitmq"
...@@ -192,19 +193,20 @@ setup_redis() { ...@@ -192,19 +193,20 @@ setup_redis() {
echo "notify-keyspace-events Ex" >>${REDIS_EXECPATH}/redis.conf echo "notify-keyspace-events Ex" >>${REDIS_EXECPATH}/redis.conf
echo "requirepass ${REDIS_PASSWORD}" >>${REDIS_EXECPATH}/redis.conf echo "requirepass ${REDIS_PASSWORD}" >>${REDIS_EXECPATH}/redis.conf
echo "[Unit] echo "
Description=${REDIS} [Unit]
After=network.target Description=${REDIS}
After=network.target
[Service] [Service]
Type=forking Type=forking
ExecStart=${REDIS_EXECPATH}/bin/redis-server ${REDIS_EXECPATH}/redis.conf ExecStart=${REDIS_EXECPATH}/bin/redis-server ${REDIS_EXECPATH}/redis.conf
ExecReload=${REDIS_EXECPATH}/bin/redis-server -s reload ExecReload=${REDIS_EXECPATH}/bin/redis-server -s reload
ExecStop=${REDIS_EXECPATH}/bin/redis-server -s stop ExecStop=${REDIS_EXECPATH}/bin/redis-server -s stop
PrivateTmp=true PrivateTmp=true
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
" >${REDIS_SERVICE} " >${REDIS_SERVICE}
systemctl enable redis systemctl enable redis
...@@ -242,7 +244,8 @@ setup_mysql() { ...@@ -242,7 +244,8 @@ setup_mysql() {
chown mysql:mysql mysql-files chown mysql:mysql mysql-files
chmod 750 mysql-file chmod 750 mysql-file
echo "[mysqld] echo "
[mysqld]
datadir=${MYSQL_DATA_PATH} datadir=${MYSQL_DATA_PATH}
socket=/tmp/mysql.sock socket=/tmp/mysql.sock
port = ${MYSQL_PORT} port = ${MYSQL_PORT}
...@@ -269,15 +272,41 @@ socket=/tmp/mysql.sock ...@@ -269,15 +272,41 @@ socket=/tmp/mysql.sock
#bin/mysqld --initialize-insecure --user=mysql --datadir=${MYSQL_DATA_PATH} --basedir=${MYSQL_EXECPATH} --socket=/tmp/mysql.sock #bin/mysqld --initialize-insecure --user=mysql --datadir=${MYSQL_DATA_PATH} --basedir=${MYSQL_EXECPATH} --socket=/tmp/mysql.sock
#创建软连接 #创建软连接
rm -m /etc/init.d/mysql
rm -m /usr/bin/mysql
ln -s ${MYSQL_EXECPATH}/support-files/mysql.server /etc/init.d/mysql ln -s ${MYSQL_EXECPATH}/support-files/mysql.server /etc/init.d/mysql
ln -s ${MYSQL_EXECPATH}/bin/mysql /usr/bin/mysql ln -s ${MYSQL_EXECPATH}/bin/mysql /usr/bin/mysql
export PATH=$PATH:${MYSQL_EXECPATH}/bin # export PATH=$PATH:${MYSQL_EXECPATH}/bin
source /etc/profile # source /etc/profile
service mysql restart # service mysql restart
mysql -uroot -p <${BASEDIR}/soft/${MYSQL}/user.sql # mysql -uroot -p123 <${BASEDIR}/soft/${MYSQL}/user.sql
sed -i "s/skip-grant-tables/#skip-grant-tables/g" ${MYSQL_CONF_PATH} # sed -i "s/skip-grant-tables/#skip-grant-tables/g" ${MYSQL_CONF_PATH}
service mysql restart #service mysql restart
echo"
[Unit]
Description=MySQL Server
After=network.target
After=syslog.target
[Service]
User=mysql
Group=mysql
Type=forking
PermissionsStartOnly=true
ExecStart= /etc/init.d/mysql start
ExecStop= /etc/init.d/mysql stop
ExecReload= /etc/init.d/mysql restart
LimitNOFILE = 5000
[Install]
WantedBy=multi-user.target
">${MYSQL_CONF_PATH}
systemctl enable mysql
systemctl daemon-reload
systemctl restart mysql
mysql -uroot -p123 <${BASEDIR}/soft/${MYSQL}/user.sql
sed -i "s/skip-grant-tables/#skip-grant-tables/g" ${MYSQL_CONF_PATH}
systemctl restart mysql
} }
setup_rabbitmq() { setup_rabbitmq() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment