Browse Source

暂提列表

master
zxc 3 years ago
parent
commit
dc1b929138
  1. 2
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java
  2. 30
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java
  3. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  4. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  5. 4
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java
  6. 43
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  7. 43
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  8. 13
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml
  9. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

2
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java

@ -30,4 +30,6 @@ public class ActAndScheduleListFormDTO implements Serializable {
private String customerId;
private String staffId;
private String agencyId;
private String path;
}

30
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -30,16 +32,22 @@ public class ActAndScheduleListResultDTO implements Serializable {
private static final long serialVersionUID = -9050507457068805831L;
private String activityId;
private String staffId;
private String topic;
private String address;
private String holdTime;
private String type;
private String isPublicValue;
private String isPublish;
private String joinTypeValue;
private Boolean isMe;
private String joinUserType;
private List<JoinOrgDTO> joinOrgList;
private List<String> joinOrgs;
private Boolean isMe = false;
}
@Data
public static class ScheduleListDTO implements Serializable{
private static final long serialVersionUID = 5372167729733804267L;
@ -48,6 +56,24 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String title;
private String remindTime;
private String remark;
private Boolean isMe;
private Boolean isMe = false;
private String staffId;
}
@Data
public static class JoinOrgDTO implements Serializable{
private static final long serialVersionUID = -981758371558960097L;
private String partyOrgId;
private String partyOrgName;
}
public ActAndScheduleListResultDTO() {
this.scheduleTotal = NumConstant.ZERO;
this.activityTotal = NumConstant.ZERO;
this.dateId = "";
this.activityList = new ArrayList<>();
this.scheduleList = new ArrayList<>();
}
}

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

@ -3,6 +3,8 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -22,4 +24,6 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
* @return
*/
List<IcPartActTypeDTO> actTypeList(String customerId);
List<ActAndScheduleListResultDTO.ActivityListDTO> getActivityList(ActAndScheduleListFormDTO formDTO);
}

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

@ -3,6 +3,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.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.apache.ibatis.annotations.Mapper;
@ -104,4 +105,6 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity
*/
IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId);
List<ActAndScheduleListResultDTO.JoinOrgDTO> getPartyOrg(@Param("orgIds")List<String> orgIds);
}

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

@ -2,8 +2,10 @@ 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.ActAndScheduleListFormDTO;
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.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -22,4 +24,6 @@ public interface IcScheduleDao extends BaseDao<IcScheduleEntity> {
List<HomeMonthTotalResultDTO> getScheduleAndActCount(HomeMonthTotalFormDTO formDTO);
List<ActAndScheduleListResultDTO.ScheduleListDTO> getScheduleList(ActAndScheduleListFormDTO formDTO);
}

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

@ -11,10 +11,7 @@ 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.commons.tools.utils.SpringContextUtils;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao;
import com.epmet.modules.partyOrg.dao.*;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
@ -40,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 党建组织活动
@ -57,6 +55,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
@Autowired
private IcPartyActOrgDao icPartyActOrgDao;
@Autowired
private IcPartyOrgDao partyOrgDao;
@Autowired
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao;
/**
* 活动类型列表
@ -216,7 +216,40 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO) {
return null;
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<ActAndScheduleListResultDTO.ActivityListDTO> activityList = baseDao.getActivityList(formDTO);
if (CollectionUtils.isNotEmpty(activityList)){
List<String> partyOrgIdsNoDistinct = new ArrayList<>();
activityList.forEach(a -> {
partyOrgIdsNoDistinct.addAll(a.getJoinOrgList().stream().map(m -> m.getPartyOrgId()).collect(Collectors.toList()));
});
List<String> partyOrgIds = partyOrgIdsNoDistinct.stream().distinct().collect(Collectors.toList());
List<ActAndScheduleListResultDTO.JoinOrgDTO> partyOrg = partyOrgDao.getPartyOrg(partyOrgIds);
activityList.forEach(a -> {
a.setIsMe(formDTO.getStaffId().equals(a.getStaffId()));
a.getJoinOrgList().forEach(po -> partyOrg.stream().filter(p -> p.getPartyOrgId().equals(po.getPartyOrgId())).forEach(p -> po.setPartyOrgName(p.getPartyOrgName())));
a.setJoinOrgs(a.getJoinOrgList().stream().map(m -> m.getPartyOrgName()).collect(Collectors.toList()));
});
}
List<ActAndScheduleListResultDTO.ScheduleListDTO> scheduleList = scheduleDao.getScheduleList(formDTO);
if (CollectionUtils.isNotEmpty(scheduleList)){
scheduleList.forEach(s -> {
s.setIsMe(formDTO.getStaffId().equals(s.getStaffId()));
});
}
ActAndScheduleListResultDTO result = new ActAndScheduleListResultDTO();
result.setActivityList(activityList);
result.setScheduleList(scheduleList);
return result;
}
/**

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

@ -17,4 +17,47 @@
ORDER BY
d.SORT ASC
</select>
<resultMap id="getActivityListMap" type="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$ActivityListDTO">
<result property="activityId" column="activityId"/>
<result property="topic" column="topic"/>
<result property="address" column="address"/>
<result property="holdTime" column="holdTime"/>
<result property="joinTypeValue" column="joinTypeValue"/>
<result property="joinUserType" column="joinUserType"/>
<result property="staffId" column="staffId"/>
<result property="isPublicValue" column="isPublicValue"/>
<result property="isPublish" column="isPublish"/>
<result property="type" column="type"/>
<collection property="joinOrgList" ofType="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$JoinOrgDTO">
<result column="partyOrgId" property="partyOrgId"/>
</collection>
</resultMap>
<select id="getActivityList" resultMap="getActivityListMap">
SELECT
pa.ID AS activityId,
pa.TOPIC,
pa.ADDRESS,
DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime,
pa.ACT_TYPE AS type,
(CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员'
WHEN pa.JOIN_USER_TYPE = '0' THEN '全体党员'
ELSE '全体党员' END) AS joinTypeValue,
pa.JOIN_USER_TYPE AS joinUserType,
(CASE WHEN pa.IS_PUBLISH = '1' THEN '已发布'
WHEN pa.IS_PUBLISH = '0' THEN '未发布'
ELSE '已发布' END) AS isPublicValue,
pa.IS_PUBLISH AS isPublish,
pa.PUBLISH_STAFF_ID AS staffId,
ao.JOIN_ORG_ID AS partyOrgId
FROM ic_party_act pa
LEFT JOIN ic_party_act_org ao ON (ao.IC_PARTY_ACT_ID = pa.ID AND ao.DEL_FLAG = 0)
WHERE pa.DEL_FLAG = 0
AND pa.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId}
<if test=' isSelf == "1" '>
AND pa.PUBLISH_STAFF_ID = #{staffId}
</if>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
</select>
</mapper>

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

@ -146,5 +146,18 @@
and ORG_PID = '0'
</select>
<select id="getPartyOrg" resultType="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$JoinOrgDTO">
SELECT
ID AS partyOrgId,
PARTY_ORG_NAME
FROM ic_party_org
WHERE DEL_FLAG = 0
<if test="null != orgIds and orgIds.size() != 0">
AND ID IN (
<foreach collection="orgIds" item="id" separator=",">#{id}</foreach>
)
</if>
</select>
</mapper>

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

@ -38,10 +38,24 @@
AND CUSTOMER_ID = #{customerId}
AND HOLD_YEAR_ID = #{yearId}
<if test=' isSelf == "1" '>
AND CREATED_BY = #{staffId}
AND PUBLISH_STAFF_ID = #{staffId}
</if>
AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
GROUP BY HOLD_MONTH_ID)t
GROUP BY t.monthId
</select>
<select id="getScheduleList" resultType="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$ScheduleListDTO">
SELECT
ID AS scheduleId,
TITLE,
DATE_FORMAT(REMIND_TIME,'%Y-%m-%d %H:%i:%s') AS remindTime,
REMARK,
STAFF_ID
FROM ic_schedule
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = #{dateId}
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
</select>
</mapper>
Loading…
Cancel
Save