Browse Source

3、党员志愿服务

master
zxc 5 years ago
parent
commit
c6daa8fff3
  1. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java
  2. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java
  3. 36
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java
  4. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java
  5. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java
  6. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java
  7. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java
  8. 16
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/20 3:12 下午
*/
@Data
public class VolunteerServiceFormDTO implements Serializable {
private static final long serialVersionUID = 7916606646764729831L;
public interface VolunteerService{}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {VolunteerService.class})
private String agencyId;
}

35
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java

@ -0,0 +1,35 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/20 3:16 下午
*/
@Data
public class VolunteerServiceResult implements Serializable {
private static final long serialVersionUID = 959536759114517195L;
/**
* 月份ID
*/
private String monthId;
/**
* 组织次数
*/
private Integer organizeData;
/**
* 参与次数
*/
private Integer joinData;
/**
* 平均参与人次
*/
private Integer averageJoinUserData;
}

36
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/8/20 3:14 下午
*/
@Data
public class VolunteerServiceResultDTO implements Serializable {
private static final long serialVersionUID = -6227889392267793005L;
/**
* x轴返回近12个月不包含当前月
*/
private List<String> xAxis;
/**
* 组织次数
*/
private List<Integer> organizeData;
/**
* 参与次数
*/
private List<Integer> joinData;
/**
* 平均参与人次
*/
private List<Integer> averageJoinUserData;
}

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java

@ -6,8 +6,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.screen.PartyMemberLeadService;
import com.epmet.screen.dto.form.ContactMassLineChartFormDTO;
import com.epmet.screen.dto.form.FineExampleFormDTO;
import com.epmet.screen.dto.form.VolunteerServiceFormDTO;
import com.epmet.screen.dto.result.ContactMassLineChartResultDTO;
import com.epmet.screen.dto.result.FineExampleResultDTO;
import com.epmet.screen.dto.result.VolunteerServiceResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -53,4 +55,17 @@ public class PartyMemberLeadController {
return new Result<ContactMassLineChartResultDTO>().ok(partyMemberLeadService.contactMassLineChart(contactMassLineChartFormDTO));
}
/**
* @Description 3党员志愿服务
* @param volunteerServiceFormDTO
* @author zxc
* @date 2020/8/20 3:19 下午
*/
@ExternalAppRequestAuth
@PostMapping("volunteerservice")
public Result<VolunteerServiceResultDTO> volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){
ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class);
return new Result<VolunteerServiceResultDTO>().ok(partyMemberLeadService.volunteerService(volunteerServiceFormDTO));
}
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java

@ -19,6 +19,7 @@ package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO;
import com.epmet.screen.dto.result.BranchIssueDataResultDTO;
import com.epmet.screen.dto.result.VolunteerServiceResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -53,4 +54,12 @@ public interface ScreenPartyBranchDataDao {
List<BranchIssueDataResultDTO> selectBranchDataByTypeAndTimeZone(@Param("agencyId") String agencyId , @Param("type") String type, @Param("category") String category, @Param("bottomMonthId") String bottomMonthId);
List<BranchBuildOrderByCountResultDTO> selectBranchDataByTypeOrder(String agencyId,String category,String monthId,String bottomMonthId);
/**
* @Description 查询党员志愿服务
* @param agencyId
* @author zxc
* @date 2020/8/20 3:30 下午
*/
List<VolunteerServiceResult> selectVolunteerServiceResult(@Param("agencyId")String agencyId);
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java

@ -2,8 +2,10 @@ package com.epmet.datareport.service.screen;
import com.epmet.screen.dto.form.ContactMassLineChartFormDTO;
import com.epmet.screen.dto.form.FineExampleFormDTO;
import com.epmet.screen.dto.form.VolunteerServiceFormDTO;
import com.epmet.screen.dto.result.ContactMassLineChartResultDTO;
import com.epmet.screen.dto.result.FineExampleResultDTO;
import com.epmet.screen.dto.result.VolunteerServiceResultDTO;
/**
* 党建引领相关各指标查询
@ -29,4 +31,12 @@ public interface PartyMemberLeadService {
*/
ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO);
/**
* @Description 3党员志愿服务
* @param volunteerServiceFormDTO
* @author zxc
* @date 2020/8/20 3:19 下午
*/
VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO);
}

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java

@ -1,18 +1,21 @@
package com.epmet.datareport.service.screen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao;
import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao;
import com.epmet.datareport.service.screen.PartyMemberLeadService;
import com.epmet.screen.dto.form.ContactMassLineChartFormDTO;
import com.epmet.screen.dto.form.FineExampleFormDTO;
import com.epmet.screen.dto.result.ContactMassLineChartResult;
import com.epmet.screen.dto.result.ContactMassLineChartResultDTO;
import com.epmet.screen.dto.result.FineExampleResultDTO;
import com.epmet.screen.dto.form.VolunteerServiceFormDTO;
import com.epmet.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 党建引领相关各指标查询
@ -25,6 +28,10 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@Autowired
private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao;
@Autowired
private GrassrootsPartyDevServiceImpl grassrootsPartyDevServiceImpl;
@Autowired
private ScreenPartyBranchDataDao screenPartyBranchDataDao;
/**
* @Description 1先锋模范
@ -67,4 +74,42 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
result.setGroupMemberData(groupMemberData);
return result;
}
/**
* @Description 3党员志愿服务
* @param volunteerServiceFormDTO
* @author zxc
* @date 2020/8/20 3:19 下午
*/
@Override
public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) {
VolunteerServiceResultDTO result = new VolunteerServiceResultDTO();
List<Integer> organizeData = new ArrayList<>();
List<Integer> joinData = new ArrayList<>();
List<Integer> averageJoinUserData = new ArrayList<>();
Map<String, String> x = grassrootsPartyDevServiceImpl.getX();
result.setXAxis(x.values().stream().collect(Collectors.toList()));
List<VolunteerServiceResult> volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId());
if (volunteerServiceResults.size() == NumConstant.ZERO){
for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) {
organizeData.add(NumConstant.ZERO);
joinData.add(NumConstant.ZERO);
averageJoinUserData.add(NumConstant.ZERO);
}
result.setOrganizeData(organizeData);
result.setJoinData(joinData);
result.setAverageJoinUserData(averageJoinUserData);
return result;
}
List<VolunteerServiceResult> collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList());
collect.forEach(volunteer -> {
organizeData.add(volunteer.getOrganizeData());
joinData.add(volunteer.getJoinData());
averageJoinUserData.add(volunteer.getAverageJoinUserData());
});
result.setOrganizeData(organizeData);
result.setJoinData(joinData);
result.setAverageJoinUserData(averageJoinUserData);
return result;
}
}

16
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml

@ -67,4 +67,20 @@
joinData DESC
</select>
<!-- 查询党员志愿服务 -->
<select id="selectVolunteerServiceResult" resultType="com.epmet.screen.dto.result.VolunteerServiceResult">
SELECT
month_id AS monthId,
organize_count AS organizeData,
join_user_count AS joinData,
average_join_user_count AS averageJoinUserData
FROM
screen_party_branch_data
WHERE
del_flag = '0'
AND org_id = #{agencyId}
ORDER BY MONTH_ID DESC
LIMIT 12
</select>
</mapper>
Loading…
Cancel
Save