Browse Source

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

master
yinzuomei 3 years ago
parent
commit
0c182e4408
  1. 18
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java
  2. 13
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java
  3. 3
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java
  4. 3
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java
  5. 14
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java
  6. 11
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml
  7. 6
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java
  8. 25
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java
  9. 4
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java
  10. 46
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchResultDTO.java
  11. 17
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  12. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  13. 38
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  14. 17
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

18
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReadIcMessageFormDTO implements Serializable {
private static final long serialVersionUID = 2697079163476964749L;
/**
* 消息Id
*/
private String id;
//token中信息
private String customerId;
private String userId;
}

13
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java

@ -13,6 +13,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.service.IcMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -83,5 +84,17 @@ public class IcMessageController {
return new Result();
}
/**
* @Author sun
* @Description 单条或批量修改已读
**/
@PostMapping("read")
public Result read(@LoginUser TokenDto tokenDto, @RequestBody ReadIcMessageFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icMessageService.read(formDTO);
return new Result();
}
}

3
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.entity.IcMessageEntity;
import org.apache.ibatis.annotations.Mapper;
@ -18,4 +19,6 @@ import java.util.List;
public interface IcMessageDao extends BaseDao<IcMessageEntity> {
List<IcMessageDTO> selectMessageList(IcMessageListFormDTO formDTO);
void upByUserId(ReadIcMessageFormDTO formDTO);
}

3
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.entity.IcMessageEntity;
import java.util.List;
@ -70,4 +71,6 @@ public interface IcMessageService extends BaseService<IcMessageEntity> {
void delete(String[] ids);
void saveIcMessageList(List<IcMessageFormDTO> msgList);
void read(ReadIcMessageFormDTO formDTO);
}

14
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java

@ -16,6 +16,7 @@ import com.epmet.dto.IcMessageDTO;
import com.epmet.dto.form.IcMessageFormDTO;
import com.epmet.dto.form.IcMessageListFormDTO;
import com.epmet.dto.form.IcMoveInListFormDTO;
import com.epmet.dto.form.ReadIcMessageFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcMoveInListResultDTO;
@ -93,4 +94,17 @@ public class IcMessageServiceImpl extends BaseServiceImpl<IcMessageDao, IcMessag
insertBatch(entityList);
}
@Override
public void read(ReadIcMessageFormDTO formDTO) {
//id入参有值就按id修改,没值就按用户修改
if(StringUtils.isNotBlank(formDTO.getId())){
IcMessageEntity entity = new IcMessageEntity();
entity.setId(formDTO.getId());
updateById(entity);
return;
}
//批量修改某个人消息列表
baseDao.upByUserId(formDTO);
}
}

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

@ -23,4 +23,15 @@
AND user_id = #{userId}
</select>
<update id="upByUserId" parameterType="com.epmet.dto.form.ReadIcMessageFormDTO">
UPDATE ic_message
SET read_flag = 'read',
updated_by = #{userId},
updated_time = NOW()
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
</update>
</mapper>

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

@ -17,6 +17,7 @@ public class ActAndScheduleListFormDTO implements Serializable {
private String startDate;
private String endDate;
private String dateId;
private String yearId;
/**
* 是否本人创建的活动10
@ -32,4 +33,9 @@ public class ActAndScheduleListFormDTO implements Serializable {
private String staffId;
private String agencyId;
private String path;
/**
* 当seachType = 'yearSearch'不需要查询党组织
*/
private String searchType = "";
}

25
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/8/22 09:26
* @DESC
*/
@Data
public class YearSearchFormDTO implements Serializable {
private static final long serialVersionUID = 4557112229519696741L;
public interface YearSearchForm{}
@NotBlank(message = "yaerId不能为空",groups = YearSearchForm.class)
private String yearId;
private String staffId;
private String customerId;
}

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

@ -37,6 +37,10 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String topic;
private String address;
private String holdTime;
private String autoPublicTime;
private String isAutoInformValue;
private String isAutoInform;
private String autoInformDay;
private String type;
private String isPublicValue;
private String isPublish;

46
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchResultDTO.java

@ -0,0 +1,46 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/8/22 09:27
* @DESC
*/
@Data
public class YearSearchResultDTO implements Serializable {
private static final long serialVersionUID = 8961924457475202790L;
private String type;
private String frequency;
private List<YearSearchActivityListDTO> activityList;
@Data
public static class YearSearchActivityListDTO implements Serializable{
private static final long serialVersionUID = -9050507457068805831L;
private String activityId;
private String staffId;
private String dateId;
private String topic;
private String address;
private String holdTime;
private String type;
private String isPublicValue;
private String isPublish;
private String joinTypeValue;
private String joinUserType;
private String isAutoInformValue;
private String autoInformDay;
private String autoPublicTime;
private List<ActAndScheduleListResultDTO.JoinOrgDTO> joinOrgList;
private List<String> joinOrgs;
private Boolean isMe = false;
}
}

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

@ -14,8 +14,10 @@ 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.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -173,4 +175,19 @@ public class IcPartyActController {
}
return new Result();
}
/**
* Desc:党建日历生成年度活动计划查询
* @param tokenDto
* @param formDTO
* @author zxc
* @date 2022/8/22 09:33
*/
@PostMapping("yearSearch")
public Result<List<YearSearchResultDTO>> yearSearch(@LoginUser TokenDto tokenDto, @RequestBody YearSearchFormDTO formDTO){
formDTO.setStaffId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<YearSearchResultDTO>>().ok(icPartyActService.yearSearch(formDTO));
}
}

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

@ -11,8 +11,10 @@ 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.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO;
import java.util.List;
import java.util.Map;
@ -96,4 +98,12 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
* @param icPartyActIds
*/
void deleteIcPartyAct(String customerId,String userId, List<String> icPartyActIds);
/**
* Desc: 党建日历生成年度活动计划查询
* @param formDTO
* @author zxc
* @date 2022/8/22 09:33
*/
List<YearSearchResultDTO> yearSearch(YearSearchFormDTO formDTO);
}

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

@ -36,8 +36,10 @@ 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.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -328,6 +330,32 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
return result;
}
/**
* Desc: 党建日历生成年度活动计划查询
* @param formDTO
* @author zxc
* @date 2022/8/22 09:33
*/
@Override
public List<YearSearchResultDTO> yearSearch(YearSearchFormDTO formDTO) {
ActAndScheduleListFormDTO secondForm = ConvertUtils.sourceToTarget(formDTO, ActAndScheduleListFormDTO.class);
secondForm.setSearchType("yearSearch");
disposeActAndScheduleListFormDTO(secondForm);
List<ActAndScheduleListResultDTO.ActivityListDTO> activityList = baseDao.getActivityList(secondForm);
List<YearSearchResultDTO> result = new ArrayList<>();
if (CollectionUtils.isNotEmpty(activityList)) {
disposeActivityList(secondForm, activityList);
Map<String, List<ActAndScheduleListResultDTO.ActivityListDTO>> groupByType = activityList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ActivityListDTO::getType));
groupByType.forEach((type,list) -> {
YearSearchResultDTO dto = new YearSearchResultDTO();
dto.setType(type);
dto.setActivityList(ConvertUtils.sourceToTarget(list, YearSearchResultDTO.YearSearchActivityListDTO.class));
result.add(dto);
});
}
return result;
}
/**
* Desc:
* @param formDTO
@ -340,11 +368,13 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId());
}
formDTO.setAgencyId(staffInfo.getAgencyId());
IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId());
if (null == icPartyOrgDTO){
throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId());
if (!formDTO.getSearchType().equals("yearSearch")){
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()));
}
formDTO.setPath(icPartyOrgDTO.getOrgPids().equals("") || icPartyOrgDTO.getOrgPids().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId()));
}

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

@ -30,6 +30,10 @@
<result property="isPublicValue" column="isPublicValue"/>
<result property="isPublish" column="isPublish"/>
<result property="type" column="type"/>
<result property="autoPublicTime" column="autoPublicTime"/>
<result property="autoInformDay" column="autoInformDay"/>
<result property="isAutoInformValue" column="isAutoInformValue"/>
<result property="isAutoInform" column="isAutoInform"/>
<collection property="joinOrgList" ofType="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$JoinOrgDTO">
<result column="partyOrgId" property="partyOrgId"/>
</collection>
@ -40,6 +44,12 @@
pa.TOPIC,
pa.ADDRESS,
DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime,
(CASE WHEN pa.IS_AUTO_INFORM = '1' THEN '是'
WHEN pa.IS_AUTO_INFORM = '0' THEN '否'
ELSE '否' END) AS isAutoInformValue,
pa.IS_AUTO_INFORM as isAutoInform,
if(IS_AUTO_INFORM = '1',DATE_FORMAT(pa.AUTO_PUBLIC_TIME,'%Y-%m-%d %H:%i:%s'),'') AS autoPublicTime,
if(IS_AUTO_INFORM = '1',concat('活动开始前',pa.AUTO_PUBLIC_TYPE,'天'),'') as autoInformDay,
DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') AS dateId,
pa.ACT_TYPE AS type,
(CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员'
@ -59,6 +69,9 @@
<if test='null != dateId and dateId != "" '>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId}
</if>
<if test='searchType == "yearSearch" '>
AND pa.ORG_ID_PATH like concat('%',#{agencyId},'%')
</if>
<if test=' isSelf == "1" '>
AND pa.PUBLISH_STAFF_ID = #{staffId}
</if>
@ -68,7 +81,9 @@
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
<if test='null != path and path != ""'>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
</if>
</select>
<select id="selectPageList" parameterType="com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO" resultType="com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO">

Loading…
Cancel
Save