Commit ad2c8b6a authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	sst-manager/pom.xml
parents f1c92e8e 8ae42570
package com.mortals.xhx.common.pdu.app;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
@Data
public class AppCategoryPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 站点Id
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 分类编码
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 排序字段
*/
private Integer sort;
/**
* 封面
*/
private String cover;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof AppCategoryPdu) {
AppCategoryPdu tmp = (AppCategoryPdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = -1L;
this.siteName = "";
this.categoryCode = "";
this.categoryName = "";
this.sort = 0;
this.cover = "";
this.remark = "";
}
}
...@@ -200,6 +200,11 @@ public class DevicePdu extends BaseEntityLong { ...@@ -200,6 +200,11 @@ public class DevicePdu extends BaseEntityLong {
* 是否显示小程序二维码(0.否,1.是) * 是否显示小程序二维码(0.否,1.是)
*/ */
private Integer showWechatQrCode; private Integer showWechatQrCode;
/**
* 所属机构
*/
private String orgName;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -310,5 +315,4 @@ public class DevicePdu extends BaseEntityLong { ...@@ -310,5 +315,4 @@ public class DevicePdu extends BaseEntityLong {
this.showWechatQrCode = 1; this.showWechatQrCode = 1;
} }
} }
\ No newline at end of file
...@@ -27,6 +27,7 @@ public class SiteTreeSelectVO implements Serializable { ...@@ -27,6 +27,7 @@ public class SiteTreeSelectVO implements Serializable {
* 区域编码 * 区域编码
*/ */
private String areaCode; private String areaCode;
private String areaName;
/** /**
* 是否叶子节点 * 是否叶子节点
*/ */
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.feign.app; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.feign.app;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.app.AppCategoryPdu;
import com.mortals.xhx.common.pdu.app.AppPdu; import com.mortals.xhx.common.pdu.app.AppPdu;
import com.mortals.xhx.common.pdu.app.DeviceBlackappPdu; import com.mortals.xhx.common.pdu.app.DeviceBlackappPdu;
import com.mortals.xhx.common.pdu.device.DevicePdu; import com.mortals.xhx.common.pdu.device.DevicePdu;
...@@ -48,6 +49,15 @@ public interface IAppFeign extends IFeign { ...@@ -48,6 +49,15 @@ public interface IAppFeign extends IFeign {
*/ */
@PostMapping(value = "/device/blackapp/list") @PostMapping(value = "/device/blackapp/list")
Rest<RespData<List<DeviceBlackappPdu>>> blackappList(@RequestBody DeviceBlackappPdu appPdu); Rest<RespData<List<DeviceBlackappPdu>>> blackappList(@RequestBody DeviceBlackappPdu appPdu);
/**
* 自助终端应用分类
*
* @param appPdu
* @return
*/
@PostMapping(value = "/app/category/list")
Rest<RespData<List<AppCategoryPdu>>> categoryList(@RequestBody AppCategoryPdu appPdu);
} }
@Slf4j @Slf4j
...@@ -72,6 +82,11 @@ class AppFeignFallbackFactory implements FallbackFactory<IAppFeign> { ...@@ -72,6 +82,11 @@ class AppFeignFallbackFactory implements FallbackFactory<IAppFeign> {
public Rest<RespData<List<DeviceBlackappPdu>>> blackappList(DeviceBlackappPdu appPdu) { public Rest<RespData<List<DeviceBlackappPdu>>> blackappList(DeviceBlackappPdu appPdu) {
return Rest.fail("暂时无法获取设备应用黑名单,请稍后再试!"); return Rest.fail("暂时无法获取设备应用黑名单,请稍后再试!");
} }
@Override
public Rest<RespData<List<AppCategoryPdu>>> categoryList(AppCategoryPdu appPdu) {
return Rest.fail("暂时无法获取自助终端应用分类,请稍后再试!");
}
}; };
} }
} }
\ No newline at end of file
package com.mortals.xhx.feign.device; package com.mortals.xhx.feign.device;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.device.DeviceNotifyPdu; import com.mortals.xhx.common.pdu.device.DeviceNotifyPdu;
...@@ -8,8 +9,10 @@ import com.mortals.xhx.feign.IFeign; ...@@ -8,8 +9,10 @@ import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
/** /**
...@@ -59,6 +62,15 @@ public interface IDeviceFeign extends IFeign { ...@@ -59,6 +62,15 @@ public interface IDeviceFeign extends IFeign {
@PostMapping(value = "/device/save") @PostMapping(value = "/device/save")
Rest<RespData<DevicePdu>> save(@RequestBody DevicePdu devicePdu,@RequestHeader("Authorization") String authorization); Rest<RespData<DevicePdu>> save(@RequestBody DevicePdu devicePdu,@RequestHeader("Authorization") String authorization);
/**
* 设备启用停用
*
* @param devicePdu
* @return
*/
@PostMapping(value = "/device/enable")
String deviceEnable(@RequestBody DevicePdu devicePdu,@RequestHeader("Authorization") String authorization);
/** /**
* 接收第三方平台下发设备消息 * 接收第三方平台下发设备消息
* @param deviceNotifyPdu * @param deviceNotifyPdu
...@@ -66,6 +78,9 @@ public interface IDeviceFeign extends IFeign { ...@@ -66,6 +78,9 @@ public interface IDeviceFeign extends IFeign {
*/ */
@PostMapping(value = "/notify/downMsg") @PostMapping(value = "/notify/downMsg")
Rest<String> downMsg(@RequestBody DeviceNotifyPdu deviceNotifyPdu); Rest<String> downMsg(@RequestBody DeviceNotifyPdu deviceNotifyPdu);
@PostMapping(value = "/device/importData",consumes= MediaType.MULTIPART_FORM_DATA_VALUE)
String importData(@RequestPart MultipartFile file,@RequestHeader("Authorization") String authorization,@RequestParam("siteId") Long siteId);
} }
...@@ -95,10 +110,27 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> { ...@@ -95,10 +110,27 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
return Rest.fail("暂时无法保存设备,请稍后再试!"); return Rest.fail("暂时无法保存设备,请稍后再试!");
} }
@Override
public String deviceEnable(DevicePdu devicePdu, String authorization) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", -1);
jsonObject.put("msg", "暂时无法启用停用设备,请稍后再试!");
return jsonObject.toJSONString();
}
@Override @Override
public Rest<String> downMsg(DeviceNotifyPdu deviceNotifyPdu) { public Rest<String> downMsg(DeviceNotifyPdu deviceNotifyPdu) {
return Rest.fail("暂时无法接收第三方平台下发设备消息,请稍后再试!"); return Rest.fail("暂时无法接收第三方平台下发设备消息,请稍后再试!");
} }
@Override
public String importData(MultipartFile file, String authorization,Long siteId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", -1);
jsonObject.put("msg", "暂时无法导入设备,请稍后再试!");
return jsonObject.toJSONString();
}
}; };
} }
} }
......
...@@ -236,18 +236,49 @@ PRIMARY KEY (`id`) ...@@ -236,18 +236,49 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_xhx_converge_apps`; DROP TABLE IF EXISTS `mortals_xhx_converge_apps`;
CREATE TABLE mortals_xhx_converge_apps( CREATE TABLE mortals_xhx_converge_apps(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`siteId` bigint(20) COMMENT '站点id',
`equipmentId` bigint(20) COMMENT '设备ID', `equipmentId` bigint(20) COMMENT '设备ID',
`appEname` varchar(100) COMMENT '应用标识,具有唯一性', `appEname` varchar(100) COMMENT '应用标识,具有唯一性',
`appName` varchar(100) COMMENT '应用名称', `appName` varchar(100) COMMENT '应用名称',
`appSimpleName` varchar(100) COMMENT '应用简称', `appSimpleName` varchar(100) COMMENT '应用简称',
`provider` varchar(100) COMMENT '应用提供方', `provider` varchar(100) COMMENT '应用提供方',
`origin` char(1) COMMENT '应用来源', `origin` char(1) COMMENT '应用来源',
`pv` int(8) COMMENT '应用访问数', `totalPv` int(8) COMMENT '应用访问数',
`uv` int(8) COMMENT '应用访客数', `totalUv` int(8) COMMENT '应用访客数',
`opr` char(1) COMMENT '操作类型', `opr` char(1) COMMENT '操作类型',
`siteId` bigint(20) COMMENT '站点id', `statYearMonth` varchar(100) COMMENT '统计月份,格式yyyy-MM-dd',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备应用'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备应用';
INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('省平台数据汇聚任务', 'provinceConvergeTask', '0', 'ProvinceConvergeTask', NULL, NULL, '1', '0', '23:30', NULL, NULL, NULL, '0', NOW(), '1', '系统管理员'); INSERT INTO `mortals_xhx_task` (`name`, `taskKey`, `status`, `excuteService`, `excuteParam`, `excuteHost`, `excuteStrategy`, `excuteDate`, `excuteTime`, `remark`, `lastExcuteHost`, `lastExcuteTime`, `interimExcuteStatus`, `createTime`, `createUserId`, `createUserName`) VALUES ('省平台数据汇聚任务', 'provinceConvergeTask', '0', 'ProvinceConvergeTask', NULL, NULL, '1', '0', '23:30', NULL, NULL, NULL, '0', NOW(), '1', '系统管理员');
DROP TABLE IF EXISTS `mortals_xhx_converge_apps_access`;
CREATE TABLE `mortals_xhx_converge_apps_access` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号,主键,自增长',
`siteId` bigint(20) DEFAULT NULL COMMENT '站点id',
`applicationId` varchar(128) DEFAULT NULL COMMENT '应用ID',
`applicationName` varchar(128) DEFAULT NULL COMMENT '应用名称',
`startTime` datetime DEFAULT NULL COMMENT '应用打开时间',
`endTime` datetime DEFAULT NULL COMMENT '应用关闭时间',
`userId` varchar(128) DEFAULT NULL COMMENT '用户ID',
`userName` varchar(128) DEFAULT NULL COMMENT '用户名称',
`channelId` varchar(128) DEFAULT NULL COMMENT '渠道ID',
`channelName` varchar(128) DEFAULT NULL COMMENT '渠道名称',
`location` varchar(128) DEFAULT NULL COMMENT '地域',
`clientName` varchar(128) DEFAULT NULL COMMENT '客户端名称',
`version` varchar(128) DEFAULT NULL COMMENT '客户端版本号',
`ecode` varchar(128) DEFAULT NULL COMMENT '设备唯一标识',
`appSimpleName` varchar(128) DEFAULT NULL COMMENT '应用简称',
`provider` varchar(128) DEFAULT NULL COMMENT '应用提供方',
`origin` varchar(1) DEFAULT NULL COMMENT '应用来源',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='应用访问';
ALTER TABLE `mortals_xhx_sst_apps_desk` ADD COLUMN `clickSum` int(8) DEFAULT '0' COMMENT '应用点击次数';
ALTER TABLE `mortals_xhx_sst_apps` ADD COLUMN `clickSum` int(8) DEFAULT '0' COMMENT '应用点击次数';
ALTER TABLE `mortals_xhx_sst_agreement` ADD COLUMN `protocolType` tinyint(2) DEFAULT '1' COMMENT '协议类型' AFTER `name`;
INSERT INTO `mortals_xhx_param` (`name`, `firstOrganize`, `secondOrganize`, `paramKey`, `paramValue`, `validStatus`, `modStatus`, `displayType`, `remark`, `createTime`, `createUserId`, `createUserName`) VALUES ('协议类型', 'SstAgreement', 'protocolType', '1', '注册协议', '1', '4', '0', NULL, NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` (`name`, `firstOrganize`, `secondOrganize`, `paramKey`, `paramValue`, `validStatus`, `modStatus`, `displayType`, `remark`, `createTime`, `createUserId`, `createUserName`) VALUES ('协议类型', 'SstAgreement', 'protocolType', '2', '申报协议', '1', '4', '0', NULL, NULL, NULL, NULL);
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
<profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers> <profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host> <profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port> <profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
...@@ -67,14 +70,11 @@ ...@@ -67,14 +70,11 @@
<profiles.kafka.brokers>127.0.0.1:9092</profiles.kafka.brokers> <profiles.kafka.brokers>127.0.0.1:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host> <profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port> <profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>info</profiles.log.level> <profiles.log.level>info</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/mortals/app/logs</profiles.log.path>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
</properties> </properties>
</profile> </profile>
...@@ -98,24 +98,6 @@ ...@@ -98,24 +98,6 @@
<profiles.filepath>/mortals/app/data</profiles.filepath> <profiles.filepath>/mortals/app/data</profiles.filepath>
</properties> </properties>
</profile> </profile>
<profile>
<id>sngx</id>
<properties>
<profiles.active>sngx</profiles.active>
<profiles.server.port>19211</profiles.server.port>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>127.0.0.1:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>info</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
</properties>
</profile>
</profiles> </profiles>
<dependencies> <dependencies>
......
...@@ -3,13 +3,21 @@ package com.mortals.xhx.daemon.task; ...@@ -3,13 +3,21 @@ package com.mortals.xhx.daemon.task;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService; import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
import com.mortals.xhx.module.converge.service.ConvergeSiteService; import com.mortals.xhx.module.converge.service.ConvergeSiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
/** /**
* 省平台数据汇聚任务 * 省平台数据汇聚任务
*/ */
...@@ -21,16 +29,38 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService { ...@@ -21,16 +29,38 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
private ConvergeSiteService convergeSiteService; private ConvergeSiteService convergeSiteService;
@Autowired @Autowired
private ConvergeDeviceService convergeDeviceService; private ConvergeDeviceService convergeDeviceService;
@Autowired
private ConvergeAppsService convergeAppsService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.info("开始执行省平台数据汇聚任务..."); log.info("开始执行省平台数据汇聚任务...");
try { try {
convergeSiteService.doConvergeSite(); convergeSiteService.doConvergeSite();
}catch (Exception e){
log.error("汇聚网点数据执行出错",e);
}
try {
convergeDeviceService.doConvergeDevice(); convergeDeviceService.doConvergeDevice();
}catch (Exception e){ }catch (Exception e){
log.error("数据汇聚任务执行出错",e); log.error("汇聚设备数据出错",e);
}
try {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
Map<String,String> condition = new HashMap<>();
condition.put("startTime",startTime);
condition.put("endTime",endTime);
convergeAppsService.doConvergeApps(condition);
}catch (Exception e){
log.error("汇聚应用数据出错",e);
} }
log.info("省平台数据汇聚任务执行完成"); log.info("省平台数据汇聚任务执行完成");
} }
...@@ -39,4 +69,5 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService { ...@@ -39,4 +69,5 @@ public class ProvinceConvergeTaskImpl implements ITaskExcuteService {
public void stopTask(ITask task) throws AppException { public void stopTask(ITask task) throws AppException {
} }
} }
...@@ -32,4 +32,8 @@ public class AppsInfoVo extends BaseEntityLong { ...@@ -32,4 +32,8 @@ public class AppsInfoVo extends BaseEntityLong {
* 应用主题id * 应用主题id
*/ */
private String appThemeName; private String appThemeName;
/**
* 应用点击次数
*/
private Integer clickSum;
} }
\ No newline at end of file
...@@ -62,9 +62,10 @@ public class AppsInfoServiceImpl extends AbstractCRUDServiceImpl<AppsInfoDao, Ap ...@@ -62,9 +62,10 @@ public class AppsInfoServiceImpl extends AbstractCRUDServiceImpl<AppsInfoDao, Ap
public List<AppsInfoEntity> find(AppsInfoEntity entity) throws AppException { public List<AppsInfoEntity> find(AppsInfoEntity entity) throws AppException {
AppPdu appPdu = new AppPdu(); AppPdu appPdu = new AppPdu();
appPdu.setSiteId(entity.getSiteId()); appPdu.setSiteId(entity.getSiteId());
appPdu.setSize(999); appPdu.setSize(-1);
appPdu.setType(1); appPdu.setType(1); //类型(1.终端应用,2.移动端应用)
appPdu.setShelves(1); appPdu.setShelves(1); //是否上架(0.下架,1.上架)
appPdu.setAppName(entity.getName());
Rest<RespData<List<AppPdu>>> rest = appFeign.list(appPdu); Rest<RespData<List<AppPdu>>> rest = appFeign.list(appPdu);
if (rest.getCode().equals(YesNoEnum.YES.getValue())) { if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
List<AppsInfoEntity> appsInfoEntities = new ArrayList<>(); List<AppsInfoEntity> appsInfoEntities = new ArrayList<>();
...@@ -124,6 +125,7 @@ public class AppsInfoServiceImpl extends AbstractCRUDServiceImpl<AppsInfoDao, Ap ...@@ -124,6 +125,7 @@ public class AppsInfoServiceImpl extends AbstractCRUDServiceImpl<AppsInfoDao, Ap
appsInfoEntity.setServiceApi(pdu.getServiceApi()); appsInfoEntity.setServiceApi(pdu.getServiceApi());
appsInfoEntity.setCustUrl(pdu.getCustUrl()); appsInfoEntity.setCustUrl(pdu.getCustUrl());
appsInfoEntity.setAppThemeName(pdu.getAppThemeName()); appsInfoEntity.setAppThemeName(pdu.getAppThemeName());
appsInfoEntity.setCreateTime(pdu.getCreateTime());
return appsInfoEntity; return appsInfoEntity;
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.converge.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.model.vo.AppsAccessVo;
import java.util.List;
import java.util.Map;
/**
* 应用访问Dao
* 应用访问 DAO接口
*
* @author zxfei
* @date 2023-07-03
*/
public interface ConvergeAppsAccessDao extends ICRUDDao<ConvergeAppsAccessEntity,Long>{
/**
* 应用浏览量PV统计
* @return
*/
List<AppsAccessVo> getAppsAccessPv(Map<String,String> condition);
/**
* 应用浏览量UV统计
* @return
*/
List<AppsAccessVo> getAppsAccessUv(Map<String,String> condition);
}
package com.mortals.xhx.module.converge.dao.ibatis;
import com.mortals.xhx.module.converge.model.vo.AppsAccessVo;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.converge.dao.ConvergeAppsAccessDao;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
import java.util.Map;
/**
* 应用访问DaoImpl DAO接口
*
* @author zxfei
* @date 2023-07-03
*/
@Repository("convergeAppsAccessDao")
public class ConvergeAppsAccessDaoImpl extends BaseCRUDDaoMybatis<ConvergeAppsAccessEntity,Long> implements ConvergeAppsAccessDao {
@Override
public List<AppsAccessVo> getAppsAccessPv(Map<String,String> condition) {
return this.getSqlSession().selectList(this.getSqlId("getAppsAccessPv"),condition);
}
@Override
public List<AppsAccessVo> getAppsAccessUv(Map<String,String> condition) {
return this.getSqlSession().selectList(this.getSqlId("getAppsAccessUv"),condition);
}
}
package com.mortals.xhx.module.converge.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.converge.model.vo.ConvergeAppsAccessVo;
import lombok.Data;
/**
* 应用访问实体对象
*
* @author zxfei
* @date 2023-07-04
*/
@Data
public class ConvergeAppsAccessEntity extends ConvergeAppsAccessVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/**
* 应用ID
*/
private String applicationId;
/**
* 应用名称
*/
private String applicationName;
/**
* 应用打开时间
*/
private Date startTime;
/**
* 应用关闭时间
*/
private Date endTime;
/**
* 用户ID
*/
private String userId;
/**
* 用户名称
*/
private String userName;
/**
* 渠道ID
*/
private String channelId;
/**
* 渠道名称
*/
private String channelName;
/**
* 地域
*/
private String location;
/**
* 客户端名称
*/
private String clientName;
/**
* 客户端版本号
*/
private String version;
/**
* 设备唯一标识
*/
private String ecode;
/**
* 应用简称
*/
private String appSimpleName;
/**
* 应用提供方
*/
private String provider;
/**
* 应用来源
*/
private String origin;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ConvergeAppsAccessEntity) {
ConvergeAppsAccessEntity tmp = (ConvergeAppsAccessEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.siteId = -1L;
this.applicationId = "";
this.applicationName = "";
this.startTime = null;
this.endTime = null;
this.userId = "";
this.userName = "";
this.channelId = "";
this.channelName = "";
this.location = "";
this.clientName = "";
this.version = "";
this.ecode = "";
this.appSimpleName = "";
this.provider = "";
this.origin = "";
}
}
\ No newline at end of file
...@@ -10,12 +10,16 @@ import lombok.Data; ...@@ -10,12 +10,16 @@ import lombok.Data;
* 设备应用实体对象 * 设备应用实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-06-12 * @date 2023-07-06
*/ */
@Data @Data
public class ConvergeAppsEntity extends ConvergeAppsVo { public class ConvergeAppsEntity extends ConvergeAppsVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/** /**
* 设备ID * 设备ID
*/ */
...@@ -43,19 +47,19 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -43,19 +47,19 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
/** /**
* 应用访问数 * 应用访问数
*/ */
private Integer pv; private Integer totalPv;
/** /**
* 应用访客数 * 应用访客数
*/ */
private Integer uv; private Integer totalUv;
/** /**
* 操作类型 * 操作类型
*/ */
private String opr; private String opr;
/** /**
* 站点id * 统计月份,格式yyyy-MM-dd
*/ */
private Long siteId; private String statYearMonth;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -74,6 +78,8 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -74,6 +78,8 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
public void initAttrValue(){ public void initAttrValue(){
this.siteId = -1L;
this.equipmentId = -1L; this.equipmentId = -1L;
this.appEname = ""; this.appEname = "";
...@@ -86,12 +92,12 @@ public class ConvergeAppsEntity extends ConvergeAppsVo { ...@@ -86,12 +92,12 @@ public class ConvergeAppsEntity extends ConvergeAppsVo {
this.origin = ""; this.origin = "";
this.pv = -1; this.totalPv = -1;
this.uv = -1; this.totalUv = -1;
this.opr = ""; this.opr = "";
this.siteId = -1L; this.statYearMonth = "";
} }
} }
\ No newline at end of file
...@@ -27,11 +27,15 @@ public class AppVO { ...@@ -27,11 +27,15 @@ public class AppVO {
/** /**
* 应用访问数 * 应用访问数
*/ */
private Integer pv; private Integer totalPv;
/** /**
* 应用访客数 * 应用访客数
*/ */
private Integer uv; private Integer totalUv;
/**
* 统计月份,格式yyyy-MM-dd
*/
private String statYearMonth;
/** /**
* 操作类型 * 操作类型
*/ */
......
package com.mortals.xhx.module.converge.model.vo;
import lombok.Data;
@Data
public class AppsAccessVo {
/**
* 站点id
*/
private Long siteId;
/**
* 设备ID
*/
private String equipmentId;
/**
* 应用标识,具有唯一性
*/
private String appEname;
/**
* 应用名称
*/
private String appName;
/**
* 应用简称
*/
private String appSimpleName;
/**
* 应用提供方
*/
private String provider;
/**
* 应用来源
*/
private String origin;
/**
* 应用访问数
*/
private Integer totalPv;
/**
* 应用访客数
*/
private Integer totalUv;
/**
* 统计月份,格式yyyy-MM-dd
*/
private String statYearMonth;
}
package com.mortals.xhx.module.converge.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 应用访问视图对象
*
* @author zxfei
* @date 2023-07-03
*/
@Data
public class ConvergeAppsAccessVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.converge.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.dao.ConvergeAppsAccessDao;
import com.mortals.xhx.module.converge.model.vo.AppsAccessVo;
import java.util.List;
import java.util.Map;
/**
* ConvergeAppsAccessService
*
* 应用访问 service接口
*
* @author zxfei
* @date 2023-07-03
*/
public interface ConvergeAppsAccessService extends ICRUDService<ConvergeAppsAccessEntity,Long>{
ConvergeAppsAccessDao getDao();
/**
* 应用浏览量PV统计
* @return
*/
List<AppsAccessVo> getAppsAccessPv(Map<String,String> condition) throws AppException;
/**
* 应用浏览量UV统计
* @return
*/
List<AppsAccessVo> getAppsAccessUv(Map<String,String> condition) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.converge.service; package com.mortals.xhx.module.converge.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.model.ConvergeAppsEntity; import com.mortals.xhx.module.converge.model.ConvergeAppsEntity;
import com.mortals.xhx.module.converge.dao.ConvergeAppsDao; import com.mortals.xhx.module.converge.dao.ConvergeAppsDao;
import java.util.Map;
/** /**
* ConvergeAppsService * ConvergeAppsService
* *
...@@ -13,4 +18,10 @@ import com.mortals.xhx.module.converge.dao.ConvergeAppsDao; ...@@ -13,4 +18,10 @@ import com.mortals.xhx.module.converge.dao.ConvergeAppsDao;
public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Long>{ public interface ConvergeAppsService extends ICRUDService<ConvergeAppsEntity,Long>{
ConvergeAppsDao getDao(); ConvergeAppsDao getDao();
/**
* 天府通办数据汇聚
* @throws AppException
*/
void doConvergeApps(Map<String,String> condition) throws AppException;
} }
\ No newline at end of file
package com.mortals.xhx.module.converge.service.impl;
import com.mortals.xhx.module.converge.model.vo.AppsAccessVo;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.converge.dao.ConvergeAppsAccessDao;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.service.ConvergeAppsAccessService;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
/**
* ConvergeAppsAccessService
* 应用访问 service实现
*
* @author zxfei
* @date 2023-07-03
*/
@Service("convergeAppsAccessService")
@Slf4j
public class ConvergeAppsAccessServiceImpl extends AbstractCRUDServiceImpl<ConvergeAppsAccessDao, ConvergeAppsAccessEntity, Long> implements ConvergeAppsAccessService {
@Override
public List<AppsAccessVo> getAppsAccessPv(Map<String,String> condition) throws AppException {
return dao.getAppsAccessPv(condition);
}
@Override
public List<AppsAccessVo> getAppsAccessUv(Map<String,String> condition) throws AppException {
return dao.getAppsAccessUv(condition);
}
}
\ No newline at end of file
package com.mortals.xhx.module.converge.service.impl; package com.mortals.xhx.module.converge.service.impl;
import com.mortals.xhx.module.converge.model.*;
import com.mortals.xhx.module.converge.model.vo.AppsAccessVo;
import com.mortals.xhx.module.converge.service.ConvergeAppsAccessService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.xhx.module.converge.dao.ConvergeAppsDao; import com.mortals.xhx.module.converge.dao.ConvergeAppsDao;
import com.mortals.xhx.module.converge.model.ConvergeAppsEntity;
import com.mortals.xhx.module.converge.service.ConvergeAppsService; import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* ConvergeAppsService * ConvergeAppsService
* 设备应用 service实现 * 设备应用 service实现
...@@ -17,5 +28,69 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,5 +28,69 @@ import lombok.extern.slf4j.Slf4j;
@Service("convergeAppsService") @Service("convergeAppsService")
@Slf4j @Slf4j
public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeAppsDao, ConvergeAppsEntity, Long> implements ConvergeAppsService { public class ConvergeAppsServiceImpl extends AbstractCRUDServiceImpl<ConvergeAppsDao, ConvergeAppsEntity, Long> implements ConvergeAppsService {
@Autowired
private ConvergeAppsAccessService convergeAppsAccessService;
@Autowired
private ConvergeDeviceService convergeDeviceService;
@Override
public void doConvergeApps(Map<String,String> condition) throws AppException {
List<AppsAccessVo> accessPvList = convergeAppsAccessService.getAppsAccessPv(condition);
List<AppsAccessVo> accessUvList = convergeAppsAccessService.getAppsAccessUv(condition);
if(CollectionUtils.isEmpty(accessPvList)||CollectionUtils.isEmpty(accessUvList)){
return;
}else {
Map<String,AppsAccessVo> uvMap = new HashMap<>();
for (AppsAccessVo vo:accessUvList){
String key = vo.getSiteId()+"_"+vo.getEquipmentId()+"_"+vo.getAppEname()+"_"+vo.getStatYearMonth();
uvMap.put(key,vo);
}
List<ConvergeAppsEntity> appsList = new ArrayList<>();
Map<String, ConvergeDeviceEntity> deviceMap = new HashMap<>();
for(AppsAccessVo item:accessPvList){
ConvergeAppsEntity entity = new ConvergeAppsEntity();
if(deviceMap.containsKey(item.getEquipmentId())){
entity.setEquipmentId(deviceMap.get(item.getEquipmentId()).getId());
}else {
ConvergeDeviceEntity deviceEntity = convergeDeviceService.selectOne(new ConvergeDeviceQuery().logo(item.getEquipmentId()));
if(deviceEntity!=null){
deviceMap.put(item.getEquipmentId(),deviceEntity);
entity.setEquipmentId(deviceEntity.getId());
}else {
entity.setEquipmentId(-1l);
}
}
entity.setAppEname(item.getAppEname());
entity.setAppName(item.getAppName());
entity.setAppSimpleName(item.getAppSimpleName());
entity.setProvider(item.getProvider());
entity.setOrigin(item.getOrigin());
entity.setSiteId(item.getSiteId());
entity.setTotalPv(item.getTotalPv());
entity.setStatYearMonth(item.getStatYearMonth());
String key = item.getSiteId()+"_"+item.getEquipmentId()+"_"+item.getAppEname()+"_"+item.getStatYearMonth();
if(uvMap.containsKey(key)) {
entity.setTotalUv(uvMap.get(key).getTotalUv());
}
appsList.add(entity);
}
for(ConvergeAppsEntity item:appsList){
ConvergeAppsEntity temp = this.selectOne(new ConvergeAppsQuery().appEname(item.getAppEname()).equipmentId(item.getEquipmentId()).siteId(item.getSiteId()).statYearMonth(item.getStatYearMonth()));
if(temp!=null){
item.setId(temp.getId());
if(temp.getTotalPv()==item.getTotalPv()&&temp.getTotalUv()==item.getTotalUv()){
item.setOpr("P");
}else {
item.setOpr("U");
}
this.update(item);
}else {
item.setOpr("A");
this.save(item);
}
}
}
}
} }
\ No newline at end of file
...@@ -6,11 +6,11 @@ import com.mortals.xhx.common.pdu.site.SitePdu; ...@@ -6,11 +6,11 @@ import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.feign.device.IDeviceFeign; import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.converge.model.ConvergeDeviceEntity; import com.mortals.xhx.module.converge.model.*;
import com.mortals.xhx.module.converge.model.ConvergeDeviceQuery; import com.mortals.xhx.module.converge.model.vo.AppVO;
import com.mortals.xhx.module.converge.model.ConvergeSiteQuery;
import com.mortals.xhx.module.converge.model.vo.BranchVO; import com.mortals.xhx.module.converge.model.vo.BranchVO;
import com.mortals.xhx.module.converge.model.vo.EquipmentVO; import com.mortals.xhx.module.converge.model.vo.EquipmentVO;
import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService; import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -20,7 +20,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; ...@@ -20,7 +20,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.xhx.module.converge.dao.ConvergeSiteDao; import com.mortals.xhx.module.converge.dao.ConvergeSiteDao;
import com.mortals.xhx.module.converge.model.ConvergeSiteEntity;
import com.mortals.xhx.module.converge.service.ConvergeSiteService; import com.mortals.xhx.module.converge.service.ConvergeSiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -45,6 +44,8 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit ...@@ -45,6 +44,8 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
private ISiteFeign siteFeign; private ISiteFeign siteFeign;
@Autowired @Autowired
private ConvergeDeviceService convergeDeviceService; private ConvergeDeviceService convergeDeviceService;
@Autowired
private ConvergeAppsService convergeAppsService;
@Override @Override
public List<BranchVO> getConvergeData() throws AppException { public List<BranchVO> getConvergeData() throws AppException {
...@@ -60,7 +61,11 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit ...@@ -60,7 +61,11 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
for (ConvergeDeviceEntity deviceEntity:deviceEntityList){ for (ConvergeDeviceEntity deviceEntity:deviceEntityList){
EquipmentVO equipmentVO = new EquipmentVO(); EquipmentVO equipmentVO = new EquipmentVO();
BeanUtils.copyProperties(deviceEntity,equipmentVO,BeanUtil.getNullPropertyNames(deviceEntity)); BeanUtils.copyProperties(deviceEntity,equipmentVO,BeanUtil.getNullPropertyNames(deviceEntity));
equipmentVO.setAppStats(Collections.emptyList()); List<ConvergeAppsEntity> apps = convergeAppsService.find(new ConvergeAppsQuery().siteId(deviceEntity.getSiteId()).equipmentId(deviceEntity.getId()));
if(CollectionUtils.isEmpty(apps)){
continue;
}
equipmentVO.setAppStats(convertAppVO(apps));
equipments.add(equipmentVO); equipments.add(equipmentVO);
} }
branchVO.setEquipments(equipments); branchVO.setEquipments(equipments);
...@@ -137,4 +142,18 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit ...@@ -137,4 +142,18 @@ public class ConvergeSiteServiceImpl extends AbstractCRUDServiceImpl<ConvergeSit
} }
return true; return true;
} }
private List<AppVO> convertAppVO(List<ConvergeAppsEntity> apps){
if(CollectionUtils.isEmpty(apps)){
return Collections.emptyList();
}else {
List<AppVO> voList = new ArrayList<>();
for (ConvergeAppsEntity item:apps){
AppVO vo = new AppVO();
BeanUtils.copyProperties(item,vo,BeanUtil.getNullPropertyNames(item));
voList.add(vo);
}
return voList;
}
}
} }
\ No newline at end of file
package com.mortals.xhx.module.converge.web;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.model.BaseEntity;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.utils.BeanUtil;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.converge.model.ConvergeAppsAccessEntity;
import com.mortals.xhx.module.converge.service.ConvergeAppsAccessService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 应用访问
*
* @author zxfei
* @date 2023-07-03
*/
@RestController
@RequestMapping("converge/apps/access")
public class ConvergeAppsAccessController extends BaseCRUDJsonBodyMappingController<ConvergeAppsAccessService,ConvergeAppsAccessEntity,Long> {
@Autowired
private ParamService paramService;
public ConvergeAppsAccessController(){
super.setModuleDesc( "应用访问");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
@Override
@PostMapping({"save"})
@UnAuth
public String save(@RequestBody ConvergeAppsAccessEntity entity) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "保存" + this.getModuleDesc();
try {
this.saveBefore(entity, model, context);
if (entity.newEntity()) {
Class<ConvergeAppsAccessEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
ConvergeAppsAccessEntity initEntity = (ConvergeAppsAccessEntity)tClass.newInstance();
initEntity.initAttrValue();
BeanUtils.copyProperties(entity, initEntity, BeanUtil.getNullPropertyNames(entity));
entity = initEntity;
busiDesc = "新增" + this.getModuleDesc();
initEntity.setCreateTime(new Date());
IUser user = this.getCurUser();
if (user != null) {
initEntity.setCreateUserId(user.getId());
initEntity.setCreateUser(user.getLoginName());
initEntity.setCreateUserName(user.getRealName());
initEntity.setCreateUserDeptId(user.getDeptId());
initEntity.setCreateUserDeptName(user.getDeptName());
}
this.service.save(initEntity, context);
} else {
busiDesc = "修改" + this.getModuleDesc();
entity.setUpdateTime(new Date());
IUser user = this.getCurUser();
if (user != null) {
entity.setUpdateUserId(user.getId());
entity.setUpdateUser(user.getLoginName());
entity.setUpdateUserName(user.getRealName());
entity.setUpdateUserDeptId(user.getDeptId());
entity.setUpdateUserDeptName(user.getDeptName());
}
this.service.update(entity, context);
}
model.put("id", entity.getId());
code = this.saveAfter(entity, model, context);
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
@GetMapping({"bury"})
@UnAuth
public String bury(HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "保存" + this.getModuleDesc();
ConvergeAppsAccessEntity entity = new ConvergeAppsAccessEntity();
entity.setSiteId(DataUtil.converStr2Long(request.getParameter("siteId"),0l));
entity.setApplicationId(request.getParameter("applicationId"));
entity.setApplicationName(request.getParameter("applicationName"));
if(StringUtils.isNotEmpty(request.getParameter("startTime"))) {
entity.setStartTime(DateUtils.StrToDateTime(request.getParameter("startTime")));
}
if(StringUtils.isNotEmpty(request.getParameter("endTime"))) {
entity.setEndTime(DateUtils.StrToDateTime(request.getParameter("endTime")));
}
entity.setChannelId(request.getParameter("channelId"));
entity.setChannelName(request.getParameter("channelName"));
entity.setLocation(request.getParameter("location"));
entity.setClientName(request.getParameter("clientName"));
entity.setVersion(request.getParameter("version"));
entity.setEcode(request.getParameter("ecode"));
entity.setAppSimpleName(request.getParameter("appSimpleName"));
entity.setProvider(request.getParameter("provider"));
entity.setOrigin(request.getParameter("origin"));
try {
this.saveBefore(entity, model, context);
if (entity.newEntity()) {
Class<ConvergeAppsAccessEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
ConvergeAppsAccessEntity initEntity = (ConvergeAppsAccessEntity)tClass.newInstance();
initEntity.initAttrValue();
BeanUtils.copyProperties(entity, initEntity, BeanUtil.getNullPropertyNames(entity));
entity = initEntity;
busiDesc = "新增" + this.getModuleDesc();
initEntity.setCreateTime(new Date());
IUser user = this.getCurUser();
if (user != null) {
initEntity.setCreateUserId(user.getId());
initEntity.setCreateUser(user.getLoginName());
initEntity.setCreateUserName(user.getRealName());
initEntity.setCreateUserDeptId(user.getDeptId());
initEntity.setCreateUserDeptName(user.getDeptName());
}
this.service.save(initEntity, context);
}
model.put("id", entity.getId());
code = this.saveAfter(entity, model, context);
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
}
\ No newline at end of file
package com.mortals.xhx.module.converge.web; package com.mortals.xhx.module.converge.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; 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.module.converge.model.vo.BranchVO; import com.mortals.xhx.module.converge.model.vo.BranchVO;
import com.mortals.xhx.module.converge.service.ConvergeAppsService;
import com.mortals.xhx.module.converge.service.ConvergeDeviceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -19,6 +23,7 @@ import com.mortals.xhx.module.converge.service.ConvergeSiteService; ...@@ -19,6 +23,7 @@ import com.mortals.xhx.module.converge.service.ConvergeSiteService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -38,6 +43,10 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co ...@@ -38,6 +43,10 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private ConvergeDeviceService convergeDeviceService;
@Autowired
private ConvergeAppsService convergeAppsService;
public ConvergeSiteController(){ public ConvergeSiteController(){
super.setModuleDesc( "网点信息"); super.setModuleDesc( "网点信息");
...@@ -80,4 +89,37 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co ...@@ -80,4 +89,37 @@ public class ConvergeSiteController extends BaseCRUDJsonBodyMappingController<Co
} }
return JSONObject.toJSONString(model.get("data")); return JSONObject.toJSONString(model.get("data"));
} }
@Override
protected void doListBefore(ConvergeSiteEntity query, Map<String, Object> model, Context context) throws AppException {
log.info("开始执行省平台数据汇聚任务...");
try {
this.service.doConvergeSite();
}catch (Exception e){
log.error("汇聚网点数据执行出错",e);
}
try {
convergeDeviceService.doConvergeDevice();
}catch (Exception e){
log.error("汇聚设备数据出错",e);
}
try {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
Map<String,String> condition = new HashMap<>();
condition.put("startTime",startTime);
condition.put("endTime",endTime);
convergeAppsService.doConvergeApps(condition);
}catch (Exception e){
log.error("汇聚应用数据出错",e);
}
log.info("省平台数据汇聚任务执行完成");
}
} }
\ No newline at end of file
...@@ -20,10 +20,12 @@ public class DeviceEntity extends DeviceVo { ...@@ -20,10 +20,12 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 设备名称 * 设备名称
*/ */
@Excel(name = "设备名称")
private String deviceName; private String deviceName;
/** /**
* 设备编码,SN码等,默认为MAC地址 * 设备编码,SN码等,默认为MAC地址
*/ */
@Excel(name = "设备编码")
private String deviceCode; private String deviceCode;
/** /**
* 设备的MAC地址 * 设备的MAC地址
...@@ -40,6 +42,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -40,6 +42,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 站点名称 * 站点名称
*/ */
@Excel(name = "站点名称")
private String siteName; private String siteName;
/** /**
* 平台系统Id * 平台系统Id
...@@ -48,6 +51,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -48,6 +51,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 平台系统名称 * 平台系统名称
*/ */
@Excel(name = "平台系统名称")
private String platformName; private String platformName;
/** /**
* 产品Id * 产品Id
...@@ -56,6 +60,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -56,6 +60,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 产品名称 * 产品名称
*/ */
@Excel(name = "产品名称")
private String productName; private String productName;
/** /**
* 皮肤id * 皮肤id
...@@ -76,6 +81,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -76,6 +81,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 设备生产厂商名称 * 设备生产厂商名称
*/ */
@Excel(name = "设备生产厂商名称")
private String deviceFirmname; private String deviceFirmname;
/** /**
* 设备来源(0.子设备,1.网关设备,2.直连设备) * 设备来源(0.子设备,1.网关设备,2.直连设备)
...@@ -96,10 +102,12 @@ public class DeviceEntity extends DeviceVo { ...@@ -96,10 +102,12 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 所属楼栋 * 所属楼栋
*/ */
@Excel(name = "所属楼栋")
private Integer deviceInBuilding; private Integer deviceInBuilding;
/** /**
* 所属楼层 * 所属楼层
*/ */
@Excel(name = "所属楼层")
private Integer deviceInFloor; private Integer deviceInFloor;
/** /**
* 保修期至 * 保修期至
...@@ -108,10 +116,12 @@ public class DeviceEntity extends DeviceVo { ...@@ -108,10 +116,12 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 负责人 * 负责人
*/ */
@Excel(name = "负责人")
private String leadingOfficial; private String leadingOfficial;
/** /**
* 联系电话 * 联系电话
*/ */
@Excel(name = "联系电话")
private String leadingOfficialTelephone; private String leadingOfficialTelephone;
/** /**
* 是否接收异常短(0.否,1.是) * 是否接收异常短(0.否,1.是)
...@@ -168,6 +178,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -168,6 +178,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 设备来源(0.旧设备,1.新设备) * 设备来源(0.旧设备,1.新设备)
*/ */
@Excel(name = "设备来源", readConverterExp = "0=旧设备,1=新设备")
private Integer source; private Integer source;
/** /**
* 设备SN码 * 设备SN码
...@@ -180,6 +191,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -180,6 +191,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 产品编码 * 产品编码
*/ */
@Excel(name = "产品类型")
private String productCode; private String productCode;
/** /**
* 大厅Id * 大厅Id
...@@ -188,6 +200,7 @@ public class DeviceEntity extends DeviceVo { ...@@ -188,6 +200,7 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 大厅名称 * 大厅名称
*/ */
@Excel(name = "大厅名称")
private String hallName; private String hallName;
/** /**
* 是否显示短信(0.否,1.是) * 是否显示短信(0.否,1.是)
...@@ -312,4 +325,4 @@ public class DeviceEntity extends DeviceVo { ...@@ -312,4 +325,4 @@ public class DeviceEntity extends DeviceVo {
this.showWechatQrCode = 1; this.showWechatQrCode = 1;
} }
} }
\ No newline at end of file
...@@ -25,11 +25,7 @@ public class DeviceVo extends BaseEntityLong { ...@@ -25,11 +25,7 @@ public class DeviceVo extends BaseEntityLong {
*/ */
private String platformCode; private String platformCode;
/**
* 产品编码
*/
@Excel(name = "产品类型",cacheDict = "productDict" ,type = Excel.Type.IMPORT)
private String productCode;
/** /**
......
package com.mortals.xhx.module.device.web; package com.mortals.xhx.module.device.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
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.BaseEntity;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
...@@ -27,11 +32,9 @@ import org.springframework.beans.BeanUtils; ...@@ -27,11 +32,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -92,6 +95,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -92,6 +95,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
model.put("notActive", not_active); model.put("notActive", not_active);
model.put("stopUsing", stop_using); model.put("stopUsing", stop_using);
model.put("pageInfo", result.getPageInfo()); model.put("pageInfo", result.getPageInfo());
model.put("dict",result.getDict());
this.parsePageInfo(model, result.getPageInfo()); this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, model, context); code = this.doListAfter(query, model, context);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
...@@ -109,7 +113,6 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -109,7 +113,6 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return ret; return ret;
} }
@RequestMapping(value = {"info"},method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = {"info"},method = {RequestMethod.POST, RequestMethod.GET})
@UnAuth @UnAuth
public String info(Long id) { public String info(Long id) {
...@@ -313,4 +316,122 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -313,4 +316,122 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return ret; return ret;
} }
@PostMapping({"m/save"})
@RepeatSubmit
public String save(@RequestBody DevicePdu devicePdu,@RequestHeader("Authorization") String authorization) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "保存" + this.getModuleDesc();
int code = 1;
try {
Rest<RespData<DevicePdu>> rest = deviceFeign.save(devicePdu,authorization);
if (rest.getCode()>0){
code = 1;
model.put("entity", rest.getData().getData());
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + devicePdu.getId() + "]");
}else {
code = -1;
model.put("message_info", rest.getMsg());
}
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", devicePdu);
this.init(model, context);
code = -1;
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
@PostMapping({"m/list"})
@UnAuth
public Rest<Object> mlist(@RequestBody DevicePdu query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
Rest<RespData<List<DevicePdu>>> rest = deviceFeign.list(query);
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
model.put("data", rest.getData().getData());
int onlineTotal = 0;
int offlineTotal = 0;
int not_active = 0;
int stop_using = 0;
for (DevicePdu deviceEntity : rest.getData().getData()) {
if (deviceEntity.getDeviceStatus() == 0) {
not_active++;
}
if (deviceEntity.getDeviceStatus() == 1) {
offlineTotal++;
}
if (deviceEntity.getDeviceStatus() == 2) {
onlineTotal++;
}
if (deviceEntity.getEnabled() == 0) {
stop_using++;
}
}
model.put("online", onlineTotal);
model.put("offline", offlineTotal);
model.put("notActive", not_active);
model.put("stopUsing", stop_using);
model.put("pageInfo", rest.getData().getPageInfo());
//model.put("dict", rest.getData().getDict());
}
ret.setCode(rest.getCode());
ret.setMsg(rest.getMsg());
ret.setData(model);
ret.setDict(rest.getDict());
} catch (Exception var9) {
code = -1;
ret.setCode(code);
this.doException(this.request, busiDesc, model, var9);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
}
return ret;
}
/**
* 设备启用停用
*/
@PostMapping(value = "m/enable")
public String deviceEnable(@RequestBody DevicePdu devicePdu,@RequestHeader("Authorization") String authorization) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "启用停用设备";
try {
String resp = deviceFeign.deviceEnable(devicePdu,authorization);
jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) {
log.error("设备启用停用消息", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
@PostMapping({"m/importData"})
public String importData(MultipartFile file,@RequestHeader("Authorization") String authorization,@RequestParam("siteId") Long siteId) {
return deviceFeign.importData(file,authorization,siteId);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.sst.model; package com.mortals.xhx.module.sst.model;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.sst.model.vo.SstAgreementVo; import com.mortals.xhx.module.sst.model.vo.SstAgreementVo;
import lombok.Data;
/** /**
* 协议管理实体对象 * 协议管理实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-12-26 * @date 2023-07-10
*/ */
@Data
public class SstAgreementEntity extends SstAgreementVo { public class SstAgreementEntity extends SstAgreementVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 站点id * 站点id
*/ */
private Long siteId; private Long siteId;
/** /**
* 协议名称 * 协议名称
*/ */
private String name; private String name;
/** /**
* 协议描述 * 协议描述
*/ */
private String describe; private String describe;
/** /**
* 协议内容 * 协议内容
*/ */
private String content; private String content;
public SstAgreementEntity(){}
/**
* 获取 站点id
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/** /**
* 设置 站点id * 协议类型
* @param siteId */
*/ private Integer protocolType;
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 协议名称
* @return String
*/
public String getName(){
return name;
}
/**
* 设置 协议名称
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 协议描述
* @return String
*/
public String getDescribe(){
return describe;
}
/**
* 设置 协议描述
* @param describe
*/
public void setDescribe(String describe){
this.describe = describe;
}
/**
* 获取 协议内容
* @return String
*/
public String getContent(){
return content;
}
/**
* 设置 协议内容
* @param content
*/
public void setContent(String content){
this.content = content;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -106,29 +46,22 @@ public class SstAgreementEntity extends SstAgreementVo { ...@@ -106,29 +46,22 @@ public class SstAgreementEntity extends SstAgreementVo {
if (obj instanceof SstAgreementEntity) { if (obj instanceof SstAgreementEntity) {
SstAgreementEntity tmp = (SstAgreementEntity) obj; SstAgreementEntity tmp = (SstAgreementEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",name:").append(getName());
sb.append(",describe:").append(getDescribe());
sb.append(",content:").append(getContent());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.siteId = null; this.siteId = -1L;
this.name = "";
this.name = ""; this.describe = "";
this.describe = ""; this.content = "";
this.content = ""; this.protocolType = 1;
} }
} }
\ No newline at end of file
...@@ -24,6 +24,8 @@ public class SstBasicVo extends BaseEntityLong { ...@@ -24,6 +24,8 @@ public class SstBasicVo extends BaseEntityLong {
/** 设备编码 */ /** 设备编码 */
private String deviceCode; private String deviceCode;
private String appName;
public String getShowAppIds() { public String getShowAppIds() {
return showAppIds; return showAppIds;
} }
...@@ -63,4 +65,12 @@ public class SstBasicVo extends BaseEntityLong { ...@@ -63,4 +65,12 @@ public class SstBasicVo extends BaseEntityLong {
public void setDeviceCode(String deviceCode) { public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode; this.deviceCode = deviceCode;
} }
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
} }
\ No newline at end of file
...@@ -36,7 +36,7 @@ public interface SstAppsDeskService extends ICRUDService<SstAppsDeskEntity,Long> ...@@ -36,7 +36,7 @@ public interface SstAppsDeskService extends ICRUDService<SstAppsDeskEntity,Long>
* @param siteId 站点ID * @param siteId 站点ID
* @return * @return
*/ */
Map<String, Object> getAppListBySite(String deviceCode,Long siteId,String host); Map<String, Object> getAppListBySite(String deviceCode,Long siteId,String host,String appName);
/** /**
* 应用下架 * 应用下架
...@@ -44,4 +44,10 @@ public interface SstAppsDeskService extends ICRUDService<SstAppsDeskEntity,Long> ...@@ -44,4 +44,10 @@ public interface SstAppsDeskService extends ICRUDService<SstAppsDeskEntity,Long>
* @param userId * @param userId
*/ */
void forbidden(Long appId,Long userId); void forbidden(Long appId,Long userId);
/**
* 增加应用点击次数
* @param appId
*/
void clickCountAdd(Long appId,Long siteId);
} }
\ No newline at end of file
...@@ -38,7 +38,7 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{ ...@@ -38,7 +38,7 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{
* @param siteId 站点ID * @param siteId 站点ID
* @return * @return
*/ */
Map<String, Object> getAppListBySite(String deviceCode,Long siteId,String host); Map<String, Object> getAppListBySite(String deviceCode,Long siteId,String host,String appName);
/** /**
* 应用下架 * 应用下架
...@@ -46,4 +46,10 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{ ...@@ -46,4 +46,10 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{
* @param userId * @param userId
*/ */
void forbidden(Long appId,Long userId); void forbidden(Long appId,Long userId);
/**
* 增加应用点击次数
* @param appId
*/
void clickCountAdd(Long appId,Long siteId);
} }
\ No newline at end of file
...@@ -42,6 +42,7 @@ public class SstAgreementController extends BaseCRUDJsonBodyMappingController<Ss ...@@ -42,6 +42,7 @@ public class SstAgreementController extends BaseCRUDJsonBodyMappingController<Ss
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "protocolType", paramService.getParamBySecondOrganize("SstAgreement","protocolType"));
super.init(model, context); super.init(model, context);
} }
......
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