Browse Source

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

master
syc 3 years ago
parent
commit
5f2128c85b
  1. 41
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java
  2. 28
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/HomeMonthTotalResultDTO.java
  3. 20
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  4. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  5. 47
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

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

@ -0,0 +1,41 @@
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/19 08:59
* @DESC
*/
@Data
public class HomeMonthTotalFormDTO implements Serializable {
private static final long serialVersionUID = 1128815856169903825L;
public interface HomeMonthTotalForm{}
/**
* 年份ID
*/
@NotBlank(message = "yearId不能为空",groups = HomeMonthTotalForm.class)
private String yearId;
/**
* 党支部ID
*/
@NotBlank(message = "orgId不能为空",groups = HomeMonthTotalForm.class)
private String orgId;
/**
* 是否本人创建的活动10
*/
@NotBlank(message = "isSelf不能为空",groups = HomeMonthTotalForm.class)
private String isSelf;
private String staffId;
private String customerId;
}

28
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/HomeMonthTotalResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/8/19 08:57
* @DESC
*/
@Data
public class HomeMonthTotalResultDTO implements Serializable {
private static final long serialVersionUID = -4647982500373510830L;
private String monthId;
private Integer count;
public HomeMonthTotalResultDTO() {
this.monthId = "";
this.count = NumConstant.ZERO;
}
}

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

@ -3,10 +3,14 @@ package com.epmet.modules.partyOrg.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.resi.partymember.dto.icpartyact.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -37,7 +41,19 @@ public class IcPartyActController {
return new Result<List<IcPartActTypeDTO>>().ok(list);
}
// @PostMapping("homeMonthTotal")
// public Result
/**
* Desc: 党建日历首页-获取每月总数
* @param tokenDto
* @param formDTO
* @author zxc
* @date 2022/8/19 09:05
*/
@PostMapping("homeMonthTotal")
public Result<List<HomeMonthTotalResultDTO>> getHomeMonthTotal(@LoginUser TokenDto tokenDto,@RequestBody HomeMonthTotalFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, HomeMonthTotalFormDTO.HomeMonthTotalForm.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<List<HomeMonthTotalResultDTO>>().ok(icPartyActService.getHomeMonthTotal(formDTO));
}
}

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

@ -3,6 +3,8 @@ package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.resi.partymember.dto.icpartyact.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import java.util.List;
@ -20,4 +22,12 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
* @return
*/
List<IcPartActTypeDTO> actTypeList(String customerId);
/**
* Desc: 党建日历首页-获取每月总数
* @param formDTO
* @author zxc
* @date 2022/8/19 09:05
*/
List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO);
}

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

@ -2,13 +2,20 @@ 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.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.resi.partymember.dto.icpartyact.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
/**
@ -38,4 +45,44 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
/**
* Desc: 党建日历首页-获取每月总数 = 日程总数 + 活动总数
* 活动总数查询支部下的 + 是不是本人条件
* 日程查询当前组织下 本人的 + 其他人公开的
* @param formDTO
* @author zxc
* @date 2022/8/19 09:05
*/
@Override
public List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) {
List<HomeMonthTotalResultDTO> result = constructMonthData(formDTO.getYearId());
return result;
}
/**
* Desc: 构造结果集
* @param yearId
* @author zxc
* @date 2022/8/19 09:31
*/
public List<HomeMonthTotalResultDTO> constructMonthData(String yearId){
List<HomeMonthTotalResultDTO> result = new ArrayList<>();
if (StringUtils.isNotBlank(yearId)){
String[] array = new String[NumConstant.TWELVE];
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR,Integer.parseInt(yearId));
cal.set(Calendar.MONTH, NumConstant.ZERO);
for(int i=NumConstant.ZERO; i<NumConstant.TWELVE; i++){
array[i] = sdf.format(cal.getTime());
HomeMonthTotalResultDTO dto = new HomeMonthTotalResultDTO();
dto.setMonthId(array[i]);
result.add(dto);
cal.add(Calendar.MONTH, NumConstant.ONE);
}
}
return result;
}
}
Loading…
Cancel
Save