24 changed files with 763 additions and 19 deletions
@ -0,0 +1,28 @@ |
|||
package com.epmet.screen.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 通用的agencyId topNum入参 |
|||
* @ClassName AgencyAndNumFormDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 10:29 |
|||
*/ |
|||
@Data |
|||
public class AgencyAndNumFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -8674763412362557239L; |
|||
|
|||
/** |
|||
* 显示多少条 不在这里设置默认值 不同的接口使用的默认值不同 在逻辑中判断 |
|||
* */ |
|||
private Integer topNum; |
|||
|
|||
/** |
|||
* 机关Id |
|||
* */ |
|||
@NotBlank(message = "机关Id不能为空" , groups = AgencyFormDTO.CommonAgencyIdGroup.class) |
|||
private String agencyId; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.screen.dto.form; |
|||
|
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 通用 agencyId 入参 |
|||
ClassName AgencyFormDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 10:29 |
|||
*/ |
|||
@Data |
|||
public class AgencyFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -2880432640584616651L; |
|||
|
|||
public interface CommonAgencyIdGroup extends CustomerClientShowGroup{} |
|||
|
|||
@NotBlank(message = "机关Id不能为空" , groups = CommonAgencyIdGroup.class) |
|||
private String agencyId; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.screen.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 通用 agencyId topNum type(各种类型)传参dto |
|||
* @ClassName AgencyNumTypeParamFormDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 13:36 |
|||
*/ |
|||
@Data |
|||
public class AgencyNumTypeParamFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -8049013016922130410L; |
|||
|
|||
public interface AgencyNumTypeParamGroup extends CustomerClientShowGroup{} |
|||
|
|||
/** |
|||
* agencyId |
|||
* */ |
|||
@NotBlank(message = "机关Id不能为空", groups = AgencyNumTypeParamGroup.class) |
|||
private String agencyId; |
|||
|
|||
private Integer topNum; |
|||
|
|||
/** |
|||
* 各种类型 |
|||
* */ |
|||
@NotBlank(message = "类型不能为空", groups = AgencyNumTypeParamGroup.class) |
|||
private String type; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 返参DTO |
|||
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
|
|||
* @ClassName DifficultProjectResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 13:43 |
|||
*/ |
|||
@Data |
|||
public class DifficultProjectResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7338625142484943434L; |
|||
|
|||
private String projectId; |
|||
|
|||
private String title; |
|||
|
|||
/** |
|||
* 状态: 待处理: pending; 结案closed |
|||
* */ |
|||
private String status; |
|||
|
|||
private Integer totalHours; |
|||
|
|||
/** |
|||
* yyyy-MM-dd HH:mm |
|||
* */ |
|||
private String createDateTime; |
|||
|
|||
private String gridName; |
|||
|
|||
private String imgUrl; |
|||
|
|||
private String categoryName; |
|||
|
|||
private Integer handleDepts; |
|||
|
|||
private Integer handleCount; |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.epmet.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 3、公众参与概况返参DTO |
|||
* @ClassName PublicPartiProfileResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 14:33 |
|||
*/ |
|||
@Data |
|||
public class PublicPartiProfileResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 2520835419152912027L; |
|||
|
|||
private Integer total; |
|||
|
|||
private String monthIncr; |
|||
|
|||
/** |
|||
* incr上升, decr下降 |
|||
* */ |
|||
private String monthTrend; |
|||
|
|||
private Integer averageIssue; |
|||
|
|||
/** |
|||
* 较上月百分比 |
|||
* */ |
|||
private String issueCompareLastestMonth; |
|||
|
|||
/** |
|||
* 较上月趋势:incr上升,decr下降 |
|||
* */ |
|||
private String issueCompareLatestTrend; |
|||
|
|||
/** |
|||
* 平均参与度 |
|||
* */ |
|||
private Integer averageJoin; |
|||
|
|||
private String joinCompareLatestMonth; |
|||
|
|||
private String joinCompareLatestTrend; |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 公众参与-排行榜 传参dto |
|||
* @ClassName PublicPartiRankResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 15:29 |
|||
*/ |
|||
@Data |
|||
public class PublicPartiRankResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -2958188980327497507L; |
|||
|
|||
private String name; |
|||
|
|||
private Integer regNum; |
|||
|
|||
private Integer joinNum; |
|||
|
|||
private Integer topicNum; |
|||
|
|||
private Integer issueNum; |
|||
|
|||
private Integer projectNum; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName UserPointRankResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 10:46 |
|||
*/ |
|||
@Data |
|||
public class UserPointRankResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 2829557017489626022L; |
|||
|
|||
/** |
|||
* 横坐标:姓名 |
|||
* */ |
|||
private List<String> nameData = new LinkedList<>(); |
|||
|
|||
/** |
|||
* 纵坐标:积分 |
|||
* */ |
|||
private List<Integer> pointsData = new LinkedList<>(); |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 用户积分DTO - 查询结果 |
|||
* @ClassName UserPointResultDTO |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 10:50 |
|||
*/ |
|||
@Data |
|||
public class UserPointResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -5174248184514429116L; |
|||
|
|||
private String name; |
|||
|
|||
private Integer point; |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.datareport.utils; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.google.common.collect.Maps; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName DateUtils |
|||
* @Auth wangc |
|||
* @Date 2020-08-20 10:56 |
|||
*/ |
|||
@Component |
|||
public class DateUtils { |
|||
/** |
|||
* @Description 返回当前月以及前十一个月,升序 |
|||
* @param |
|||
* @return Map<String,String> key:202001 value:1月 |
|||
* @author wangc |
|||
* @date 2020.08.19 12:46 |
|||
**/ |
|||
public Map<String,String> getX(){ |
|||
SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(new Date()); // 设置为当前时间
|
|||
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
|
|||
String currentMonth = format.format(calendar.getTime()); |
|||
Integer monthCounter = Integer.parseInt(currentMonth); |
|||
Map<String,String> monthMap = new HashMap<>(); |
|||
int i = NumConstant.ONE; |
|||
while(i <= NumConstant.TWELVE){ |
|||
|
|||
if(monthCounter.toString().endsWith("00")){ |
|||
monthCounter -= NumConstant.EIGHTY_EIGHT; |
|||
} |
|||
|
|||
String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); |
|||
if(abscissa.startsWith("0")) { |
|||
abscissa = abscissa.replace("0","").concat("月"); |
|||
}else{ |
|||
abscissa = abscissa.concat("月"); |
|||
} |
|||
monthMap.put(monthCounter.toString(),abscissa); |
|||
monthCounter-- ; |
|||
i++; |
|||
} |
|||
|
|||
Map<String, String> result = Maps.newLinkedHashMap(); |
|||
monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) |
|||
.forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* @Description 得到上个月的monthId |
|||
* @param |
|||
* @return |
|||
* @author wangc |
|||
* @date 2020.08.20 10:19 |
|||
**/ |
|||
public String getPreviousMonthId(){ |
|||
SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.setTime(new Date()); // 设置为当前时间
|
|||
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
|
|||
return format.format(calendar.getTime()); |
|||
} |
|||
|
|||
public String getPreviousMonthIdByDest(Date date,String dateStr){ |
|||
SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); |
|||
Calendar c = Calendar.getInstance(); |
|||
if(null == date && StringUtils.isNotBlank(dateStr)){ |
|||
try{ |
|||
date = format.parse(dateStr); |
|||
|
|||
}catch(Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
}else{ |
|||
return null; |
|||
} |
|||
c.setTime(date); |
|||
c.add(Calendar.MONTH, NumConstant.ONE_NEG); |
|||
return format.format(c.getTime()); |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.datareport.utils; |
|||
|
|||
public interface ModuleConstant { |
|||
|
|||
String PARAM_BRANCH_CATEGORY_UNION = "ljgj"; |
|||
|
|||
String PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "ljdyzy"; |
|||
|
|||
String PARAM_BRANCH_CATEGORY_PARTY = "zbjs"; |
|||
|
|||
String KEY_BRANCH_CATEGORY_UNION = "union"; |
|||
|
|||
String KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "voluntaryservice"; |
|||
|
|||
String KEY_BRANCH_CATEGORY_PARTY = "party"; |
|||
|
|||
String SYMBOL_PERCENT = "%"; |
|||
|
|||
String PARAM_DIFFICULTY_TYPE_TIME_LONGEST = "timelongest"; |
|||
|
|||
String PARAM_DIFFICULTY_TYPE_MOST_DEPTS = "mostdepts"; |
|||
|
|||
String PARAM_DIFFICULTY_TYPE_MOST_HANDLED = "mosthandled"; |
|||
} |
Loading…
Reference in new issue