zxc 3 years ago
parent
commit
c6ce21c6ac
  1. 7
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java
  2. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java
  3. 26
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  4. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml
  5. 30
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

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 staffId;
private String customerId; 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.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcScheduleEntity; import com.epmet.modules.partyOrg.entity.IcScheduleEntity;
import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO; 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 org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 日程表 * 日程表
* *
@ -16,4 +20,6 @@ public interface IcScheduleDao extends BaseDao<IcScheduleEntity> {
void editSchedule(AddOrEditScheduleFormDTO formDTO); 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

@ -3,19 +3,26 @@ package com.epmet.modules.partyOrg.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant; 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.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.modules.partyOrg.dao.IcPartyActDao; import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.service.IcPartyActService; 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.IcPartyActAddOrUpdateFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; 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.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; 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.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -33,6 +40,10 @@ import java.util.Map;
@Service @Service
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService {
@Autowired
private IcScheduleDao scheduleDao;
@Autowired
private IcPartyOrgService partyOrgService;
/** /**
* 活动类型列表 * 活动类型列表
@ -61,8 +72,21 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/ */
@Override @Override
public List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) { 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> 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; return result;
} }

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

@ -160,11 +160,12 @@
</appender> </appender>
<!-- 开发、测试环境 --> <!-- 开发、测试环境 -->
<springProfile name="dev,test"> <springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/> <logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/> <logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.modules.partymember.dao" level="DEBUG"/> <logger name="com.epmet.modules.partymember.dao" level="DEBUG"/>
<logger name="com.epmet.modules.warmhearted.dao" level="DEBUG"/> <logger name="com.epmet.modules.warmhearted.dao" level="DEBUG"/>
<logger name="com.epmet.modules.partyOrg.dao" level="DEBUG"/>
<!-- 只打印rocketmq client的日志 --> <!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false"> <logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/> <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} is_public = #{isPublic}
WHERE ID = #{scheduleId} WHERE ID = #{scheduleId}
</update> </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 = '周星驰'
</if>
AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
GROUP BY HOLD_MONTH_ID)t
GROUP BY t.monthId
</select>
</mapper> </mapper>
Loading…
Cancel
Save