Browse Source

Merge remote-tracking branch 'remotes/origin/develop' into release_temp

master
jianjun 4 years ago
parent
commit
6eecc1d64e
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 2
      epmet-gateway/pom.xml
  3. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoDetailResDTO.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyInfoGroupResultDTO.java
  5. 1
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MySentResDTO.java
  6. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  7. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml
  9. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml
  10. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  11. 94
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListYuShanResultDTO.java
  12. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java
  13. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java
  14. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java
  15. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java
  17. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java
  18. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerStaffGridDao.xml
  20. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml
  21. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  22. 4
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java
  23. 44
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java
  24. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.14__create_info_table.sql
  25. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  26. 2
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml
  27. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java
  28. 18
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/LastTextDTO.java
  29. 59
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/MyGroupV2ResultDTO.java
  30. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  31. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  32. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  33. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  34. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java
  35. 90
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  36. 30
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolYuShanResultDTO.java
  37. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  38. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  39. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
  40. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
  41. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
  42. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
  43. 13
      epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -107,6 +107,7 @@ public enum EpmetErrorCode {
REPLY_INFO_CONTENT_NOT_NULL(8610,"回复内容不能为空"),
PLEASE_CHOOSE_MEMBER(8611,"请选择成员"),
INFO_GROUP_NAME_EXISTS(8612,"名称已存在"),
INFO_REPLY_CONTENT_LENGTH_LIMIT(8613,"回复内容最多输入500字"),
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),

2
epmet-gateway/pom.xml

@ -299,7 +299,7 @@
<!-- <gateway.routes.resi-mine-server.uri>http://localhost:8094</gateway.routes.resi-mine-server.uri>-->
<gateway.routes.resi-mine-server.uri>lb://resi-mine-server</gateway.routes.resi-mine-server.uri>
<!-- 16、居民端楼院校组 -->
<!-- <gateway.routes.resi-group-server.uri>http://localhost:8095</gateway.routes.resi-group-server.uri>-->
<!-- <gateway.routes.resi-group-server.uri>http://localhost:8095</gateway.routes.resi-group-server.uri>-->
<gateway.routes.resi-group-server.uri>lb://resi-group-server</gateway.routes.resi-group-server.uri>
<!-- 17、党员认证、热心居民申请 -->
<!-- <gateway.routes.resi-partymember-server.uri>http://localhost:8096</gateway.routes.resi-partymember-server.uri>-->

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoDetailResDTO.java

@ -35,7 +35,7 @@ public class InfoDetailResDTO implements Serializable {
/**
* 发布人2级组织名
*/
private String publishOrgName;
private String publishStaffOrgName;
/**
* 发布人性别

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyInfoGroupResultDTO.java

@ -16,7 +16,7 @@ public class MyInfoGroupResultDTO implements Serializable {
private static final long serialVersionUID = 3621868560778309056L;
private String receiverGroupId;
private String name;
private Integer totalMem;
private Integer staffNum;
@JsonIgnore
private List<String> staffIdList;
private List<String> staffNameList;

1
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MySentResDTO.java

@ -23,6 +23,7 @@ public class MySentResDTO implements Serializable {
private Integer totalReceiver;
private Integer readTotal;
private String firstAttId;
private Integer unReadReplyNum;
/**
* 附件列表 列表默认返回一个
*/

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java

@ -79,10 +79,13 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
dto.setStaffId(item.getStaffId());
dto.setReadFlag(item.getReadFlag());
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setStaffName(staffInfoCache.getRealName());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setOrgName(staffInfoCache.getTwoOrgName());
if (null != staffInfoCache) {
dto.setStaffName(staffInfoCache.getRealName());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setOrgName(staffInfoCache.getTwoOrgName());
}
return dto;
}).collect(Collectors.toList());
result.setDataList(dataList);
@ -258,7 +261,7 @@ public class EpmetMessageServiceImpl implements EpmetMessageService {
if(StringUtils.isNotBlank(resDTO.getPublishStaffId())){
CustomerStaffInfoCacheResult publisher = CustomerStaffRedis.getStaffInfo(infoIdDTO.getCustomerId(), resDTO.getPublishStaffId());
resDTO.setHeadPhoto(StringUtils.isNotBlank(publisher.getHeadPhoto()) ? publisher.getHeadPhoto() : StrConstant.EPMETY_STR);
resDTO.setPublishOrgName(publisher.getTwoOrgName());
resDTO.setPublishStaffOrgName(publisher.getTwoOrgName());
resDTO.setPublishStaffGender(publisher.getGender().toString());
resDTO.setPublishStaffName(publisher.getRealName());
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -483,9 +483,12 @@ public class EpmetUserServiceImpl implements EpmetUserService {
}
return staffRoleList.stream().map(item -> {
RoleUsersResultDTO dto = new RoleUsersResultDTO();
dto.setStaffId(item.getStaffId());
//从redis获取用户信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
if (null == staffInfoCache) {
return null;
}
dto.setStaffId(item.getStaffId());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setName(staffInfoCache.getRealName());

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml

@ -10,6 +10,7 @@
<result property="totalReceiver" column="total_receiver"/>
<result property="readTotal" column="read_total"/>
<result property="firstAttId" column="first_att_id"/>
<result property="unReadReplyNum" column="UN_READ_REPLY_NUM"></result>
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" >
<result property="name" column="name"/>
<result property="url" column="url"/>
@ -29,6 +30,7 @@
ip.total_receiver,
ip.read_total,
ip.first_att_id,
ip.UN_READ_REPLY_NUM,
ia.ATTACHMENT_NAME AS name,
ia.ATTACHMENT_FORMAT AS format,
ia.ATTACHMENT_TYPE AS type,

6
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml

@ -6,7 +6,7 @@
<resultMap id="MyInfoGroupResultDTOMap" type="com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO">
<id property="receiverGroupId" column="receiverGroupId" />
<result property="name" column="name"/>
<result property="totalMem" column="totalMem"/>
<result property="staffNum" column="staffNum"/>
<collection property="staffIdList" ofType="java.lang.String">
<result column="staffId"/>
</collection>
@ -16,14 +16,14 @@
SELECT
irg.ID as receiverGroupId,
irg.`NAME` as name,
( SELECT count( igr.id ) FROM info_group_receivers igr WHERE igr.DEL_FLAG = '0' AND igr.info_receiver_group_id = irg.id ) AS totalMem,
( SELECT count( igr.id ) FROM info_group_receivers igr WHERE igr.DEL_FLAG = '0' AND igr.info_receiver_group_id = irg.id ) AS staffNum,
igr.STAFF_ID as staffId
FROM
info_receiver_group irg
left join info_group_receivers igr
on(irg.id=igr.info_receiver_group_id and igr.DEL_FLAG='0')
WHERE
irg.del_flag='0'
AND irg.CREATE_STAFF_ID = #{staffId}
AND irg.CUSTOMER_ID = #{customerId}
<if test="null != receiverGroupId and receiverGroupId !=''">

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -100,7 +100,7 @@
customer_agency ca
LEFT JOIN (
SELECT
a.PIDS,
CONCAT( a.PIDS,':',a.ID) AS PIDS,
b.USER_ID
FROM
customer_agency a

94
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListYuShanResultDTO.java

@ -0,0 +1,94 @@
package com.epmet.user.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/7 2:57 下午
* @DESC
*/
@Data
public class GridManagerListYuShanResultDTO implements Serializable {
private static final long serialVersionUID = -2770911125810373090L;
/**
* 工作人员id
*/
private String staffId;
/**
* 工作人员手机号
*/
private String mobile;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 网格ID
*/
private String gridId;
/**
* 正在巡查patrolling否则返回空字符串
*/
private String status;
/**
* 网格名称最多显示上两级
*/
private String gridName;
/**
* 姓名
*/
private String staffName;
/**
* 巡查时长
*/
private Integer patrolDuration;
/**
* 巡查次数
*/
private Integer patrolCount;
/**
* 中心点位
*/
@JsonIgnore
private String centerMark;
/**
* 经纬度赋值状态
*/
@JsonIgnore
private Boolean llStatus;
public GridManagerListYuShanResultDTO() {
this.staffId = "";
this.longitude = "";
this.latitude = "";
this.gridId = "";
this.status = "";
this.gridName = "";
this.staffName = "";
this.centerMark = "";
this.llStatus = false;
this.patrolDuration = NumConstant.ZERO;
this.patrolCount = NumConstant.ZERO;
}
}

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java

@ -11,6 +11,7 @@ import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import com.epmet.user.result.GridManagerListYuShanResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -77,4 +78,16 @@ public class StaffPatrolDetailController {
return new Result<PatrolCountResultDTO>().ok(staffPatrolService.patrolCount(formDTO));
}
/**
* @Description 网格员分布-榆山
* @Param formDTO
* @author zxc
* @date 2021/8/25 3:00 下午
*/
@PostMapping("gridmanagerlist-yushan")
public Result<List<GridManagerListYuShanResultDTO>> gridManagerListYuShan(@RequestBody GridManagerListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GridManagerListFormDTO.GridManagerListForm.class);
return new Result<List<GridManagerListYuShanResultDTO>>().ok(staffPatrolService.gridManagerListYuShan(formDTO));
}
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java

@ -8,6 +8,7 @@ import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import com.epmet.user.result.GridManagerListYuShanResultDTO;
import java.util.List;
@ -27,6 +28,14 @@ public interface StaffPatrolDetailService{
*/
List<GridManagerListResultDTO> gridManagerList(GridManagerListFormDTO formDTO);
/**
* @Description 网格员分布-榆山
* @Param formDTO
* @author zxc
* @date 2021/8/25 3:00 下午
*/
List<GridManagerListYuShanResultDTO> gridManagerListYuShan(GridManagerListFormDTO formDTO);
/**
* @Description 002查看巡查记录
* @Param formDTO

29
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java

@ -19,6 +19,7 @@ import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.dto.form.PatrolCountFormDTO;
import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import com.epmet.user.result.GridManagerListYuShanResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -136,6 +137,34 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
return result;
}
/**
* @Description 网格员分布-榆山
* @Param formDTO
* @author zxc
* @date 2021/8/25 3:00 下午
*/
@Override
public List<GridManagerListYuShanResultDTO> gridManagerListYuShan(GridManagerListFormDTO formDTO) {
List<GridManagerListResultDTO> resultTwo = this.gridManagerList(formDTO);
List<GridManagerListYuShanResultDTO> result = ConvertUtils.sourceToTarget(resultTwo, GridManagerListYuShanResultDTO.class);
Result<List<PatrolYuShanResultDTO>> listResult = epmetUserOpenFeignClient.patrolInfo(formDTO.getAgencyId());
if (!listResult.success()){
throw new RenException("查询巡查次数和时长失败");
}
List<PatrolYuShanResultDTO> data = listResult.getData();
if (!CollectionUtils.isEmpty(data)){
result.forEach(r -> {
data.forEach(d -> {
if (r.getGridId().equals(d.getGridId()) && r.getStaffId().equals(d.getStaffId())){
r.setPatrolCount(d.getPatrolCount());
r.setPatrolDuration(d.getPatrolDuration());
}
});
});
}
return result;
}
/**
* @Description 根据中心点位截取经纬度
* @Param centMark

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -341,7 +341,7 @@
AND cg.AREA_CODE LIKE CONCAT(#{areaCode},'%')
</if>
<if test="agencyId != null and agencyId != ''">
AND cg.ALL_PARENT_IDS LIKE CONCAT(#{agencyId}, '%')
AND cg.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId}, '%')
</if>
</select>

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java

@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
public class RequestLogAspect extends BaseRequestLogAspect {
@Override
@Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ")
@Around(value = "execution(* com.epmet.controller..*Controller*.*(..)) ")
public Object proceed(ProceedingJoinPoint point) throws Throwable {
return super.proceed(point, getRequest());
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java

@ -2,7 +2,6 @@ package com.epmet.mq;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
@ -12,8 +11,6 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.epmet.util.DimIdGenerator;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@ -23,7 +20,6 @@ import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import javax.annotation.PreDestroy;
import java.util.Date;
@ -119,11 +115,12 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently
extractOriginFormDTO.setDateId(dateId);
Future<?> aBoolean = SpringContextUtils.getBean(FactOriginExtractService.class).submitProjectRelationData(extractOriginFormDTO,null);
try {
aBoolean.get();
Object o = aBoolean.get();
log.info("submitProjectRelationData result:{}",o);
} catch (InterruptedException e) {
e.printStackTrace();
log.error("submitProjectRelationData tread InterruptedException",e);
} catch (ExecutionException e) {
e.printStackTrace();
log.error("submitProjectRelationData tread ExecutionException",e);
}
if (aBoolean.isDone()){
// 指标库,实时数据只更新:【screen_project_data】

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

@ -91,6 +91,7 @@
UNION ALL
SELECT
c.CUSTOMER_ID,
c.CUSTOMER_ID AS categoryOriginCustomerId,
left(c.CATEGORY_CODE, 4) AS CATEGORY_CODE,
'1' AS `LEVEL`,
p.AGENCY_ID AS orgId,

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerStaffGridDao.xml

@ -16,7 +16,7 @@
grid.PIDS gridPids
FROM
customer_staff_grid sg
LEFT JOIN customer_grid grid ON grid.id = sg.grid_id
LEFT JOIN customer_grid grid ON grid.id = sg.grid_id AND grid.DEL_FLAG = '0'
WHERE
sg.del_flag = '0'

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml

@ -10,14 +10,18 @@
GRID_ID,
USER_ID,
ID_CARD,
STR_TO_DATE( SUBSTRING( ID_CARD, 7, 8 ),'%Y%m%d') AS birthday
(
case when LENGTH(ID_CARD)=15 then STR_TO_DATE( concat('19',SUBSTRING( ID_CARD, 7, 6 )),'%Y%m%d')
else STR_TO_DATE( SUBSTRING( ID_CARD, 7, 8 ),'%Y%m%d')
end
)as birthday
FROM
partymember_info
WHERE
DEL_FLAG = 0
AND ( CONFIRM_RESULT = 'auto_confirm_success' OR CONFIRM_RESULT = 'approved' )
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( UPDATED_TIME, '%Y%m%d' ) = #{dateId}
AND ( CONFIRM_RESULT = 'auto_confirm_success' OR CONFIRM_RESULT = 'approved' )
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( UPDATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
<select id="selectPartyMemberByCustomer" resultType="com.epmet.dto.party.PartyMemberDTO">

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -588,18 +588,19 @@
AND sr.CUSTOMER_ID = #{customerId}
</select>
<select id="selectUserByRoleKey" resultType="com.epmet.dto.user.result.CustomerStaffDTO">
SELECT DISTINCT
s.USER_ID,
SELECT
s.*,
gsr.ROLE_NAME
FROM
customer_staff s
LEFT JOIN staff_role sr ON sr.STAFF_ID = s.USER_ID
LEFT JOIN staff_role sr ON sr.STAFF_ID = s.USER_ID AND sr.DEL_FLAG = '0'
AND sr.CUSTOMER_ID = s.CUSTOMER_ID
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = '0'
WHERE
s.del_flag = '0'
AND gsr.CUSTOMER_ID = #{customerId}
AND gsr.ROLE_KEY = #{roleKey}
GROUP BY s.USER_ID
</select>
<select id="selectLastStaffPatrolList" resultType="com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO">
SELECT

4
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java

@ -18,6 +18,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -56,6 +57,7 @@ public class InfoController {
* @author yinzuomei
* @date 2021/8/19 10:25 上午
*/
@NoRepeatSubmit
@PostMapping("send")
public Result<SendInfoResultDTO> sendInfo(@LoginUser TokenDto tokenDto, @RequestBody SendInfoFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -91,6 +93,7 @@ public class InfoController {
* @author yinzuomei
* @date 2021/8/19 5:29 下午
*/
@NoRepeatSubmit
@PostMapping("reply-info")
public Result<ReplyInfoResultDTO> replyInfo(@LoginUser TokenDto tokenDto, @RequestBody ReplyInfoFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -127,6 +130,7 @@ public class InfoController {
* @author yinzuomei
* @date 2021/8/20 9:58 上午
*/
@NoRepeatSubmit
@PostMapping("add-receivergroup")
public Result<AddReceiverGroupResultDTO> addReceiverGroup(@LoginUser TokenDto tokenDto, @RequestBody AddReceiverGroupFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());

44
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java

@ -17,12 +17,12 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
@ -99,7 +99,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
Set<String> orgStaffIds=queryOrgStaffIds(formDTO.getCustomerId(),formDTO.getOrgList());
Set<String> roleStaffIds=queryRoleStaffIds(formDTO.getRoleIdList(),formDTO.getCustomerId());
Set<String> groupStaffIds = CollectionUtils.isNotEmpty(formDTO.getGroupIdList()) ? infoGroupReceiversDao.selectStaffIds(formDTO.getGroupIdList()) : Collections.EMPTY_SET;
log.info("群组选择的人:"+JSON.toJSONString(groupStaffIds,true));
//log.info("群组选择的人:"+JSON.toJSONString(groupStaffIds,true));
//3、计算接收人:
Set<String> totalReceiver=new LinkedHashSet<String>();
@ -156,8 +156,8 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
userMessageEntity.setApp(AppClientConstant.APP_GOV);
userMessageEntity.setTitle(UserMessageConstans.INFO_TITLE);
userMessageEntity.setMessageContent(String.format(UserMessageConstans.INFO_CONTENT_TEMP,
infoEntity.getContent().length() >= NumConstant.FIFTY ?
StringUtils.substring(infoEntity.getContent(), NumConstant.FORTY_NINE) : infoEntity.getContent()));
infoEntity.getContent().length() > NumConstant.FIFTY ?
StringUtils.substring(infoEntity.getContent(), NumConstant.ZERO,NumConstant.FORTY_NINE) : infoEntity.getContent()));
userMessageEntity.setReadFlag(UserMessageConstans.UNREAD);
userMessageEntity.setMessageType(UserMessageConstans.MESSAGE_TYPE_INFO);
userMessageEntity.setTargetId(infoEntity.getId());
@ -170,7 +170,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
InfoProfileEntity infoProfileEntity=new InfoProfileEntity();
infoProfileEntity.setCustomerId(formDTO.getCustomerId());
infoProfileEntity.setInfoId(infoEntity.getId());
infoProfileEntity.setContent(infoEntity.getContent().length() >= NumConstant.FIFTY ? StringUtils.substring(infoEntity.getContent(), NumConstant.FORTY_NINE) : infoEntity.getContent());
infoProfileEntity.setContent(infoEntity.getContent().length() > NumConstant.ONE_HUNDRED ? StringUtils.substring(infoEntity.getContent(), NumConstant.ZERO,NumConstant.NINETY_NINE) : infoEntity.getContent());
infoProfileEntity.setPublishStaffId(formDTO.getUserId());
infoProfileEntity.setTotalReceiver(totalReceiver.size());
infoProfileEntity.setFirstAttId(firstAttId);
@ -222,10 +222,14 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
@Override
public ReplyInfoResultDTO replyInfo(ReplyInfoFormDTO formDTO) {
//1、插入回复记录、回复附件
//内容和附件 2选一
// 2、内容和附件 2选一
if(StringUtils.isBlank(formDTO.getContent())&&CollectionUtils.isEmpty(formDTO.getAttachmentList())){
throw new RenException(EpmetErrorCode.REPLY_INFO_CONTENT_NOT_NULL.getCode(), EpmetErrorCode.REPLY_INFO_CONTENT_NOT_NULL.getMsg());
}
// 3、回复内容不能超过500字
if(StringUtils.isNotBlank(formDTO.getContent())&&formDTO.getContent().length()>500){
throw new RenException(EpmetErrorCode.INFO_REPLY_CONTENT_LENGTH_LIMIT.getCode(), EpmetErrorCode.INFO_REPLY_CONTENT_LENGTH_LIMIT.getMsg());
}
InfoReplyEntity infoReplyEntity=new InfoReplyEntity();
infoReplyEntity.setInfoId(formDTO.getInfoId());
infoReplyEntity.setCustomerId(formDTO.getCustomerId());
@ -233,14 +237,14 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
infoReplyDao.insert(infoReplyEntity);
int sort=1;
if(StringUtils.isNotBlank(formDTO.getContent())){
InfoReplyContentEntity contentEntity=new InfoReplyContentEntity();
contentEntity.setCustomerId(formDTO.getCustomerId());
contentEntity.setInfoReplyId(infoReplyEntity.getId());
contentEntity.setReplyType("text");
contentEntity.setContent(formDTO.getContent());
contentEntity.setSort(sort);
infoReplyContentDao.insert(contentEntity);
sort++;
InfoReplyContentEntity contentEntity=new InfoReplyContentEntity();
contentEntity.setCustomerId(formDTO.getCustomerId());
contentEntity.setInfoReplyId(infoReplyEntity.getId());
contentEntity.setReplyType("text");
contentEntity.setContent(formDTO.getContent());
contentEntity.setSort(sort);
infoReplyContentDao.insert(contentEntity);
sort++;
}
if(CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){
for(FileCommonDTO att:formDTO.getAttachmentList()) {
@ -353,11 +357,11 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
OrgStaffFormDTO orgStaffFormDTO=new OrgStaffFormDTO();
orgStaffFormDTO.setCustomerId(customerId);
for(OrgCommonDTO org:orgList){
if("grid".equals(org.getOrgType())){
orgStaffFormDTO.getGridIds().add(org.getOrgId());
}else if("agency".equals(org.getOrgType())){
if(OrgTypeEnum.GRID.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getGridIds().add(org.getOrgId());
}else if(OrgTypeEnum.AGENCY.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getAgencyIds().add(org.getOrgId());
}else if("dept".equals(org.getOrgType())){
}else if(OrgTypeEnum.DEPT.getCode().equals(org.getOrgType())){
orgStaffFormDTO.getDeptIds().add(org.getOrgId());
}
}
@ -366,7 +370,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
throw new RenException("根据组织查询工作人员异常");
}
if(CollectionUtils.isEmpty(result.getData())){
log.info("已选择的架构里没有工作人员");
log.warn("已选择的架构里没有工作人员");
return Collections.EMPTY_SET;
}
return result.getData();
@ -393,7 +397,7 @@ public class InfoServiceImpl extends BaseServiceImpl<InfoDao, InfoEntity> implem
throw new RenException("根据角色查询工作人员异常");
}
if(CollectionUtils.isEmpty(result.getData())){
log.info("角色下没有工作人员");
log.warn("角色下没有工作人员");
return Collections.EMPTY_SET;
}
return result.getData();

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.14__create_info_table.sql

@ -127,7 +127,7 @@ CREATE TABLE `info_reply_content` (
`ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名',
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)',
`REPLY_TYPE` varchar(64) NOT NULL COMMENT '回复的类型(文本-text、图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`CONTENT` varchar(255) NOT NULL COMMENT '如果是文本对应的是文字,如果是其他类型,对应的是url',
`CONTENT` varchar(512) NOT NULL COMMENT '如果是文本对应的是文字,如果是其他类型,对应的是url',
`SORT` int(1) NOT NULL COMMENT '排序字段',
`ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b',
`DURATION` int(11) unsigned DEFAULT '0' COMMENT '语音或视频时长,秒',

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -158,6 +158,17 @@ public class StaffServiceImpl implements StaffService {
//机关总人数加一
customerAgencyEntity.setTotalUser(customerAgencyEntity.getTotalUser() + 1);
customerAgencyService.updateById(customerAgencyEntity);
//2021.8.25 sun 新增一张工作人员注册组织关系表,所以旧接口新增人员时关系表赋值关系数据
//工作人员注册组织关系表新增数据
StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity();
staffOrgRelationEntity.setCustomerId(fromDTO.getCustomerId());
staffOrgRelationEntity.setPids(("".equals(customerAgencyEntity.getPids()) ? "" : customerAgencyEntity.getPids()));
staffOrgRelationEntity.setStaffId(result.getData().getUserId());
staffOrgRelationEntity.setOrgId(customerAgencyEntity.getId());
staffOrgRelationEntity.setOrgType("agency");
staffOrgRelationService.insert(staffOrgRelationEntity);
return new Result();
}
@ -426,7 +437,7 @@ public class StaffServiceImpl implements StaffService {
String key = RedisKeys.getCpUserKey("gov", "wxmp", fromDTO.getStaffId());
redisUtils.delete(key);
//10 清除工作人员缓存
customerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(), fromDTO.getStaffId());
CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(), fromDTO.getStaffId());
}
/**

2
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml

@ -31,7 +31,7 @@
VALUES
<foreach collection="tags" item="tag" separator=",">
(
#{tag.id},#{tag.customerId}, #{tag.tagName}, #{tag.tagColor} #{tag.useCount}, #{tag.delFlag}, #{tag.revision}, #{tag.createdBy}, NOW(), #{tag.updatedBy}, NOW()
#{tag.id},#{tag.customerId}, #{tag.tagName}, #{tag.tagColor}, #{tag.useCount}, #{tag.delFlag}, #{tag.revision}, #{tag.createdBy}, NOW(), #{tag.updatedBy}, NOW()
)
</foreach>
ON DUPLICATE KEY UPDATE

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/MyGroupFormDTO.java

@ -43,4 +43,6 @@ public class MyGroupFormDTO implements Serializable {
*/
@NotBlank(message="当前用户id不能为空")
private String userId;
private String groupType;
}

18
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/LastTextDTO.java

@ -0,0 +1,18 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/25 14:01
*/
@Data
public class LastTextDTO implements Serializable {
private static final long serialVersionUID = 4908205806172407179L;
private String textId;
private String topicContent;
private String type;
}

59
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/MyGroupV2ResultDTO.java

@ -0,0 +1,59 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/25 14:05
*/
@Data
public class MyGroupV2ResultDTO implements Serializable {
private static final long serialVersionUID = -3299763394428383259L;
/**
* 群组id
*/
private String groupId;
/**
* 群组头像
*/
private String groupHeadPhoto;
/**
* 群组名称
*/
private String groupName;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 党员总数
*/
private Integer totalPartyMember;
/**
* 审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
*/
private String groupState;
/**
* member成员leader群主
*/
private String groupLeaderFlag;
/**
* 最新话题
*/
private LastTextDTO lastText;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -77,6 +77,15 @@ public class ResiGroupController {
return new Result<List<MyGroupResultDTO>>().ok(myGroupList);
}
@PostMapping("getmygroupV2")
public Result<List<MyGroupV2ResultDTO>> getMyGroupV2(@LoginUser TokenDto tokenDto, @RequestBody MyGroupFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO);
List<MyGroupV2ResultDTO> myGroupList = resiGroupService.getMyGroupV2(formDTO);
return new Result<List<MyGroupV2ResultDTO>>().ok(myGroupList);
}
/**
* @param tokenDto
* @param recommendGroupFormDTO

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -52,7 +52,7 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @Date 2020/3/28 20:39
**/
List<MyGroupResultDTO> selectListMyGroup(MyGroupFormDTO myGroupFormDTO);
List<MyGroupV2ResultDTO> selectListMyGroupV2(MyGroupFormDTO myGroupFormDTO);
/**
* @return com.epmet.resi.group.dto.group.result.LatestTopicDTO
* @param groupId
@ -62,6 +62,8 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
**/
LatestTopicDTO selectLatestTopic(String groupId);
LastTextDTO selectLatestText(String groupId);
/**
* @param recommendGroupFormDTO
* @return java.util.List<com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO>

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -114,6 +114,15 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
**/
List<MyGroupResultDTO> getMyGroup(MyGroupFormDTO myGroupFormDTO);
/**
* @Description 我的小组查询包含我创建的小组+我加入的小组以各组的最新话题时间有近到远排序
* @Param myGroupFormDTO
* @Return {@link List< MyGroupV2ResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/25 14:13
*/
List<MyGroupV2ResultDTO> getMyGroupV2(MyGroupFormDTO myGroupFormDTO);
/**
* @param recommendGroupFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO>>

20
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -248,6 +248,26 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return myGroupList;
}
/**
* @param myGroupFormDTO
* @Description 我的小组查询包含我创建的小组+我加入的小组以各组的最新话题时间有近到远排序
* @Param myGroupFormDTO
* @Return {@link List< MyGroupV2ResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/25 14:13
*/
@Override
public List<MyGroupV2ResultDTO> getMyGroupV2(MyGroupFormDTO myGroupFormDTO) {
int pageIndex = (myGroupFormDTO.getPageNo() - NumConstant.ONE) * myGroupFormDTO.getPageSize();
myGroupFormDTO.setPageNo(pageIndex);
List<MyGroupV2ResultDTO> myGroupList = baseDao.selectListMyGroupV2(myGroupFormDTO);
if (null == myGroupList || myGroupList.size() < 1) {
logger.info(String.format("我的小组V2查询为空,selectListMyGroup入参%s", JSON.toJSONString(myGroupFormDTO)));
return new ArrayList<>();
}
return myGroupList;
}
/**
* @param recommendGroupFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO>>

7
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java

@ -2,7 +2,6 @@ package com.epmet.modules.test;
import com.epmet.commons.tools.utils.HttpContextUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.TestFormDTO;
import com.epmet.feign.OssFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -33,11 +32,5 @@ public class TestController {
return new Result();
}
@PostMapping("test-ribbon-sender")
public Result testRibbonSender() {
TestFormDTO form = new TestFormDTO(40000l);
Result result = ossFeignClient.testRibbonRcv(form);
return result;
}
}

90
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -14,6 +14,18 @@
<association property="latestTopic" select="com.epmet.modules.group.dao.ResiGroupDao.selectLatestTopic" column="id">
</association>
</resultMap>
<resultMap id="MyGroupV2ResultDTOMap" type="com.epmet.resi.group.dto.group.result.MyGroupV2ResultDTO">
<result property="groupId" column="id"/>
<result property="groupHeadPhoto" column="GROUP_HEAD_PHOTO"/>
<result property="groupName" column="GROUP_NAME"/>
<result property="totalMember" column="TOTAL_MEMBERS"/>
<result property="totalPartyMember" column="TOTAL_PARTY_MEMBERS"/>
<result property="groupState" column="STATE"/>
<result property="groupLeaderFlag" column="GROUP_LEADER_FLAG"/>
<association property="lastText" javaType="com.epmet.resi.group.dto.group.result.LastTextDTO" select="com.epmet.modules.group.dao.ResiGroupDao.selectLatestText" column="id">
</association>
</resultMap>
<!-- 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) -->
<select id="selectListMyGroup" parameterType="com.epmet.resi.group.dto.group.form.MyGroupFormDTO"
resultMap="MyGroupResultDTOMap">
@ -43,6 +55,37 @@
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectListMyGroupV2" parameterType="com.epmet.resi.group.dto.group.form.MyGroupFormDTO"
resultMap="MyGroupV2ResultDTOMap">
SELECT
rg.id,
rg.GROUP_HEAD_PHOTO,
rg.GROUP_NAME ,
rgs.TOTAL_MEMBERS ,
rgs.TOTAL_PARTY_MEMBERS ,
rg.STATE ,
rgm.GROUP_LEADER_FLAG,
rg.GROUP_TYPE
FROM
resi_group_member rgm
LEFT JOIN resi_group rg ON ( rgm.RESI_GROUP_ID = rg.ID )
LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID )
WHERE
rg.DEL_FLAG = '0'
AND rgm.DEL_FLAG = '0'
AND rgs.DEL_FLAG = '0'
AND rg.CUSTOMER_ID = #{customerId}
AND rg.GRID_ID =#{gridId}
AND rgm.CUSTOMER_USER_ID = #{userId}
AND rgm.STATUS IN ( 'approved', 'silent' )
AND rg.STATE in('approved','hidden','closed')
<if test="groupType != null and groupType.trim() != ''">
AND rg.GROUP_TYPE = #{groupType}
</if>
order by rg.LATEST_TOPIC_PUBLISH_DATE desc
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 查询当前组最新话题 -->
<select id="selectLatestTopic" resultType="com.epmet.resi.group.dto.group.result.LatestTopicDTO">
SELECT
@ -58,6 +101,53 @@
limit 1
</select>
<!-- 查询当前组最新话题 -->
<select id="selectLatestText" resultType="com.epmet.resi.group.dto.group.result.LastTextDTO">
SELECT
textId,
topicContent,
type
FROM
(
SELECT
a.ID AS textId,
a.TOPIC_CONTENT AS topicContent,
'topic' AS type,
max( a.CREATED_TIME ) AS CREATED_TIME
FROM
resi_topic a
WHERE
a.GROUP_ID = #{groupId}
GROUP BY
a.GROUP_ID UNION ALL
SELECT
a.ID AS textId,
a.TITLE AS topicContent,
'notice' AS type,
max( a.CREATED_TIME ) AS CREATED_TIME
FROM
notice a
WHERE
a.GROUP_ID = #{groupId}
GROUP BY
a.GROUP_ID UNION ALL
SELECT
a.ID AS textId,
a.TITLE AS topicContent,
'activity' AS type,
max( a.CREATED_TIME ) AS CREATED_TIME
FROM
group_act_info a
WHERE
a.GROUP_ID = #{groupId}
GROUP BY
a.GROUP_ID
) a
ORDER BY
CREATED_TIME DESC
LIMIT 1
</select>
<!-- 推荐小组列表查询 -->
<select id="selectListRecommendGroup" parameterType="com.epmet.resi.group.dto.group.form.RecommendGroupFormDTO"
resultType="com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO">

30
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolYuShanResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/25 3:50 下午
* @DESC
*/
@Data
public class PatrolYuShanResultDTO implements Serializable {
private static final long serialVersionUID = -54918706294182026L;
private String staffId;
private String gridId;
/**
* 巡查时长
*/
private Integer patrolDuration;
/**
* 巡查次数
*/
private Integer patrolCount;
}

9
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -626,4 +626,13 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/staffrole/queryRoleStaffIds")
Result<Set<String>> queryRoleStaffIds(@RequestBody RoleStaffIdFormDTO formDTO);
/**
* @Description 查询巡查次数和时长
* @Param agencyId
* @author zxc
* @date 2021/8/25 3:59 下午
*/
@PostMapping("/epmetuser/statsstaffpatrolrecorddaily/patrolinfo")
Result<List<PatrolYuShanResultDTO>> patrolInfo(@RequestParam("agencyId")String agencyId);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -445,4 +445,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<Set<String>> queryRoleStaffIds(RoleStaffIdFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryRoleStaffIds", formDTO);
}
@Override
public Result<List<PatrolYuShanResultDTO>> patrolInfo(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolInfo", agencyId);
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java

@ -2,12 +2,15 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.result.PatrolYuShanResultDTO;
import com.epmet.service.StatsStaffPatrolRecordDailyService;
import com.epmet.dto.form.PatrolCountFormDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* []工作人员巡查记录统计
@ -33,4 +36,15 @@ public class StatsStaffPatrolRecordDailyController {
ValidatorUtils.validateEntity(formDTO, PatrolCountFormDTO.PatrolCountForm.class);
return new Result<PatrolCountResultDTO>().ok(statsStaffPatrolRecordDailyService.patrolCount(formDTO));
}
/**
* @Description 查询巡查次数和时长
* @Param agencyId
* @author zxc
* @date 2021/8/25 4:02 下午
*/
@PostMapping("patrolinfo")
public Result<List<PatrolYuShanResultDTO>> patrolInfo(@RequestParam("agencyId")String agencyId){
return new Result<List<PatrolYuShanResultDTO>>().ok(statsStaffPatrolRecordDailyService.patrolInfo(agencyId));
}
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.PatrolYuShanResultDTO;
import com.epmet.dto.result.SelectPatrolCountResultDTO;
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -71,5 +72,13 @@ public interface StatsStaffPatrolRecordDailyDao extends BaseDao<StatsStaffPatrol
* @date 2021/8/20 9:10 上午
*/
List<SelectPatrolCountResultDTO> selectPatrolCount(@Param("agencyId")String agencyId, @Param("dateId")String dateId);
/**
* @Description 查询巡查次数和时长
* @Param agencyId
* @author zxc
* @date 2021/8/25 4:02 下午
*/
List<PatrolYuShanResultDTO> patrolInfo(@Param("agencyId")String agencyId);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java

@ -1,10 +1,13 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.result.PatrolYuShanResultDTO;
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
import com.epmet.dto.form.PatrolCountFormDTO;
import com.epmet.dto.result.PatrolCountResultDTO;
import java.util.List;
/**
* []工作人员巡查记录统计
*
@ -21,4 +24,12 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService<StatsSta
*/
PatrolCountResultDTO patrolCount(PatrolCountFormDTO formDTO);
/**
* @Description 查询巡查次数和时长
* @Param agencyId
* @author zxc
* @date 2021/8/25 4:02 下午
*/
List<PatrolYuShanResultDTO> patrolInfo(String agencyId);
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.PatrolConstant;
import com.epmet.dao.StatsStaffPatrolRecordDailyDao;
import com.epmet.dto.result.PatrolYuShanResultDTO;
import com.epmet.dto.result.SelectPatrolCountResultDTO;
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity;
import com.epmet.service.StatsStaffPatrolRecordDailyService;
@ -45,4 +46,15 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl<Stat
});
return result;
}
/**
* @Description 查询巡查次数和时长
* @Param agencyId
* @author zxc
* @date 2021/8/25 4:02 下午
*/
@Override
public List<PatrolYuShanResultDTO> patrolInfo(String agencyId) {
return baseDao.patrolInfo(agencyId);
}
}

13
epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml

@ -52,4 +52,17 @@
ORDER BY STAFF_ID DESC) t GROUP BY t.STATUS
</select>
<!-- 查询巡查次数和时长 -->
<select id="patrolInfo" resultType="com.epmet.dto.result.PatrolYuShanResultDTO">
SELECT
GRID_ID,
STAFF_ID,
IFNULL(SUM(PATROL_TOTAL),0) AS patrolCount,
IFNULL(ROUND((SUM(TOTAL_TIME)/60),0),0) AS patrolDuration
FROM stats_staff_patrol_record_daily
WHERE DEL_FLAG = 0
AND GRID_PIDS LIKE CONCAT('%',#{agencyId},'%')
GROUP BY GRID_ID,STAFF_ID
</select>
</mapper>
Loading…
Cancel
Save