Browse Source

Merge remote-tracking branch 'origin/dev_party_helper' into dev_party_helper

# Conflicts:
#	epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
master
yinzuomei 3 years ago
parent
commit
1aa4af0bf9
  1. 2
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PartyMeetingMessageMQMsg.java
  2. 7
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java
  3. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java
  4. 26
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  5. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml
  6. 30
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

2
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PartyMeetingMessageMQMsg.java

@ -15,7 +15,7 @@ public class PartyMeetingMessageMQMsg implements Serializable {
private String customerId;
//活动Id
private String icPartyActId;
//动作类型 发布活动:publish 提前提醒:remind 提前通知:notify
//动作类型 发布活动:publish 提前提醒:remind 日程通知:notify
private String type;
//党组织Id
private String publishOrgId;

7
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java

@ -38,4 +38,11 @@ public class HomeMonthTotalFormDTO implements Serializable {
private String staffId;
private String customerId;
/**
* 工作人员所属组织ID
*/
private String agencyId;
private String path;
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java

@ -3,8 +3,12 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 日程表
*
@ -16,4 +20,6 @@ public interface IcScheduleDao extends BaseDao<IcScheduleEntity> {
void editSchedule(AddOrEditScheduleFormDTO formDTO);
List<HomeMonthTotalResultDTO> getScheduleAndActCount(HomeMonthTotalFormDTO formDTO);
}

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

@ -4,21 +4,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
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.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.commons.collections4.CollectionUtils;
@ -41,6 +47,11 @@ import java.util.Map;
*/
@Service
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService {
@Autowired
private IcScheduleDao scheduleDao;
@Autowired
private IcPartyOrgService partyOrgService;
@Autowired
private IcPartyActOrgDao icPartyActOrgDao;
@ -71,8 +82,21 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId());
}
formDTO.setPath(icPartyOrgDTO.getOrgPids().equals("") || icPartyOrgDTO.getOrgPids().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId()));
List<HomeMonthTotalResultDTO> result = constructMonthData(formDTO.getYearId());
List<HomeMonthTotalResultDTO> countList = scheduleDao.getScheduleAndActCount(formDTO);
if (CollectionUtils.isNotEmpty(countList)){
countList.forEach(c -> result.stream().filter(r -> c.getMonthId().equals(r.getMonthId())).forEach(r -> r.setCount(c.getCount())));
}
return result;
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml

@ -160,11 +160,12 @@
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.modules.partymember.dao" level="DEBUG"/>
<logger name="com.epmet.modules.warmhearted.dao" level="DEBUG"/>
<logger name="com.epmet.modules.partyOrg.dao" level="DEBUG"/>
<!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/>

30
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

@ -14,4 +14,34 @@
is_public = #{isPublic}
WHERE ID = #{scheduleId}
</update>
<select id="getScheduleAndActCount" resultType="com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO">
SELECT
SUM(t.count) AS count,t.monthId
FROM
(SELECT
COUNT(id) as count,
DATE_FORMAT(CREATED_TIME,'%Y%m') as monthId
FROM ic_schedule
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y') = #{yearId}
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
GROUP BY DATE_FORMAT(CREATED_TIME,'%Y%m')
UNION ALL
SELECT
COUNT(id) as count,
HOLD_MONTH_ID AS monthId
FROM ic_party_act
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND HOLD_YEAR_ID = #{yearId}
<if test='isSelf == "1"'>
AND CREATED_BY = #{staffId}
</if>
AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
GROUP BY HOLD_MONTH_ID)t
GROUP BY t.monthId
</select>
</mapper>
Loading…
Cancel
Save