Browse Source

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

master
syc 3 years ago
parent
commit
094dd0477d
  1. 7
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql
  2. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  3. 146
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java
  4. 53
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java
  5. 33
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java
  6. 7
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java
  7. 53
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java
  8. 38
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  9. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java
  10. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java
  11. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  12. 77
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  13. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml
  14. 30
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

7
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql

@ -0,0 +1,7 @@
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458000894500866', 'icpartyact_auto_publish_time', '党组织活动自动发布时间', '党组织活动自动发布时间', 35, 0, 0, '1', '2022-08-19 10:45:54', '1', '2022-08-19 10:46:11');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458233091170305', 1560458000894500866, '活动开始前1天', '1', '0', '活动开始前1天', 1, 0, 0, '1', '2022-08-19 10:46:49', '1', '2022-08-19 10:46:49');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458276439302146', 1560458000894500866, '活动开始前3天', '3', '0', '活动开始前3天', 2, 0, 0, '1', '2022-08-19 10:47:00', '1', '2022-08-19 10:47:00');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458332076744705', 1560458000894500866, '活动开始前5天', '5', '0', '活动开始前5天', 3, 0, 0, '1', '2022-08-19 10:47:13', '1', '2022-08-19 10:47:13');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458388007788545', 1560458000894500866, '活动开始前7天', '7', '0', '活动开始前7天', 4, 0, 0, '1', '2022-08-19 10:47:26', '1', '2022-08-19 10:47:26');

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -1070,4 +1070,10 @@ public class DateUtils {
return cal.getTime();
}
public static Date calDateBaseDay(Date date, int day) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, day);
return calendar.getTime();
}
}

146
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java

@ -1,8 +1,18 @@
package com.epmet.resi.partymember.dto.icpartyact.form;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description
@ -12,7 +22,143 @@ import java.io.Serializable;
@Data
public class IcPartyActAddOrUpdateFormDTO implements Serializable {
private static final long serialVersionUID = -2554822505755122067L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
public interface UpdateUserInternalGroup {
}
public interface UpdateUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String customerId;
@NotBlank(message = "publishStaffId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String publishStaffId;
@NotBlank(message = "icPartyActId不能为空", groups = {UpdateUserInternalGroup.class})
private String icPartyActId;
/**
* 活动类型来源于ic_party_act_type_dict
*/
@NotBlank(message = "活动类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String actType;
/**
* 活动举办时间yyyy
*/
@NotBlank(message = "holdYearId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String holdYearId;
/**
* 活动举办时间:yyyyMM
*/
@NotBlank(message = "holdMonthId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String holdMonthId;
/**
* 举办活动时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@NotNull(message = "活动举办时间不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private Date holdTime;
/**
* 活动主题
*/
@NotBlank(message = "活动主题不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
@Length(max = 35, message = "最多输入35个字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String topic;
/**
* 活动地点
*/
@NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
@Length(max = 100, message = "活动地点最多输入100字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String address;
/**
* 活动地点纬度
*/
private String latitude;
/**
* 活动地点经度
*/
private String longitude;
/**
* 活动开始前几天
*/
@NotBlank(message = "自动发布时间不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private Integer autoPublicType;
/**
* 发布活动党组织
*/
@NotBlank(message = "发布活动党组织不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String publishPartyOrgId;
/**
* 发布活动党组织名称
*/
@NotBlank(message = "发布活动党组织名称不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String publishPartyOrgName;
/**
* 发布活动党组织ID的上级节点
*/
@NotBlank(message = "参加活动党组织ID的上级节点不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String publishOrgPid;
/**
* 发布活动党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部6党小组
*/
@NotBlank(message = "发布活动党组织类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String publishOrgType;
/**
* 发布活动党组织PUBLISH_PARTY_ORG_ID的全路径包含自身方便前端回显
*/
@NotBlank(message = "", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String publishOrgPath;
/**
* 参加人员类型0全体党员1支部委员
*/
@NotBlank(message = "参加人员类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String joinUserType;
/**
* 是否自动通知参加人员0否1是
*/
@NotBlank(message = "自动通知参加人员不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String isAutoInform;
/**
* 活动介绍
*/
@NotBlank(message = "活动介绍不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
@Length(max = 1000, message = "活动介绍最多输入1000字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private String introduce;
/**
* 参加活动党组织
*/
@Valid
@NotEmpty(message = "参加活动党组织不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class})
private List<JoinOrgDTO> joinOrgList;
/**
* 附件表
*/
private List<FileCommonDTO> attachmentList;
}

53
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java

@ -0,0 +1,53 @@
package com.epmet.resi.partymember.dto.icpartyact.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author yzm
* @Date 2022/8/19 10:31
*/
@Data
public class JoinOrgDTO implements Serializable {
private static final long serialVersionUID = 6994576136698569857L;
//前端传入
/**
* 参加活动党组织ID,groupId
*/
@NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class})
private String joinOrgId;
/**
* 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部6党小组
*/
@NotBlank(message = "参加活动党组织类型不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class})
private String orgType;
/**
* 参加活动党组织ID的上级节点
*/
@NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class})
private String pid;
/**
* PARTY_ORG_ID的全路径包含自身方便前端回显
*/
@NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class})
private String joinOrgPath;
//接口内部赋值
/**
* 活动id
*/
private String icPartyActId;
/**
* 客户ID
*/
private String customerId;
}

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

@ -0,0 +1,33 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/8/19 13:52
* @DESC
*/
@Data
public class ActAndScheduleListFormDTO implements Serializable {
private static final long serialVersionUID = -6776882545589530612L;
private String startDate;
private String endDate;
private String dateId;
/**
* 是否本人创建的活动10
*/
private String isSelf;
/**
* 党组织ID
*/
private String orgId;
private String customerId;
private String staffId;
}

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;
}

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

@ -0,0 +1,53 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/8/19 13:41
* @DESC
*/
@Data
public class ActAndScheduleListResultDTO implements Serializable {
private static final long serialVersionUID = 7378300105829566449L;
private Integer scheduleTotal;
private Integer activityTotal;
private String dateId;
private List<ActivityListDTO> activityList;
private List<ScheduleListDTO> scheduleList;
@Data
public static class ActivityListDTO implements Serializable{
private static final long serialVersionUID = -9050507457068805831L;
private String activityId;
private String topic;
private String address;
private String holdTime;
private String type;
private String isPublicValue;
private String joinTypeValue;
private Boolean isMe;
}
public static class ScheduleListDTO implements Serializable{
private static final long serialVersionUID = 5372167729733804267L;
private String scheduleId;
private String title;
private String remindTime;
private String remark;
private Boolean isMe;
}
}

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

@ -11,8 +11,11 @@ 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.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -43,6 +46,13 @@ public class IcPartyActController {
public Result<Map<String,String>> addOrUpdate(@LoginUser TokenDto tokenDto,@RequestBody IcPartyActAddOrUpdateFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPublishStaffId(tokenDto.getUserId());
if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){
//修改活动
ValidatorUtils.validateEntity(formDTO,IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class);
}else{
//添加活动
ValidatorUtils.validateEntity(formDTO,IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class);
}
Map<String,String> map=icPartyActService.addOrUpdate(formDTO);
return new Result<Map<String, String>>().ok(map);
}
@ -97,5 +107,33 @@ public class IcPartyActController {
formDTO.setStaffId(tokenDto.getUserId());
return new Result<List<HomeMonthTotalResultDTO>>().ok(icPartyActService.getHomeMonthTotal(formDTO));
}
/**
* Desc:党建日历活动日程列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/8/19 13:57
*/
@PostMapping("actAndScheduleList")
public Result<ActAndScheduleListResultDTO> getActAndScheduleList(@RequestBody ActAndScheduleListFormDTO formDTO, @LoginUser TokenDto tokenDto){
formDTO.setStaffId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<ActAndScheduleListResultDTO>().ok(icPartyActService.getActAndScheduleList(formDTO));
}
/**
* Desc:党建日历某月/天数据搜索列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/8/19 14:00
*/
@PostMapping("homeSearch")
public Result<List<ActAndScheduleListResultDTO>> homeSearch(@RequestBody ActAndScheduleListFormDTO formDTO, @LoginUser TokenDto tokenDto){
formDTO.setStaffId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<ActAndScheduleListResultDTO>>().ok(icPartyActService.homeSearch(formDTO));
}
}

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);
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java

@ -52,17 +52,17 @@ public class IcPartyActEntity extends BaseEpmetEntity {
private String publishPartyOrgName;
/**
* 参加活动党组织ID的上级节点
* 发布活动党组织ID的上级节点
*/
private String publishOrgPid;
/**
* 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部6党小组
* 发布活动党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部6党小组
*/
private String publishOrgType;
/**
* PUBLISH_PARTY_ORG_ID的全路径包含自身方便前端回显
* 发布活动党组织PUBLISH_PARTY_ORG_ID的全路径包含自身方便前端回显
*/
private String publishOrgPath;

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

@ -8,7 +8,9 @@ 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.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import java.util.List;
@ -59,4 +61,20 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
* @return
*/
IcPartyActDetailResDTO queryActDetail(String customerId, String userId, String icPartyActId);
/**
* Desc: 党建日历活动日程列表
* @param formDTO
* @author zxc
* @date 2022/8/19 13:57
*/
ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO);
/**
* Desc: 党建日历某月/天数据搜索列表
* @param formDTO
* @author zxc
* @date 2022/8/19 14:01
*/
List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO);
}

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

@ -3,20 +3,34 @@ package com.epmet.modules.partyOrg.service.impl;
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.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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
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.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.ActAndScheduleListFormDTO;
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.commons.collections4.CollectionUtils;
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 java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -33,6 +47,12 @@ 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;
/**
* 活动类型列表
@ -61,8 +81,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;
}
@ -99,11 +132,29 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) {
//todo
IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class);
icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType()));
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId());
if (null == staffInfo) {
String msg = "查询工作人员信息异常";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
icPartyActEntity.setPublishStaffName(staffInfo.getRealName());
icPartyActEntity.setOrgId(staffInfo.getAgencyId());
icPartyActEntity.setPid(staffInfo.getParentAgency().getId());
icPartyActEntity.setOrgIdPath(staffInfo.getAgencyPIds());
if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){
//删除附件、删除参加组织
}
return null;
}
/**
* 活动列表-分页查询
*
@ -129,4 +180,26 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
//todo
return null;
}
/**
* Desc: 党建日历活动日程列表
* @param formDTO
* @author zxc
* @date 2022/8/19 13:57
*/
@Override
public ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO) {
return null;
}
/**
* Desc: 党建日历某月/天数据搜索列表
* @param formDTO
* @author zxc
* @date 2022/8/19 14:01
*/
@Override
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) {
return null;
}
}

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