Browse Source

Merge branch 'dev_party_helper' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_party_helper

master
jianjun 3 years ago
parent
commit
594e685417
  1. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageListFormDTO.java
  2. 3
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml
  3. 21
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointRecordResultDTO.java
  4. 10
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointResultDTO.java
  5. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  6. 7
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  7. 22
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  8. 3
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
  9. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  10. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  11. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  12. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  13. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  14. 37
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActStatisFormDTO.java
  15. 45
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/PartyActStatisResultDTO.java
  16. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  17. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  18. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  19. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  20. 65
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  21. 103
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java
  22. 122
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.6__party_helper.sql
  23. 28
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  24. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/IcMessageListFormDTO.java

@ -9,6 +9,8 @@ import java.io.Serializable;
public class IcMessageListFormDTO implements Serializable {
private static final long serialVersionUID = 2697079163476964749L;
//检索内容
private String content;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = true;

3
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml

@ -21,6 +21,9 @@
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
<if test="content != null and content.trim() != ''">
AND message_content like concat('%', #{content}, '%')
</if>
</select>
<update id="upByUserId" parameterType="com.epmet.dto.form.ReadIcMessageFormDTO">

21
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointRecordResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/8/25 9:20
*/
@Data
public class PartyPointRecordResultDTO implements Serializable {
private static final long serialVersionUID = -1480768520576719171L;
/**
* 日期 yyyy-MM-dd 字符串
* */
private String date;
private List<PartyPointResultDTO> dailyList;
}

10
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PartyPointResultDTO.java

@ -15,8 +15,14 @@ import java.util.Date;
public class PartyPointResultDTO implements Serializable {
private static final long serialVersionUID = -3208641116926725011L;
private String title;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date dateTime;
/**
* 日期yyyy-MM-dd
*/
private String date;
/**
* 时间hh:mm
*/
private String time;
private String point;
private String actId;
private String actType;

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -265,9 +265,9 @@ public class ResiPointController {
* @Date 2022/8/23 14:12
*/
@PostMapping("pagePartyPoint")
public Result<PageData<PartyPointResultDTO>> pagePartyPoint(@LoginUser TokenDto tokenDto, @RequestBody PartyPointFormDTO formDTO ){
public Result<List<PartyPointRecordResultDTO>> pagePartyPoint(@LoginUser TokenDto tokenDto, @RequestBody PartyPointFormDTO formDTO ){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<PartyPointResultDTO>>().ok(pointActionLogService.pagePartyPoint(formDTO));
return new Result<List<PartyPointRecordResultDTO>>().ok(pointActionLogService.pagePartyPoint(formDTO));
}
}

7
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java

@ -25,10 +25,7 @@ import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.IcResiPointPageFormDTO;
import com.epmet.dto.form.MyPointTaskFormDTO;
import com.epmet.dto.form.PartyPointFormDTO;
import com.epmet.dto.result.MyPointTaskResultDTO;
import com.epmet.dto.result.PartyPointResultDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointPageResDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.UserPointActionLogEntity;
import dto.form.SendPointFormDTO;
@ -170,5 +167,5 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
* @Author zhaoqifeng
* @Date 2022/8/22 16:04
*/
PageData<PartyPointResultDTO> pagePartyPoint(PartyPointFormDTO formDTO);
List<PartyPointRecordResultDTO> pagePartyPoint(PartyPointFormDTO formDTO);
}

22
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -616,12 +616,13 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
*
* @param formDTO
* @Param formDTO
* @Return {@link PageData< PartyPointResultDTO >}
* @Return {@link List< PartyPointRecordResultDTO >}
* @Author zhaoqifeng
* @Date 2022/8/22 16:04
*/
@Override
public PageData<PartyPointResultDTO> pagePartyPoint(PartyPointFormDTO formDTO) {
public List<PartyPointRecordResultDTO> pagePartyPoint(PartyPointFormDTO formDTO) {
List<PartyPointRecordResultDTO> result = new LinkedList<>();
if (StringUtils.isNotBlank(formDTO.getQuarter())) {
if (StringUtils.isNotBlank(formDTO.getMonth())) {
formDTO.setStartDate(formDTO.getYear().concat(formDTO.getMonth()));
@ -667,9 +668,22 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
item.setActDate(actInfo.getData().getHoldTime());
}
});
Map<String,List<PartyPointResultDTO>> map =
list.stream().collect(Collectors.groupingBy(PartyPointResultDTO::getDate));
Map<String, List<PartyPointResultDTO>> sortedMap = Maps.newLinkedHashMap();
map.entrySet().stream().sorted(Map.Entry.<String, List<PartyPointResultDTO>>comparingByKey().reversed())
.forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue()));
sortedMap.entrySet().forEach(e -> {
PartyPointRecordResultDTO o = new PartyPointRecordResultDTO();
o.setDate(e.getKey());
o.setDailyList(e.getValue());
result.add(o);
});
}
PageInfo<PartyPointResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
return result;
}
/**

3
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml

@ -166,7 +166,8 @@
WHEN 'plus' THEN
concat( '+', POINT ) ELSE POINT
END AS point,
CREATED_TIME AS dateTime
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS date,
DATE_FORMAT( CREATED_TIME, '%H:%i' ) AS time
FROM
USER_POINT_ACTION_LOG
WHERE

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -342,4 +342,10 @@ public interface ResiGroupOpenFeignClient {
@PostMapping("/resi/group/member/groupmemberlist")
Result<List<ResiGroupMemberDTO>> groupMemberList(@RequestBody List<String> groupIdList);
/**
* @Author sun
* @Description 查询支部下党小组列表
**/
@PostMapping("/resi/group/group/partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId);
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -248,4 +248,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupMemberList", groupIdList);
}
@Override
public Result<List<ResiGroupDTO>> partyGroupList(String partyOrgId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "partyGroupList", partyOrgId);
}
}

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

@ -664,4 +664,15 @@ public class ResiGroupController {
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList(@LoginUser TokenDto tokenDto) {
return new Result<Map<String, List<IcPartyOrgTreeDTO>>>().ok(resiGroupService.getBranchGroupList(tokenDto.getCustomerId()));
}
/**
* @Author sun
* @Description 查询支部下党小组列表
**/
@PostMapping("partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId){
return new Result<List<ResiGroupDTO>>().ok(resiGroupService.partyGroupList(partyOrgId));
}
}

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

@ -481,4 +481,6 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @Date 2022/8/15 16:49
*/
Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId);
List<ResiGroupDTO> partyGroupList(String partyOrgId);
}

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

@ -1955,4 +1955,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
}
return list.stream().collect(Collectors.groupingBy(IcPartyOrgTreeDTO::getPid));
}
@Override
public List<ResiGroupDTO> partyGroupList(String partyOrgId) {
LambdaQueryWrapper<ResiGroupEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ResiGroupEntity::getPartyOrgId, partyOrgId);
wrapper.eq(ResiGroupEntity::getDelFlag, NumConstant.ZERO_STR);
List<ResiGroupEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return new ArrayList<>();
}
return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.class);
}
}

37
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActStatisFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
@Data
public class PartyActStatisFormDTO implements Serializable {
/**
* 参加活动党组织ID,groupId
*/
@NotBlank(message = "党组织Id不能为空", groups = AddGroup.class)
private String joinOrgId;
/**
* 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部6党小组
*/
@NotBlank(message = "党组织类型不能为空", groups = AddGroup.class)
private String joinOrgType;
/**
* 活动开始时间 yyyy-MM-dd
*/
private String startTime;
/**
* 活动结束时间 yyyy-MM-dd
*/
private String endTime;
//党组织Id集合
private List<String> partyOrgIdList;
}

45
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/PartyActStatisResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@NoArgsConstructor
@Data
public class PartyActStatisResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 党组织Id
*/
private String joinOrgId = "";
/**
* 党组织名称
*/
private String joinOrgName = "";
/**
* 支部党员大会次数
*/
private Integer dydhNum = 0;
/**
* 支部委员会次数
*/
private Integer wyhNum = 0;
/**
* 党小组会次数
*/
private Integer dxzhNum = 0;
/**
* 党课次数
*/
private Integer dkNum = 0;
/**
* 主题党日次数
*/
private Integer ztdrNum = 0;
/**
* 为民服务活动次数
*/
private Integer wmfwNum = 0;
}

18
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java

@ -18,6 +18,7 @@ import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.modules.partyOrg.excel.IcPartyActExpoprtExcel;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.resi.partymember.dto.icpartyact.form.BatchAddPartyActFormDTO;
@ -26,10 +27,7 @@ import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcPartyActListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.*;
import com.epmet.resi.partymember.dto.partyOrg.result.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -41,6 +39,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -320,4 +319,15 @@ public class IcPartyActController {
icPartyActService.autoPublishIcPartyAct();
return new Result();
}
/**
* Desc: 统计各党组织参与各种党活动的次数
*/
@RequestMapping("patryactstatis")
public Result<LinkedList<PartyActStatisResultDTO>> patryActStatis(@RequestBody PartyActStatisFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
return new Result<LinkedList<PartyActStatisResultDTO>>().ok(icPartyActService.patryActStatis(formDTO));
}
}

4
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java

@ -7,8 +7,10 @@ import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyActTypeDictDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcPartyActListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyActStatisFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyActListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.PartyActStatisResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -48,4 +50,6 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
List<IcPartyActEntity> selectNeedRemindAutoPublishAct(String dateId);
List<IcPartyActEntity> selectNoPublishList(String dateId);
List<PartyActStatisResultDTO> getPartActStatis(PartyActStatisFormDTO formDTO);
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -2,6 +2,7 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
@ -111,4 +112,6 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
IcPartyOrgEntity selectDefaultPartyOrg(@Param("agencyId") String agencyId, @Param("level") String level);
List<String> getUserIdByPartyOrgIds(@Param("partyOrgIdList") List<String> partyOrgIdList);
List<IcPartyOrgDTO> getSelfAndSub(@Param("joinOrgId") String joinOrgId);
}

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java

@ -9,12 +9,10 @@ import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcPartyActListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.*;
import com.epmet.resi.partymember.dto.partyOrg.result.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -119,4 +117,6 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
* 自动发布活动
*/
void autoPublishIcPartyAct();
LinkedList<PartyActStatisResultDTO> patryActStatis(PartyActStatisFormDTO formDTO);
}

65
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

@ -28,6 +28,7 @@ import com.epmet.modules.partyOrg.dao.*;
import com.epmet.modules.partyOrg.entity.*;
import com.epmet.modules.partyOrg.service.*;
import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
@ -37,10 +38,7 @@ import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyActTypeDictDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.IcPartyActListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.*;
import com.epmet.resi.partymember.dto.partyOrg.result.*;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyInfoResultDTO;
import com.epmet.send.SendMqMsgUtil;
@ -463,11 +461,13 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
}
formDTO.setAgencyId(staffInfo.getAgencyId());
if (!formDTO.getSearchType().equals("yearSearch")){
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId());
if (StringUtils.isNotBlank(formDTO.getOrgId())){
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId());
}
formDTO.setPath(StringUtils.isBlank(icPartyOrgDTO.getOrgPid()) || icPartyOrgDTO.getOrgPid().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId()));
}
formDTO.setPath(StringUtils.isBlank(icPartyOrgDTO.getOrgPid()) || icPartyOrgDTO.getOrgPid().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId()));
}
}
@ -564,7 +564,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
msg.setTitle("您收到一个新的活动通知");
msg.setReadFlag(ReadFlagConstant.UN_READ);
StringBuffer str = new StringBuffer();
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress());
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(DateUtils.format(entity.getHoldTime(), "yyyy年MM月dd日 HH:mm:ss")).append("\n").append("地点:").append(entity.getAddress());
msg.setMessageContent(str.toString());
msg.setMessageType("party");
msg.setTargetId(formDTO.getIcPartyActId());
@ -578,7 +578,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
msg.setTitle("您有一个活动已经发布");
msg.setReadFlag(ReadFlagConstant.UN_READ);
StringBuffer str = new StringBuffer();
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress());
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(DateUtils.format(entity.getHoldTime(), "yyyy年MM月dd日 HH:mm:ss")).append("\n").append("地点:").append(entity.getAddress());
msg.setMessageContent(str.toString());
msg.setMessageType("party");
msg.setTargetId(formDTO.getIcPartyActId());
@ -593,7 +593,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
msg.setTitle("您有一个活动3天后即将自动发布");
msg.setReadFlag(ReadFlagConstant.UN_READ);
StringBuffer str = new StringBuffer();
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress());
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(DateUtils.format(entity.getHoldTime(), "yyyy年MM月dd日 HH:mm:ss")).append("\n").append("地点:").append(entity.getAddress());
msg.setMessageContent(str.toString());
msg.setMessageType("party");
msg.setTargetId(formDTO.getIcPartyActId());
@ -608,7 +608,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
msg.setTitle("您有一个日程提醒");
msg.setReadFlag(ReadFlagConstant.UN_READ);
StringBuffer str = new StringBuffer();
str.append("日程:").append(schedule.getTitle()).append("\n").append("时间:").append(schedule.getRemindTime());
str.append("日程:").append(schedule.getTitle()).append("\n").append("时间:").append(DateUtils.format(schedule.getRemindTime(), "yyyy年MM月dd日 HH:mm:ss"));
msg.setMessageContent(str.toString());
msg.setMessageType("party");
msg.setTargetId(formDTO.getIcPartyActId());
@ -750,4 +750,45 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
}
}
}
/**
* Desc: 统计各党组织参与各种党活动的次数
*/
@Override
public LinkedList<PartyActStatisResultDTO> patryActStatis(PartyActStatisFormDTO formDTO) {
LinkedList<PartyActStatisResultDTO> resultList = new LinkedList<>();
//1.查询当前党组织及直属下级基础数据
List<IcPartyOrgDTO> orgDTOList = partyOrgDao.getSelfAndSub(formDTO.getJoinOrgId());
if (CollectionUtils.isEmpty(orgDTOList)) {
return resultList;
}
List<String> partyOrgIdList = orgDTOList.stream().map(IcPartyOrgDTO::getId).collect(Collectors.toList());
//如果党组织是支部类型,则直属下级是党小组
if ("6".equals(formDTO.getJoinOrgType())) {
Result<List<ResiGroupDTO>> result = resiGroupOpenFeignClient.partyGroupList(formDTO.getJoinOrgId());
if (!result.success()) {
throw new RenException("获取党支部下党小组列表失败:" + result.getInternalMsg());
}
List<String> groupIdList = result.getData().stream().map(ResiGroupDTO::getId).collect(Collectors.toList());
partyOrgIdList.addAll(groupIdList);
}
formDTO.setPartyOrgIdList(partyOrgIdList);
//2.按党组织统计查询各类型活动参与次数
List<PartyActStatisResultDTO> partActStatis = baseDao.getPartActStatis(formDTO);
Map<String, PartyActStatisResultDTO> map = partActStatis.stream().collect(Collectors.toMap(PartyActStatisResultDTO::getJoinOrgId, m -> m, (k1, k2) -> k1));
//3.封装数据并返回
orgDTOList.forEach(org -> {
PartyActStatisResultDTO dto = new PartyActStatisResultDTO();
if (map.containsKey(org.getId())) {
dto = ConvertUtils.sourceToTarget(map.get(org.getId()), PartyActStatisResultDTO.class);
}
dto.setJoinOrgName(org.getPartyOrgName());
resultList.add(dto);
});
return resultList;
}
}

103
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java

@ -2,9 +2,7 @@ package com.epmet.modules.partyOrg.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
@ -16,12 +14,8 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.result.CommonDataFilterResultDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
@ -30,8 +24,6 @@ import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.entity.IcPartyActSignInRecordEntity;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.modules.partyOrg.service.IcPartyActSignInRecordService;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO;
import com.epmet.resi.partymember.dto.IcPartyActSignInRecordDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO;
import com.github.pagehelper.PageHelper;
@ -41,7 +33,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.ArrayList;
import java.util.Arrays;
@ -137,46 +128,62 @@ public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl<IcPartyAc
if (!result.success() && null == result.getData()) {
throw new RenException("获取当前登录人居民信息失败");
}
//保存签到记录数据
IcPartyActSignInRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPartyActSignInRecordEntity.class);
entity.setEpmetUserId(formDTO.getUserId());
entity.setIdCard(result.getData().getIdNum());
entity.setUserRealName(result.getData().getName());
insert(entity);
//推送mq加积分
IcPartyActEntity actEntity = icPartyActService.selectById(formDTO.getIcPartyActId());
String actType = actEntity.getActType();
String eventTag = ("dangke".equals(actType) ? SystemMessageType.DANGKE : ("dxzh".equals(actType) ? SystemMessageType.DXZH : (
"wmfwhd".equals(actType) ? SystemMessageType.WMFWHD : ("zbdydh".equals(actType) ? SystemMessageType.ZBDYDH : (
"zbwyh".equals(actType) ? SystemMessageType.ZBWYH : ("ztdr".equals(actType) ? SystemMessageType.ZTDR : "")
))
)));
//网格缓存信息
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo) {
throw new EpmetException(String.format("未查询到网格{%s}信息", formDTO.getGridId()));
//二次签到不给积分
boolean bl = true;
//2.判断新增/修改签到记录数据
LambdaQueryWrapper<IcPartyActSignInRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActSignInRecordEntity::getIcPartyActId, formDTO.getIcPartyActId());
wrapper.eq(IcPartyActSignInRecordEntity::getEpmetUserId, formDTO.getUserId());
IcPartyActSignInRecordEntity entityOne = baseDao.selectOne(wrapper);
if (null == entityOne) {
IcPartyActSignInRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPartyActSignInRecordEntity.class);
entity.setEpmetUserId(formDTO.getUserId());
entity.setIdCard(result.getData().getIdNum());
entity.setUserRealName(result.getData().getName());
insert(entity);
} else {
entityOne.setAddress(formDTO.getAddress());
entityOne.setLatitude(formDTO.getLatitude());
entityOne.setLongitude(formDTO.getLongitude());
baseDao.updateById(entityOne);
bl = false;
}
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setOpAgencyId(gridInfo.getPid());
pointEventMsg.setOperatorId(formDTO.getUserId());
pointEventMsg.setAgencyId(gridInfo.getPid());
pointEventMsg.setCustomerId(formDTO.getCustomerId());
pointEventMsg.setGridId(gridInfo.getId());
pointEventMsg.setUserId(formDTO.getUserId());
pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false);
pointEventMsg.setSourceType(actType);
pointEventMsg.setSourceId(formDTO.getIcPartyActId());
pointEventMsgList.add(pointEventMsg);
SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO();
msgFormDTO.setMessageType(eventTag);
msgFormDTO.setContent(pointEventMsgList);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO);
if (!sendMsgResult.success()) {
log.error("党建活动签到发送积分失败,活动Id->" + formDTO.getIcPartyActId() + " 用户->" + formDTO.getUserId());
//3.推送mq加积分
if (bl) {
IcPartyActEntity actEntity = icPartyActService.selectById(formDTO.getIcPartyActId());
String actType = actEntity.getActType();
String eventTag = ("dangke".equals(actType) ? SystemMessageType.DANGKE : ("dxzh".equals(actType) ? SystemMessageType.DXZH : (
"wmfwhd".equals(actType) ? SystemMessageType.WMFWHD : ("zbdydh".equals(actType) ? SystemMessageType.ZBDYDH : (
"zbwyh".equals(actType) ? SystemMessageType.ZBWYH : ("ztdr".equals(actType) ? SystemMessageType.ZTDR : "")
))
)));
//网格缓存信息
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo) {
throw new EpmetException(String.format("未查询到网格{%s}信息", formDTO.getGridId()));
}
List<BasePointEventMsg> pointEventMsgList = new ArrayList<>();
BasePointEventMsg pointEventMsg = new BasePointEventMsg();
pointEventMsg.setOpAgencyId(gridInfo.getPid());
pointEventMsg.setOperatorId(formDTO.getUserId());
pointEventMsg.setAgencyId(gridInfo.getPid());
pointEventMsg.setCustomerId(formDTO.getCustomerId());
pointEventMsg.setGridId(gridInfo.getId());
pointEventMsg.setUserId(formDTO.getUserId());
pointEventMsg.setActionFlag(MqConstant.PLUS);
pointEventMsg.setIsCommon(false);
pointEventMsg.setSourceType(actType);
pointEventMsg.setSourceId(formDTO.getIcPartyActId());
pointEventMsgList.add(pointEventMsg);
SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO();
msgFormDTO.setMessageType(eventTag);
msgFormDTO.setContent(pointEventMsgList);
Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO);
if (!sendMsgResult.success()) {
log.error("党建活动签到发送积分失败,活动Id->" + formDTO.getIcPartyActId() + " 用户->" + formDTO.getUserId());
}
}
}

122
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.6__party_helper.sql

@ -0,0 +1,122 @@
CREATE TABLE `ic_schedule` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`ORG_ID` varchar(64) NOT NULL COMMENT '所属行政组织ID:当前工作人员所属组织id',
`PID` varchar(64) NOT NULL COMMENT '组织ID的上级;如果org_id是根组织,那此列=0',
`ORG_ID_PATH` varchar(255) NOT NULL COMMENT 'ORG_ID全路径,包含自身',
`STAFF_ID` varchar(64) NOT NULL COMMENT '当前登录用户userId',
`TITLE` varchar(35) NOT NULL COMMENT '日程标题(35字)',
`REMIND_TIME` datetime NOT NULL COMMENT '提醒时间;其实就是日程所属日期',
`IS_PUBLIC` varchar(10) NOT NULL COMMENT '是否公开,0:仅自己可见;1:组织内其他人可见',
`REMARK` varchar(500) DEFAULT NULL COMMENT '备注(500字)',
`DEL_FLAG` int(11) NOT NULL COMMENT '0:未删除;1已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='日程表';
CREATE TABLE `ic_party_act` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`ORG_ID` varchar(64) NOT NULL COMMENT '组织ID:当前工作人员所属组织id',
`PID` varchar(64) NOT NULL COMMENT '组织ID的上级;如果org_id是根组织,那此列=0',
`ORG_ID_PATH` varchar(255) NOT NULL COMMENT 'ORG_ID全路径,包含自身',
`PUBLISH_PARTY_ORG_ID` varchar(64) NOT NULL COMMENT '发布活动党组织',
`PUBLISH_PARTY_ORG_NAME` varchar(20) NOT NULL COMMENT '发布活动党组织名称',
`PUBLISH_ORG_PID` varchar(64) DEFAULT NULL COMMENT '发布活动党组织ID的上级节点',
`PUBLISH_ORG_TYPE` varchar(10) NOT NULL COMMENT '发布活动党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组',
`PUBLISH_ORG_PATH` varchar(255) NOT NULL COMMENT '发布活动党组织PUBLISH_PARTY_ORG_ID的全路径,包含自身。方便前端回显',
`ACT_TYPE` varchar(10) NOT NULL COMMENT '活动类型,来源于ic_party_act_type_dict',
`HOLD_YEAR_ID` varchar(10) NOT NULL COMMENT '活动举办时间:yyyy',
`HOLD_MONTH_ID` varchar(10) NOT NULL COMMENT '活动举办时间:yyyyMM',
`HOLD_TIME` datetime NOT NULL COMMENT '举办活动时间',
`TOPIC` varchar(255) NOT NULL COMMENT '活动主题',
`ADDRESS` varchar(255) NOT NULL COMMENT '活动地点',
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '活动地点纬度',
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '活动地点经度',
`AUTO_PUBLIC_TYPE` int(11) NOT NULL COMMENT '活动开始前几天',
`AUTO_PUBLIC_TIME` datetime DEFAULT NULL COMMENT '自动发布时间,保存时算好时间存在这里',
`JOIN_USER_TYPE` varchar(10) DEFAULT NULL COMMENT '参加人员类型,0:全体党员;1:支部委员',
`IS_AUTO_INFORM` varchar(1) DEFAULT NULL COMMENT '是否自动通知参加人员,0否;1是',
`INTRODUCE` varchar(1024) DEFAULT NULL COMMENT '活动介绍',
`IS_PUBLISH` varchar(10) NOT NULL COMMENT '是否发布,0未发布;1已发布;',
`PUBLISH_STAFF_ID` varchar(64) NOT NULL COMMENT '活动发布人',
`PUBLISH_STAFF_NAME` varchar(64) NOT NULL COMMENT '活动发布人姓名',
`DEL_FLAG` int(11) NOT NULL COMMENT '0未删除;1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='党建组织活动';
CREATE TABLE `ic_party_act_org` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`IC_PARTY_ACT_ID` varchar(64) NOT NULL COMMENT '活动id',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`JOIN_ORG_ID` varchar(64) NOT NULL COMMENT '参加活动党组织ID,groupId',
`JOIN_ORG_NAME` varchar(128) NOT NULL COMMENT '参加党组织名称',
`ORG_TYPE` varchar(10) NOT NULL COMMENT '党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组',
`PID` varchar(64) NOT NULL COMMENT '参加活动党组织ID的上级节点',
`JOIN_ORG_PATH` varchar(255) NOT NULL COMMENT 'PARTY_ORG_ID的全路径,包含自身。方便前端回显',
`DEL_FLAG` int(11) NOT NULL COMMENT '0:未删除;1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='参加活动党组织表';
CREATE TABLE `ic_party_act_sign_in_record` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`IC_PARTY_ACT_ID` varchar(64) NOT NULL COMMENT '活动id',
`ID_CARD` varchar(32) NOT NULL COMMENT '身份证号',
`EPMET_USER_ID` varchar(64) NOT NULL COMMENT '签到用户id',
`USER_REAL_NAME` varchar(64) NOT NULL COMMENT '签到用户姓名',
`ADDRESS` varchar(255) NOT NULL COMMENT '签到地点',
`LATITUDE` varchar(32) NOT NULL COMMENT '签到地点纬度',
`LONGITUDE` varchar(32) NOT NULL COMMENT '签到地点经度',
`DEL_FLAG` int(11) NOT NULL COMMENT '0:未删除;1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='党组织活动签到记录表';
CREATE TABLE `ic_party_act_type_dict` (
`ID` varchar(64) NOT NULL,
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`TYPE_KEY` varchar(32) NOT NULL COMMENT '活动类型key',
`TYPE_NAME` varchar(32) NOT NULL COMMENT '活动名称',
`YEAR_COUNT` int(11) NOT NULL COMMENT '每年几次',
`FREQUENCY_UNIT` varchar(32) NOT NULL COMMENT '频次单位',
`FREQUENCY_COUNT` int(11) NOT NULL COMMENT '频次数量',
`FREQUENCY_DESC` varchar(63) NOT NULL COMMENT '频率描述',
`SORT` int(11) NOT NULL COMMENT '排序',
`DEL_FLAG` int(11) NOT NULL COMMENT '0未删除;1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党组织活动类型字典表';
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', 'zbdydh', '支部党员大会', 4, 'quarter', 1, '每季度1次', 1, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', 'zbwyh', '支部委员会', 12, 'month', 1, '每月1次', 2, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', 'dxzh', '党小组会', 12, 'month', 1, '每月一次', 3, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', 'dangke', '党课', 4, 'quarter', 1, '每季度1次', 4, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', 'ztdr', '主题党日', 12, 'month', 1, '每月1次', 5, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');
INSERT INTO `epmet_resi_partymember`.`ic_party_act_type_dict` (`ID`, `CUSTOMER_ID`, `TYPE_KEY`, `TYPE_NAME`, `YEAR_COUNT`, `FREQUENCY_UNIT`, `FREQUENCY_COUNT`, `FREQUENCY_DESC`, `SORT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', 'wmfwhd', '为民服务活动', 12, 'month', 1, '每月1次', 6, 0, 0, 'APP_USER', '2022-08-18 17:43:46', 'APP_USER', '2022-08-18 17:43:54');

28
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -231,4 +231,32 @@
AND a.IS_PUBLISH = '0'
AND DATE_FORMAT(a.AUTO_PUBLIC_TIME,'%Y%m%d%H%i') = #{dateId}
</select>
<select id="getPartActStatis" resultType="com.epmet.resi.partymember.dto.partyOrg.result.PartyActStatisResultDTO">
SELECT
ipao.join_org_id joinOrgId,
sum(ipa.act_type = 'zbdydh') dydhNum,
sum(ipa.act_type = 'zbwyh') wyhNum,
sum(ipa.act_type = 'dxzh') dxzhNum,
sum(ipa.act_type = 'dangke') dkNum,
sum(ipa.act_type = 'ztdr') ztdrNum,
sum(ipa.act_type = 'wmfwhd') wmfwNum
FROM
ic_party_act ipa
INNER JOIN ic_party_act_org ipao ON ipao.del_flag = '0' AND ipa.id = ipao.ic_party_act_id
WHERE
ipa.del_flag = '0'
<foreach collection="partyOrgIdList" item="orgId" open="AND ipao.join_org_id IN (" separator="," close=")">
#{orgId}
</foreach>
<if test="startTime != null and startTime != ''">
AND ipa.hold_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND ipa.hold_time &lt;= #{endTime}
</if>
GROUP BY
ipao.join_org_id
</select>
</mapper>

15
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -201,4 +201,19 @@
ORDER BY ipo.id
</select>
<select id="getSelfAndSub" resultType="com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO">
SELECT
*
FROM
ic_party_org
WHERE
del_flag = '0'
AND (
id = #{joinOrgId}
OR org_pid = #{joinOrgId}
)
ORDER BY
party_org_type ASC
</select>
</mapper>

Loading…
Cancel
Save