Browse Source
Conflicts: epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.javamaster
496 changed files with 18667 additions and 1744 deletions
@ -0,0 +1,91 @@ |
|||
package com.epmet.mq.listener.listener; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg; |
|||
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.entity.LogOperationEntity; |
|||
import com.epmet.enums.SystemMessageTypeEnum; |
|||
import com.epmet.mq.listener.bean.log.LogOperationHelper; |
|||
import com.epmet.mq.listener.bean.log.OperatorInfo; |
|||
import com.epmet.service.LogOperationService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; |
|||
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; |
|||
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; |
|||
import org.apache.rocketmq.common.message.MessageExt; |
|||
import org.redisson.api.RLock; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.util.List; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* @author wxz |
|||
* @Description 积分相关日志监听器 |
|||
|
|||
* @return |
|||
* @date 2021.06.21 10:13 |
|||
*/ |
|||
public class PointOperationLogListener implements MessageListenerConcurrently { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Override |
|||
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) { |
|||
try { |
|||
msgs.forEach(msg -> consumeMessage(msg)); |
|||
} catch (Exception e) { |
|||
logger.error(ExceptionUtils.getErrorStackTrace(e)); |
|||
return ConsumeConcurrentlyStatus.RECONSUME_LATER; |
|||
} |
|||
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; |
|||
} |
|||
|
|||
private void consumeMessage(MessageExt messageExt) { |
|||
String opeType = messageExt.getTags(); |
|||
String msg = new String(messageExt.getBody()); |
|||
logger.info("积分操作日志监听器-收到消息内容:{}", msg); |
|||
PointRuleChangedMQMsg msgObj = JSON.parseObject(msg, PointRuleChangedMQMsg.class); |
|||
|
|||
String content = StringUtils.isBlank(msgObj.getOperationBrief()) ? "" : msgObj.getOperationBrief(); |
|||
|
|||
OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getOperatorId()); |
|||
|
|||
LogOperationEntity logEntity = new LogOperationEntity(); |
|||
logEntity.setCategory(messageExt.getTopic()); |
|||
logEntity.setType(opeType); |
|||
logEntity.setTypeDisplay(SystemMessageTypeEnum.getTypeDisplay(opeType)); |
|||
logEntity.setTargetId(msgObj.getRuleId()); |
|||
logEntity.setIp(msgObj.getIp()); |
|||
logEntity.setFromApp(msgObj.getFromApp()); |
|||
logEntity.setFromClient(msgObj.getFromClient()); |
|||
logEntity.setCustomerId(operatorInfo.getCustomerId()); |
|||
logEntity.setOperatorId(msgObj.getOperatorId()); |
|||
logEntity.setOperatorMobile(operatorInfo.getMobile()); |
|||
logEntity.setOperatorName(operatorInfo.getName()); |
|||
logEntity.setOperatingTime(msgObj.getOperatingTime()); |
|||
logEntity.setContent(content); |
|||
|
|||
DistributedLock distributedLock = null; |
|||
RLock lock = null; |
|||
try { |
|||
distributedLock = SpringContextUtils.getBean(DistributedLock.class); |
|||
lock = distributedLock.getLock(String.format("lock:point_operation_log:%s:%s", logEntity.getType(), logEntity.getTargetId()), |
|||
30L, 30L, TimeUnit.SECONDS); |
|||
SpringContextUtils.getBean(LogOperationService.class).log(logEntity); |
|||
} catch (RenException e) { |
|||
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|||
logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
} catch (Exception e) { |
|||
// 不是我们自己抛出的异常,可以让MQ重试
|
|||
logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|||
throw e; |
|||
} finally { |
|||
distributedLock.unLock(lock); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.commons.rocketmq.messages; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 积分规则变动消息体 |
|||
*/ |
|||
@Data |
|||
public class PointRuleChangedMQMsg { |
|||
/** |
|||
* 操作简介 |
|||
*/ |
|||
private String operationBrief; |
|||
|
|||
/** |
|||
* 规则的id |
|||
*/ |
|||
private String ruleId; |
|||
/** |
|||
* 谁操作的 |
|||
*/ |
|||
private String operatorId; |
|||
|
|||
private String ip; |
|||
|
|||
private String fromApp; |
|||
|
|||
private String fromClient; |
|||
|
|||
private Date operatingTime; |
|||
} |
@ -1,43 +0,0 @@ |
|||
package com.epmet.commons.rocketmq.register; |
|||
|
|||
import lombok.Data; |
|||
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:mq 消费配置类 |
|||
* |
|||
* @author: LiuJanJun |
|||
* @date: 2021/4/30 2:39 下午 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
public class ConsumerConfigProperties implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2069676324708473773L; |
|||
/** |
|||
* 消费者组 |
|||
*/ |
|||
private String consumerGroup; |
|||
/** |
|||
* 主题 |
|||
*/ |
|||
private String topic; |
|||
/** |
|||
* 标签 |
|||
*/ |
|||
private String tag = "*"; |
|||
/** |
|||
* 最小消费的线程数 |
|||
*/ |
|||
private int consumeThreadMin = 2; |
|||
/** |
|||
* 最大消费的线程数 |
|||
*/ |
|||
private int consumeThreadMax = 4; |
|||
/** |
|||
* 消费监听器 |
|||
*/ |
|||
private MessageListenerConcurrently consumerListener; |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.epmet.commons.rocketmq.register; |
|||
|
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; |
|||
import org.apache.rocketmq.client.consumer.listener.MessageListener; |
|||
import org.apache.rocketmq.client.exception.MQClientException; |
|||
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; |
|||
|
|||
/** |
|||
* @author wxz |
|||
* @Description 父类抽象注册器 |
|||
* @date 2021.07.14 15:38:21 |
|||
*/ |
|||
@Slf4j |
|||
public abstract class MQAbstractRegister { |
|||
|
|||
/** |
|||
* @Description 注册所有监听器,由子类实现,做具体监听器的注册 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.14 15:48 |
|||
*/ |
|||
public abstract void registerAllListeners(String env, MQConsumerProperties consumerProperties); |
|||
|
|||
/** |
|||
* @Description 真正执行注册的方法,供子类直接调用,子类也可以覆盖该方法 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.14 15:56 |
|||
*/ |
|||
public void register(MQConsumerProperties consumerProperties, String group, MessageModel messageModel, String topic, String subExpression, MessageListener listener) { |
|||
try { |
|||
String nameServer = consumerProperties.getNameServer(); |
|||
Integer consumeThreadMin = consumerProperties.getConsumeThreadMin(); |
|||
Integer consumeThreadMax = consumerProperties.getConsumeThreadMax(); |
|||
String instanceName = buildInstanceName(); |
|||
// 实例化消费者
|
|||
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(group); |
|||
|
|||
// 设置NameServer的地址
|
|||
consumer.setNamesrvAddr(nameServer); |
|||
consumer.setMessageModel(messageModel); |
|||
consumer.setInstanceName(instanceName); |
|||
// 订阅一个或者多个Topic,以及Tag来过滤需要消费的消息
|
|||
consumer.subscribe(topic, subExpression); |
|||
// 注册回调实现类来处理从broker拉取回来的消息
|
|||
consumer.registerMessageListener(listener); |
|||
if (consumeThreadMin != null) { |
|||
consumer.setConsumeThreadMin(consumeThreadMin); |
|||
} |
|||
if (consumeThreadMax != null) { |
|||
consumer.setConsumeThreadMax(consumeThreadMax); |
|||
} |
|||
// 启动消费者实例
|
|||
consumer.start(); |
|||
log.info(String.format("监听器注册完成,消费者组:%s,Topic:%s,Tag:%s,实例名称:%s", group, topic, subExpression, instanceName)); |
|||
} catch (Exception e) { |
|||
log.error(String.format("监听器注册失败,消费者组:%s,Topic:%s,Tag:%s。详细信息:%s", group, topic, subExpression, ExceptionUtils.getErrorStackTrace(e))); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description 构造实例名称 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.14 15:56 |
|||
*/ |
|||
private String buildInstanceName() { |
|||
String instanceName = ""; |
|||
for (int i = 0; i < 4; i++) { |
|||
int t = (int) (Math.random() * 10); |
|||
instanceName = instanceName.concat(t + ""); |
|||
} |
|||
return instanceName; |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.commons.rocketmq.register; |
|||
|
|||
import lombok.Data; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
|
|||
/** |
|||
* @Description 注册属性 |
|||
* @author wxz |
|||
* @date 2021.07.14 15:33:16 |
|||
*/ |
|||
@Data |
|||
@ConfigurationProperties(prefix = "rocketmq") |
|||
public class MQConsumerProperties { |
|||
|
|||
/** |
|||
* nameServer |
|||
*/ |
|||
private String nameServer; |
|||
|
|||
/** |
|||
* 最小消费线程数 |
|||
*/ |
|||
private Integer consumeThreadMin; |
|||
/** |
|||
* 最大消费线程数 |
|||
*/ |
|||
private Integer consumeThreadMax; |
|||
|
|||
} |
@ -1,79 +0,0 @@ |
|||
package com.epmet.commons.rocketmq.register; |
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; |
|||
import org.apache.rocketmq.client.exception.MQClientException; |
|||
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
|
|||
import javax.annotation.PostConstruct; |
|||
|
|||
/** |
|||
* desc:注册mq监听器 |
|||
* |
|||
* @author liujianjun |
|||
*/ |
|||
@Slf4j |
|||
public abstract class MQConsumerRegister { |
|||
@Value("${spring.profiles.active}") |
|||
private String env; |
|||
@Value("${rocketmq.name-server}") |
|||
private String namesrvAddr; |
|||
|
|||
public abstract ConsumerConfigProperties getConsumerProperty(); |
|||
|
|||
|
|||
/** |
|||
* @return |
|||
* @Description 注册监听器 |
|||
* @author wxz |
|||
* @date 2021.03.03 16:09 |
|||
*/ |
|||
@PostConstruct |
|||
public void registerMQListener() { |
|||
ConsumerConfigProperties consumerProperty = getConsumerProperty(); |
|||
log.info("registerAllListeners consumers:{} success", consumerProperty); |
|||
//本地环境不注册
|
|||
//if (!"local".equals(env)) {
|
|||
try { |
|||
// 实例化消费者
|
|||
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(consumerProperty.getConsumerGroup()); |
|||
|
|||
// 设置NameServer的地址
|
|||
consumer.setNamesrvAddr(namesrvAddr); |
|||
consumer.setMessageModel(MessageModel.CLUSTERING); |
|||
consumer.setInstanceName(buildInstanceName()); |
|||
// 订阅一个或者多个Topic,以及Tag来过滤需要消费的消息
|
|||
consumer.subscribe(consumer.getConsumerGroup(), consumerProperty.getTag()); |
|||
// 注册回调实现类来处理从broker拉取回来的消息
|
|||
consumer.registerMessageListener(consumerProperty.getConsumerListener()); |
|||
consumer.setConsumeThreadMin(consumerProperty.getConsumeThreadMin()); |
|||
consumer.setConsumeThreadMax(consumerProperty.getConsumeThreadMax()); |
|||
// 启动消费者实例
|
|||
consumer.start(); |
|||
} catch (MQClientException e) { |
|||
log.info("registerMQListener exception", e); |
|||
} |
|||
|
|||
//}
|
|||
|
|||
} |
|||
|
|||
/** |
|||
* desc: 因为docker-compose部署有问题 所有自己命名 |
|||
* |
|||
* @param |
|||
* @return java.lang.String |
|||
* @author LiuJanJun |
|||
* @date 2021/4/30 5:00 下午 |
|||
*/ |
|||
private String buildInstanceName() { |
|||
String instanceName = ""; |
|||
for (int i = 0; i < 4; i++) { |
|||
int t = (int) (Math.random() * 10); |
|||
instanceName = instanceName.concat(t + ""); |
|||
} |
|||
|
|||
return instanceName; |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.commons.rocketmq.register; |
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
import javax.annotation.PostConstruct; |
|||
|
|||
/** |
|||
* @author wxz |
|||
* @Description MQ注册配置类 |
|||
* @date 2021.07.14 15:36:24 |
|||
*/ |
|||
@Configuration |
|||
@ConditionalOnProperty(prefix = "rocketmq", name = "enable", havingValue = "true", matchIfMissing = false) |
|||
@EnableConfigurationProperties(MQConsumerProperties.class) |
|||
@Slf4j |
|||
public class MQRegisterConfiguration { |
|||
|
|||
@Value("${spring.profiles.active}") |
|||
private String env; |
|||
@Autowired |
|||
private MQConsumerProperties consumerProperties; |
|||
@Autowired |
|||
private MQAbstractRegister mqRegister; |
|||
|
|||
@PostConstruct |
|||
public void register() { |
|||
mqRegister.registerAllListeners(env, consumerProperties); |
|||
log.info("监听器注册动作执行完毕"); |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Description 网格员相关统计formdto |
|||
* @author wxz |
|||
* @date 2021.07.05 15:46:23 |
|||
*/ |
|||
@Data |
|||
public class GridMemberStatsFormDTO { |
|||
|
|||
public interface IssueProjectStats {} |
|||
|
|||
@NotBlank(message = "网格ID不能为空", groups = {IssueProjectStats.class}) |
|||
private String gridId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 对外接口--查询工作人员基本信息-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class OpenStaffDetailFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3381286960911634231L; |
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
@NotBlank(message = "客户Id不能为空", groups = OpenStaffDetailFormDTO.Open.class) |
|||
private String customerId; |
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空", groups = OpenStaffDetailFormDTO.Open.class) |
|||
private String mobile; |
|||
public interface Open extends CustomerClientShowGroup {} |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 对外接口--查询工作人员基本信息-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class OpenStaffDetailResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 7129564173128153335L; |
|||
|
|||
//工作人员用户id
|
|||
private String staffId = ""; |
|||
//工作人员姓名
|
|||
private String staffName = ""; |
|||
//手机号
|
|||
private String mobile = ""; |
|||
//用户所属组织id
|
|||
private String agencyId = ""; |
|||
//用户所属组织全路径名称
|
|||
private String agencyAllName = ""; |
|||
//客户Id
|
|||
private String customerId = ""; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 个人中心-网格员巡查记录-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class PersonalPatrolListResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 7129564173128153335L; |
|||
|
|||
//巡查总次数;巡查总时长;立项事件数
|
|||
private String key; |
|||
//key对应值
|
|||
private String value; |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 组织机构信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-21 |
|||
*/ |
|||
@Data |
|||
public class ScreenCustomerAgencyDTO implements Serializable { |
|||
private static final long serialVersionUID = 6328123559936824470L; |
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 机关级别(社区级:community, |
|||
乡(镇、街道)级:street, |
|||
区县级: district, |
|||
市级: city |
|||
省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
/** |
|||
* 行政地区编码 |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
/** |
|||
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 |
|||
*/ |
|||
private String parentAreaCode; |
|||
} |
@ -0,0 +1,119 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dataaggre.dto.evaluationindex; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 网格(党支部)信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-26 |
|||
*/ |
|||
@Data |
|||
public class ScreenCustomerGridDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 网格所属组织id |
|||
*/ |
|||
private String parentAgencyId; |
|||
|
|||
/** |
|||
* 坐标区域 |
|||
*/ |
|||
private String areaMarks; |
|||
|
|||
/** |
|||
* 中心点位 |
|||
*/ |
|||
private String centerMark; |
|||
|
|||
/** |
|||
* 党支部(=网格)的位置 |
|||
*/ |
|||
private String partyMark; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) |
|||
*/ |
|||
private String dataEndTime; |
|||
|
|||
/** |
|||
* 所有上级ID,用英文逗号分开 |
|||
*/ |
|||
private String allParentIds; |
|||
private String pid; |
|||
private String pids; |
|||
|
|||
} |
@ -0,0 +1,161 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dataaggre.dto.evaluationindex; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 基层治理-治理能力排行数据(按月统计) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-24 |
|||
*/ |
|||
@Data |
|||
public class ScreenGovernRankDataDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 年Id |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月份Id |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 数据更新至:yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 组织类别 agency:组织;部门:department;网格:grid |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* 组织Id 可以为网格,机关id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 上级组织Id |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 响应率 |
|||
*/ |
|||
private BigDecimal responseRatio; |
|||
|
|||
/** |
|||
* 解决率 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 自治率 |
|||
*/ |
|||
private BigDecimal governRatio; |
|||
|
|||
/** |
|||
* 满意率 |
|||
*/ |
|||
private BigDecimal satisfactionRatio; |
|||
|
|||
/** |
|||
* 响应数 |
|||
*/ |
|||
private Integer responseCount; |
|||
/** |
|||
* 项目转入次数 |
|||
*/ |
|||
private Integer transferCount; |
|||
/** |
|||
* 解决项目数 |
|||
*/ |
|||
private Integer resolvedCount; |
|||
/** |
|||
* 已关闭项目数 |
|||
*/ |
|||
private Integer closedCount; |
|||
/** |
|||
* 自治项目数 |
|||
*/ |
|||
private Integer governCount; |
|||
/** |
|||
* 满意项目数 |
|||
*/ |
|||
private Integer satisfactionCount; |
|||
/** |
|||
* 已关闭项目(由议题转的项目)数 |
|||
*/ |
|||
private Integer closedProjectCount; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dataaggre.dto.govorg.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class GridMemberDataAnalysisFromDTO { |
|||
|
|||
public interface listGridMemberDatas {} |
|||
|
|||
private List<String> gridIds; |
|||
|
|||
// 搜索的人员姓名
|
|||
private String searchedStaffName; |
|||
private String month; |
|||
@NotBlank(message = "排序规则不能为空", groups = { listGridMemberDatas.class }) |
|||
private String sort; |
|||
private Integer pageNo = 1; |
|||
private Integer pageSize = 10; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dataaggre.dto.govorg.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class GridMemberDataAnalysisResultDTO { |
|||
|
|||
private String gridId; |
|||
private String staffId; |
|||
private String staffName; |
|||
private String orgName; |
|||
|
|||
private Integer projectCount; |
|||
private Integer issueToProjectCount; |
|||
private Integer closedIssueCount; |
|||
private Integer projectResponseCount; |
|||
private Integer projectTransferCount; |
|||
private Integer projectClosedCount; |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.epmet.dataaggre.enums; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
public enum GridMemberDataAnalysisEnums { |
|||
|
|||
SORT_SORT_PROJECT_COUNT("projectCount", "project_count"), |
|||
SORT_ISSUE_TO_PROJECT_COUNT("issueToProjectCount", "issue_to_project_count"), |
|||
SORT_CLOSED_ISSUE_COUNT("closedIssueCount", "closed_issue_count"), |
|||
SORT_PROJECT_RESPONSE_COUNT("projectResponseCount", "project_response_count"), |
|||
SORT_PROJECT_TRANSFER_COUNT("projectTransferCount", "project_transfer_count"), |
|||
SORT_PROJECT_CLOSED_COUNT("projectClosedCount", "project_closed_count"); |
|||
|
|||
private String key; |
|||
private String value; |
|||
|
|||
GridMemberDataAnalysisEnums(String key, String value) { |
|||
this.key = key; |
|||
this.value = value; |
|||
} |
|||
|
|||
public static GridMemberDataAnalysisEnums get(String key) { |
|||
for (GridMemberDataAnalysisEnums gm : GridMemberDataAnalysisEnums.values()) { |
|||
if (gm.key.equals(key)) { |
|||
return gm; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public String getKey() { |
|||
return key; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dataaggre.dao.datastats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; |
|||
import com.epmet.dataaggre.entity.datastats.FactGridMemberStatisticsDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 网格员数据统计_日统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-07-05 |
|||
*/ |
|||
@Mapper |
|||
public interface FactGridMemberStatisticsDailyDao extends BaseDao<FactGridMemberStatisticsDailyEntity> { |
|||
|
|||
/** |
|||
* @Description 查询网格员统计数据 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.05 13:19 |
|||
*/ |
|||
List<GridMemberDataAnalysisResultDTO > listGridMemberDataStats(@Param("gridIds") List<String> gridIds, |
|||
@Param("searchedStaffName") String searchedStaffName, |
|||
@Param("month") String month, |
|||
@Param("sort") String sort); |
|||
|
|||
/** |
|||
* @Description 查询网格员议题项目统计数据 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.05 16:17 |
|||
*/ |
|||
GridMemberDataAnalysisResultDTO getGridMemberIssueProjectStats(@Param("staffId") String staffId); |
|||
} |
@ -0,0 +1,174 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dataaggre.entity.datastats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 组织的治理指数,按天统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-24 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_agency_govern_daily") |
|||
public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据更新至:yyyyMMdd; |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* agency_id所属的机关级别(社区级:community, |
|||
乡(镇、街道)级:street, |
|||
区县级: district, |
|||
市级: city |
|||
省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
/** |
|||
* 组织i所属的组织id |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 组织i所有上级id |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 界面展示:问题解决总数=1+2+3+4+5+6+7+8 |
|||
*/ |
|||
private Integer problemResolvedCount; |
|||
|
|||
/** |
|||
* 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 |
|||
*/ |
|||
private BigDecimal groupSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private BigDecimal gridSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private BigDecimal communityClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private BigDecimal streetClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private BigDecimal districtDeptClosedRatio; |
|||
|
|||
/** |
|||
* 1、当前组织内,话题关闭已解决数 |
|||
*/ |
|||
private Integer topicResolvedCount; |
|||
|
|||
/** |
|||
* 2、当前组织内,话题关闭无需解决数 |
|||
*/ |
|||
private Integer topicUnResolvedCount; |
|||
|
|||
/** |
|||
* 3、当前组织内,议题关闭已解决数 |
|||
*/ |
|||
private Integer issueResolvedCount; |
|||
|
|||
/** |
|||
* 4、当前组织内,议题关闭无需解决数 |
|||
*/ |
|||
private Integer issueUnResolvedCount; |
|||
|
|||
/** |
|||
* 5、当前组织内:来源于议题的项目:结案已解决数 |
|||
*/ |
|||
private Integer issueProjectResolvedCount; |
|||
|
|||
/** |
|||
* 6、当前组织内:来源于议题的项目:结案无需解决数 |
|||
*/ |
|||
private Integer issueProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 7、当前组织内:项目立项,结案已解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectResolvedCount; |
|||
|
|||
/** |
|||
* 8、当前组织内:项目立项,结案无需解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 |
|||
*/ |
|||
private Integer inGroupTopicResolvedCount; |
|||
|
|||
/** |
|||
* 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 |
|||
*/ |
|||
private Integer inGroupTopicUnResolvedCount; |
|||
|
|||
/** |
|||
* 未出当前网格的,结案项目数 |
|||
*/ |
|||
private Integer gridSelfGovernProjectTotal; |
|||
|
|||
/** |
|||
* 当前组织内结案的项目中:由社区结案的项目总数 |
|||
*/ |
|||
private Integer communityClosedCount; |
|||
|
|||
/** |
|||
* 当前组织内结案的项目中:由街道结案的项目总数 |
|||
*/ |
|||
private Integer streetClosedCount; |
|||
|
|||
/** |
|||
* 当前组织内结案的项目中:由区直部门结案的项目总数 |
|||
*/ |
|||
private Integer districtDeptClosedCount; |
|||
|
|||
} |
@ -0,0 +1,131 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dataaggre.entity.datastats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 网格员数据统计_日统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-07-05 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_grid_member_statistics_daily") |
|||
public class FactGridMemberStatisticsDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 月份ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 年度ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 来源类型 external:外部,internal:内部 |
|||
*/ |
|||
private String sourceType; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据来源客户Id |
|||
*/ |
|||
private String sourceCustomerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格I |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 上级ID(项目来源Agency的上级组织Id) |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有agencyId的上级组织ID(包含agencyId) |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 工作人员ID |
|||
*/ |
|||
private String staffId; |
|||
|
|||
/** |
|||
* 工作人员姓名 |
|||
*/ |
|||
private String staffName; |
|||
|
|||
/** |
|||
* 项目立项数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 议题转项目数 |
|||
*/ |
|||
private Integer issueToProjectCount; |
|||
|
|||
/** |
|||
* 议题关闭数 |
|||
*/ |
|||
private Integer closedIssueCount; |
|||
|
|||
/** |
|||
* 项目响应数 |
|||
*/ |
|||
private Integer projectResponseCount; |
|||
|
|||
/** |
|||
* 项目吹哨数 |
|||
*/ |
|||
private Integer projectTransferCount; |
|||
|
|||
/** |
|||
* 项目结案数 |
|||
*/ |
|||
private Integer projectClosedCount; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dataaggre.service; |
|||
|
|||
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 聚合的网格相关service,不指定具体的数据源,它调用其他子service,子service中指定具体数据源 |
|||
* @author wxz |
|||
* @date 2021.07.05 13:06:35 |
|||
*/ |
|||
public interface AggreGridService { |
|||
/** |
|||
* @Description 网格员数据统计列表查询 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.07.05 11:17 |
|||
*/ |
|||
List<GridMemberDataAnalysisResultDTO> getGridMemberDataAnalysis(List<String> gridIds, String searchedStaffName, String currStaffId, String month, String sort, Integer pageNo, Integer pageSize); |
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.epmet.dataaggre.service.impl; |
|||
|
|||
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; |
|||
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; |
|||
import com.epmet.dataaggre.service.AggreGridService; |
|||
import com.epmet.dataaggre.service.datastats.DataStatsService; |
|||
import com.epmet.dataaggre.service.govorg.GovOrgService; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Service |
|||
public class AggreGridServiceImpl implements AggreGridService { |
|||
|
|||
@Autowired |
|||
private GovOrgService govOrgService; |
|||
|
|||
@Autowired |
|||
private DataStatsService dataStatsService; |
|||
|
|||
@Override |
|||
public List<GridMemberDataAnalysisResultDTO> getGridMemberDataAnalysis( |
|||
List<String> gridIds, |
|||
String searchedStaffName, |
|||
String currStaffId, |
|||
String month, |
|||
String sort, |
|||
Integer pageNo, |
|||
Integer pageSize) { |
|||
|
|||
//1.得到网格id列表
|
|||
Map<String, String> gridIdAndName = new HashMap<>(); |
|||
List<CustomerGridDTO> grids = govOrgService.getGridInfoList(gridIds, currStaffId); |
|||
grids.forEach(g -> { |
|||
gridIds.add(g.getId()); |
|||
gridIdAndName.put(g.getId(), g.getGridName()); |
|||
}); |
|||
|
|||
//2.查询列表,并且填充内容
|
|||
List<GridMemberDataAnalysisResultDTO> records = dataStatsService.listGridMemberDataStats(gridIds, searchedStaffName, month, sort, pageNo, pageSize); |
|||
records.forEach(r -> r.setOrgName(gridIdAndName.get(r.getGridId()))); |
|||
return records; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,133 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao"> |
|||
|
|||
<resultMap type="com.epmet.dataaggre.entity.datastats.FactGridMemberStatisticsDailyEntity" id="factGridMemberStatisticsDailyMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="dateId" column="DATE_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="staffId" column="STAFF_ID"/> |
|||
<result property="staffName" column="STAFF_NAME"/> |
|||
<result property="projectCount" column="PROJECT_COUNT"/> |
|||
<result property="issueToProjectCount" column="ISSUE_TO_PROJECT_COUNT"/> |
|||
<result property="closedIssueCount" column="CLOSED_ISSUE_COUNT"/> |
|||
<result property="projectResponseCount" column="PROJECT_RESPONSE_COUNT"/> |
|||
<result property="projectTransferCount" column="PROJECT_TRANSFER_COUNT"/> |
|||
<result property="projectClosedCount" column="PROJECT_CLOSED_COUNT"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<sql id="allColumns"> |
|||
member.id, |
|||
member.date_id, |
|||
member.month_id, |
|||
member.year_id, |
|||
member.customer_id, |
|||
member.agency_id, |
|||
member.grid_id, |
|||
member.pid, |
|||
member.pids, |
|||
member.staff_id, |
|||
member.staff_name, |
|||
member.project_count, |
|||
member.issue_to_project_count, |
|||
member.closed_issue_count, |
|||
member.project_response_count, |
|||
member.project_transfer_count, |
|||
member.project_closed_count, |
|||
member.project_incr, |
|||
member.issue_to_project_incr, |
|||
member.closed_issue_incr, |
|||
member.project_response_incr, |
|||
member.project_transfer_incr, |
|||
member.project_closed_incr, |
|||
member.del_flag, |
|||
member.revision, |
|||
member.created_by, |
|||
member.created_time, |
|||
member.updated_by, |
|||
member.updated_time |
|||
</sql> |
|||
|
|||
<!--查询网格员统计数据--> |
|||
<!--查询网格员统计数据--> |
|||
<select id="listGridMemberDataStats" |
|||
resultType="com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO"> |
|||
select member.id, |
|||
member.date_id, |
|||
member.month_id, |
|||
member.year_id, |
|||
member.customer_id, |
|||
member.agency_id, |
|||
member.grid_id, |
|||
member.pid, |
|||
member.pids, |
|||
member.staff_id, |
|||
member.staff_name, |
|||
|
|||
sum(member.project_incr) project_count, |
|||
sum(member.issue_to_project_incr) issue_to_project_count, |
|||
sum(member.closed_issue_incr) closed_issue_count, |
|||
sum(member.project_response_incr) project_response_count, |
|||
sum(member.project_transfer_incr) project_transfer_count, |
|||
sum(member.project_closed_incr) project_closed_count |
|||
from fact_grid_member_statistics_daily member |
|||
<where> |
|||
<if test="gridIds != null and gridIds.size() > 0"> |
|||
<foreach collection="gridIds" item="gridId" separator="OR" open="(" close=")"> |
|||
member.GRID_ID = #{gridId} |
|||
</foreach> |
|||
</if> |
|||
<if test="searchedStaffName != null and searchedStaffName != ''"> |
|||
and member.STAFF_NAME like CONCAT('%',#{searchedStaffName},'%') |
|||
</if> |
|||
<if test="month != null and month != ''"> |
|||
and member.MONTH_ID = #{month} |
|||
</if> |
|||
and del_flag = 0 |
|||
</where> |
|||
group by member.staff_id, member.grid_id |
|||
order by ${sort} desc, convert(member.staff_name using gbk) asc, member.GRID_ID asc |
|||
</select> |
|||
|
|||
<select id="getGridMemberIssueProjectStats" |
|||
resultType="com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO"> |
|||
SELECT member.id, |
|||
member.date_id, |
|||
member.month_id, |
|||
member.year_id, |
|||
member.customer_id, |
|||
member.agency_id, |
|||
member.grid_id, |
|||
member.pid, |
|||
member.pids, |
|||
member.staff_id, |
|||
member.staff_name, |
|||
sum(member.project_count) project_count, |
|||
sum(member.issue_to_project_count) issue_to_project_count, |
|||
sum(member.closed_issue_count) closed_issue_count, |
|||
sum(member.project_response_count) project_response_count, |
|||
sum(member.project_transfer_count) project_transfer_count, |
|||
sum(member.project_closed_count) project_closed_count |
|||
FROM fact_grid_member_statistics_daily member |
|||
inner join (select max(mt.DATE_ID) latest_date |
|||
from fact_grid_member_statistics_daily mt |
|||
where mt.STAFF_ID = #{staffId} and mt.del_flag=0) latest_record |
|||
on (member.DATE_ID = latest_record.latest_date) |
|||
WHERE member.STAFF_ID = #{staffId} |
|||
and member.DEL_FLAG = 0 |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* screen_customer_agency |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/7/13 15:31 |
|||
*/ |
|||
@Data |
|||
public class ScreenCustomerAgencyCommonDTO implements Serializable { |
|||
private static final long serialVersionUID = -6222325433226628163L; |
|||
private String agencyId; |
|||
private String agencyName; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* screen_customer_grid |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/7/13 15:32 |
|||
*/ |
|||
@Data |
|||
public class ScreenCustomerGridCommonDTO implements Serializable { |
|||
private static final long serialVersionUID = -4405092094598416917L; |
|||
private String gridId; |
|||
private String gridName; |
|||
} |
@ -0,0 +1,119 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 网格(党支部)信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-26 |
|||
*/ |
|||
@Data |
|||
public class ScreenCustomerGridDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 网格所属组织id |
|||
*/ |
|||
private String parentAgencyId; |
|||
|
|||
/** |
|||
* 坐标区域 |
|||
*/ |
|||
private String areaMarks; |
|||
|
|||
/** |
|||
* 中心点位 |
|||
*/ |
|||
private String centerMark; |
|||
|
|||
/** |
|||
* 党支部(=网格)的位置 |
|||
*/ |
|||
private String partyMark; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) |
|||
*/ |
|||
private String dataEndTime; |
|||
|
|||
/** |
|||
* 所有上级ID,用英文逗号分开 |
|||
*/ |
|||
private String allParentIds; |
|||
private String pid; |
|||
private String pids; |
|||
private String areaCode; |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 工作端小程序-数据上面的 当前组织调用此接口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/6/24 15:26 |
|||
*/ |
|||
@Data |
|||
public class AgencyDetailMulticFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 6603177626712295270L; |
|||
/** |
|||
* 内部错误分组 |
|||
* */ |
|||
public interface AddUserInternalGroup{} |
|||
|
|||
/** |
|||
* 机关组织Id |
|||
*/ |
|||
@NotBlank(message = "机关组织ID不能为空" , groups = {AddUserInternalGroup.class}) |
|||
private String agencyId; |
|||
|
|||
|
|||
/** |
|||
* 当前登录用户所属的客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.epmet.dto.form.project; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 群众不满列表查询入参DTO,从指标库取值 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/6/24 10:55 |
|||
*/ |
|||
@Data |
|||
public class MassesDiscontentFormV2DTO implements Serializable { |
|||
public interface MassesDiscontentFormV2 { |
|||
} |
|||
|
|||
/** |
|||
* 时间区间,三个月:threeMonth;半年:sixMonth;一年:twelveMonth |
|||
* 一个月按照30天,三个月90天,半年180天,一年365天 |
|||
*/ |
|||
@NotBlank(message = "timeSection不能为空,取值:三个月:threeMonth;半年:sixMonth;一年:twelveMonth", groups = MassesDiscontentFormV2.class) |
|||
private String timeSection; |
|||
|
|||
/** |
|||
* asc:分数由低到高 |
|||
* desc:分数由高到低 |
|||
*/ |
|||
@NotBlank(message = "sortType不能为空,取值:asc:分数由低到高;desc:分数由高到低", groups = MassesDiscontentFormV2.class) |
|||
private String sortType; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
@NotBlank(message = "agencyId不能为空", groups = MassesDiscontentFormV2.class) |
|||
private String agencyId; |
|||
|
|||
@NotNull(message = "pageNo不能为空", groups = MassesDiscontentFormV2.class) |
|||
private Integer pageNo; |
|||
|
|||
@NotNull(message = "pageSize不能为空", groups = MassesDiscontentFormV2.class) |
|||
private Integer pageSize; |
|||
|
|||
/** |
|||
* 当前agency对应的区域编码,由前端传入,前端从/data/report/screen/agency/agencydetail这取值 |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
|
|||
|
|||
|
|||
//以下属性无需前端传入
|
|||
private String startDate; |
|||
private String endDate; |
|||
} |
@ -0,0 +1,104 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/6/24 15:31 |
|||
*/ |
|||
@Data |
|||
public class AgencyDetailMulticResultDTO implements Serializable { |
|||
/** |
|||
* 机关组织Id |
|||
*/ |
|||
private String agencyId = ""; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName = ""; |
|||
|
|||
/** |
|||
* 机关级别(社区级:community, |
|||
* 乡(镇、街道)级:street, |
|||
* 区县级: district, |
|||
* 市级: city |
|||
* 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) |
|||
*/ |
|||
private String level = ""; |
|||
|
|||
/** |
|||
* 地区编码 |
|||
*/ |
|||
private String areaCode = ""; |
|||
|
|||
/** |
|||
* 【省份】名称 |
|||
*/ |
|||
private String province = ""; |
|||
|
|||
/** |
|||
* 【城市】名称 |
|||
*/ |
|||
private String city = ""; |
|||
|
|||
/** |
|||
* 【区县】名称 |
|||
*/ |
|||
private String district = ""; |
|||
|
|||
/** |
|||
* 本机关的所有上级机关 |
|||
*/ |
|||
private List<ParentListResultDTO> parentList; |
|||
|
|||
/** |
|||
* 街道 |
|||
*/ |
|||
private String street=""; |
|||
|
|||
/** |
|||
* 社区 |
|||
*/ |
|||
private String community=""; |
|||
|
|||
/** |
|||
* open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参 |
|||
*/ |
|||
private String areaCodeSwitch; |
|||
|
|||
/** |
|||
* 组织区划的名称 |
|||
*/ |
|||
private String areaName; |
|||
|
|||
/** |
|||
* 当前组织对应客户根组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) |
|||
*/ |
|||
private String rootlevel; |
|||
|
|||
|
|||
//以下参数是06.24新增
|
|||
private String rootAgencyId; |
|||
private String parentAreaCode; |
|||
/** |
|||
* 是否有字客户 |
|||
*/ |
|||
private Boolean haveSubCustomer; |
|||
|
|||
/** |
|||
* 子客户列表 |
|||
*/ |
|||
private List<String> subCustomerIds; |
|||
|
|||
// @JsonIgnore
|
|||
/** |
|||
* 当前agencyId所属的客户id |
|||
*/ |
|||
private String customerId; |
|||
} |
@ -0,0 +1,46 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 组织首页-获取组织机构信息接口-本机关的所有上级机关信息 |
|||
* |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class ParentListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 机关组织Id |
|||
*/ |
|||
private String id = ""; |
|||
/** |
|||
* 机关组织名称 |
|||
*/ |
|||
private String name = ""; |
|||
|
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.epmet.dto.result.project; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 群众不满列表查询返参DTO,从指标库取值 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/6/24 11:02 |
|||
*/ |
|||
@Data |
|||
public class MassesDiscontentResultV2DTO implements Serializable { |
|||
private static final long serialVersionUID = 403953150174574960L; |
|||
/** |
|||
* 项目ID |
|||
*/ |
|||
private String projectId; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 话题所在网格 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 话题图片 |
|||
*/ |
|||
private List<String> photos; |
|||
|
|||
/** |
|||
* 话题内容 |
|||
*/ |
|||
private String topicContent; |
|||
|
|||
/** |
|||
* 项目分类标签 |
|||
*/ |
|||
private String projectCategory; |
|||
|
|||
/** |
|||
* 项目评价分数 |
|||
* 直接取整数位展示 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
@JsonIgnore |
|||
private String customerId; |
|||
@JsonIgnore |
|||
private String parentAgencyId; |
|||
@JsonIgnore |
|||
private String areaCode; |
|||
|
|||
public MassesDiscontentResultV2DTO() { |
|||
this.gridName = ""; |
|||
this.photos = new ArrayList<>(); |
|||
this.topicContent = ""; |
|||
this.projectCategory = ""; |
|||
} |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue