《管理表格系统》开发心得
浅浅记录一下自己开发两个月的心得,毕竟初入职场
一、写一个自己的脚手架【仅后端】
1.springboot版
2.springcloud版
二、注意写WBS
1 | 要件定义 |
企划构想 | |
要求定义 | |
要件定义(总结功能需求、前端样式需求、非功能性需求、开发环境、部署需求、可行性调查) | |
2 | 基本设计以及详细设计 |
功能模块设计 | |
数据库设计 | |
接口设计 | |
成果物 | 业务流程图、功能设计文档、前端页面展示文档、表单设计文档、数据库表excel设计、接口文档、WBS计划 |
3 | 开发 |
分模块 | |
4 | 总体测试 |
结合测试以及修复bug | |
5 | 反馈二次修正 |
6 | 部署发布 |
三、以脚手架开发,初入职场,技术全点后端了,前端一窍不通。
四、此次项目心得
1、估计工时往多的说
2、如果是controller控制器的接受参数和返回参数,都要新写form和vo
@JsonFormat(pattern = "yyyy-MM")
@NotEmpty(message = "dateStart内容不能为空")
@Pattern(regexp = "^\\d{4}-(0[1-9]|1[0-2])$", message = "dateStart内容不正确")
private String dateStart;
如果是不想返回的参数标注@JsonIgnore,或者单个字母打头要加@JsonProperty("cPrice")
3.查询有交集的记录范围
<include refid="relatedProjectTechnicianQuery"/>
WHERE rpt.del_flag = '0'
AND COALESCE(rpt.c_begin_month, '2000-01-01') <= #{dateEnd}
AND
(rpt.stop_month IS NOT NULL AND COALESCE(rpt.stop_month, '9999-12-01') > #{dateStart}
OR rpt.stop_month IS NULL AND COALESCE(rpt.c_end_month, '9999-12-01') > #{dateStart}
)
4.使用领域驱动设计的思想,每次都set字段,而不是简单的bean属性复制
5.List的过滤器使用
public List<MonthDataListVO> filterByRange(List<MonthDataListVO> monthDataListVOS, int minRange, int maxRange) {
return monthDataListVOS.stream()
.filter(data -> data.getYearMonth() >= minRange && data.getYearMonth() <= maxRange)
.collect(Collectors.toList());
}
public void sortProjectTechnicianList(List<ProjectTechnicianRow> projectTechnicianRows) {
projectTechnicianRows.sort((o1, o2) -> {
int cmp = o1.getCustomerName().compareTo(o2.getCustomerName());
if (cmp == 0) {
cmp = o1.getProjectName().compareTo(o2.getProjectName());
if (cmp == 0) {
cmp = o1.getBelongCompany().compareTo(o2.getBelongCompany());
if (cmp == 0) {
cmp = o1.getTechnicianId().compareTo(o2.getTechnicianId());
if (cmp == 0) {
cmp = o1.getCreateTime().compareTo(o2.getCreateTime());
}
}
}
}
return cmp;
});
}
//并通过项目名进行排序
basicProjectEntities.sort(Comparator.comparing(BasicProjectEntity::getProjectName));
List<Long> projectTechnicianIds = newTechnicianListVOS.stream().map(RelatedProjectTechnician::getProjectTechnicianId)
.collect(Collectors.toList());
public List<ProjectMonthListVO> sortJobTechnicianListVO(List<ProjectMonthListVO> jobTechnicianListVOS) {
jobTechnicianListVOS.sort(new Comparator<ProjectMonthListVO>() {
@Override
public int compare(ProjectMonthListVO o1, ProjectMonthListVO o2) {
int result = o1.getProjectName().compareTo(o2.getProjectName());
if (result == 0) {
result = o1.getBelongCompany().compareTo(o2.getBelongCompany());
}
return result;
}
});
return jobTechnicianListVOS;
}
public static List<TechnicianListVO> getTechniciansInRange(List<TechnicianListVO> technicianListVOS, String month) {
List<TechnicianListVO> count = technicianListVOS.stream()
.filter(record -> isOverlapping(record, DateUtils.toLocalDateFirstDay(month)))
.collect(Collectors.toList());
return count;
}
public static boolean isOverlapping(TechnicianListVO record, LocalDate tempMonth) {
LocalDate tempStart =DateUtils.toLocalDateFirstDay( record.getcBeginMonth());
LocalDate tempEnd = DateUtils.toLocalDateFirstDay( record.getcEndMonth());
if(!StringUtils.isEmpty(record.getStopMonth())){
tempEnd= DateUtils.toLocalDateFirstDay( record.getStopMonth());
}
// 判断 tempMonth 是否在 tempStart 和 tempEnd 之间,包括左边界
return !tempMonth.isBefore(tempStart) && tempMonth.isBefore(tempEnd);
}
原文地址:https://blog.csdn.net/m0_51235885/article/details/140555744
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!