Commit c6e6724f authored by nie'hong's avatar nie'hong

修改查询项目数量出错

parent 2f8e33d5
......@@ -36,9 +36,9 @@ public class DayWorkTimeAndType implements Serializable {
private String type;
/**
* 工时类型,正常,请假,调休
* 是否加班
*/
@ApiModelProperty(name = "type", value = "工时类型,正常,请假,调休")
@ApiModelProperty(name = "type", value = "是否加班")
private String isOvertime;
/**
......
......@@ -135,31 +135,31 @@ public class StatisticsServiceImpl implements StatisticsService {
//获取用户加班天数和漏报天数
Map<String, Object> map = new HashMap<>(6);
map.put("deptId",deptId);
map.put("month",month);
map.put("year",year);
// map.put("deptId", deptId);
map.put("month", month);
map.put("year", year);
for (StatisticsTableDto statisticsTableDto : statisticsTableDtos) {
map.put("userId",statisticsTableDto.getUserId());
map.put("userId", statisticsTableDto.getUserId());
//员工的加班天数
double overtimes=0.000;
double overtimes = 0.000;
//正常天数
double days=0.000;
double days = 0.000;
List<WorkTimeOrder> isOvertime = workTimeOrderMapper.getIsOvertime(map);
for (WorkTimeOrder workTimeOrder : isOvertime) {
if (workTimeOrder.getIsOvertime()==1) {
if (workTimeOrder.getIsOvertime() == 1) {
//当前天数
double overtimes1=workTimeOrder.getWorkTime();
//统计天数
overtimes+=overtimes1/8;
double overtimes1 = workTimeOrder.getWorkTime();
//统计天数
overtimes += overtimes1 / 8;
continue;
}
if (workTimeOrder.getIsOvertime()==0) {
if (workTimeOrder.getIsOvertime() == 0) {
//当前天数
double days1=workTimeOrder.getWorkTime();
double days1 = workTimeOrder.getWorkTime();
//统计天数
days +=days1/8;
days += days1 / 8;
}
}
statisticsTableDto.setOvertimes(overtimes);
......@@ -451,7 +451,7 @@ public class StatisticsServiceImpl implements StatisticsService {
public HSSFWorkbook exportWorkTimeExcel(GetMonthlyCollectParam param) {
log.info("StatisticsServiceImpl[]exportWorkTimeExcel[]input.param{}" + param);
//是否为当月,默认为false
boolean isToday=false;
boolean isToday = false;
// 去除分页条件
param.setSize(null);
param.setCurrentPage(null);
......@@ -468,12 +468,12 @@ public class StatisticsServiceImpl implements StatisticsService {
Date now = new Date();
int dayCount1;
int year = DateUtil.getYear(now);
int month = DateUtil.getMonth(now) + 1 ;
int month = DateUtil.getMonth(now) + 1;
if (year == param.getYear() && month == param.getMonth()) {
dayCount1 = DateUtil.daysBetween(DateUtil.getFirstDayOfMonth(now), now) + 1;
isToday=true;
}else{
isToday = true;
} else {
dayCount1 = dayCount;
}
......@@ -547,7 +547,7 @@ public class StatisticsServiceImpl implements StatisticsService {
row_i.createCell(3).setCellValue(next.getOvertimes());
row_i.getCell(3).setCellStyle(cellStyle);
//漏报天数
row_i.createCell(4).setCellValue(dates.size()-next.getUnderreportings());
row_i.createCell(4).setCellValue(dates.size() - next.getUnderreportings());
row_i.getCell(4).setCellStyle(cellStyle);
// 日期与工时集合
List<DayWorkTimeAndType> timeAndTypes = next.getDayWorkTimeAndTypeList();
......@@ -593,7 +593,6 @@ public class StatisticsServiceImpl implements StatisticsService {
// cell.setCellStyle(cellStyle);
// }
}
}
this.closeSheets(sheets);
......@@ -734,19 +733,19 @@ public class StatisticsServiceImpl implements StatisticsService {
map.remove("isAll");
for (UserWorkTimeStatisticsByProject userProjectWorkTimeStatistic : userProjectWorkTimeStatistics) {
//项目数
Integer projectNumbers=0;
Integer projectNumbers = 0;
//商机数
Integer businessNumbers=0;
map.put("userId",userProjectWorkTimeStatistic.getUserId());
Integer businessNumbers = 0;
map.put("userId", userProjectWorkTimeStatistic.getUserId());
//查询出用户项目和商机并分类统计
List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectPeojectNumbers(map);
for (WorkTimeOrder workTimeOrder : workTimeOrders) {
if (workTimeOrder.getType()==1) {
projectNumbers+=1;
if (workTimeOrder.getType() == 1) {
projectNumbers += 1;
}
if (workTimeOrder.getType()==2) {
businessNumbers+=1;
if (workTimeOrder.getType() == 2) {
businessNumbers += 1;
}
}
ProjectNumbers projectNumbers1 = new ProjectNumbers();
......@@ -802,7 +801,7 @@ public class StatisticsServiceImpl implements StatisticsService {
}
// 查询所管理项目的项目统计总计
List<ProjectStatisticsByMonth> projectStatisticsByMonths = workProjectTimeCostMapper.selectListByMonth(map);
List<ProjectStatisticsByMonth> projectStatisticsByMonths = workProjectTimeCostMapper.selectListByMonth(map);
// 合计统计为空,造合计对象
if (CollectionUtil.isEmpty(projectStatisticsByMonths)) {
......@@ -936,8 +935,6 @@ public class StatisticsServiceImpl implements StatisticsService {
row_1Cell4.setCellValue("参与商机数");
// 合计行
HSSFRow totalRow1 = sheet1.createRow(userWorkTimeStatisticsReport.size() + 1);
totalRow1.createCell(0).setCellValue("合计");
......@@ -1004,9 +1001,9 @@ public class StatisticsServiceImpl implements StatisticsService {
for (ProjectWorkTimeAndType projectWorkTimeAndType2 : projectWorkTimeAndType1) {
// 累加用户参与项目和商机数量
if (projectWorkTimeAndType2.getWorkTimeType() == 1) {
projectCount ++;
}else if (projectWorkTimeAndType2.getWorkTimeType() == 2){
boCount ++;
projectCount++;
} else if (projectWorkTimeAndType2.getWorkTimeType() == 2) {
boCount++;
}
/**
* 这里k从2变为4
......@@ -1079,9 +1076,9 @@ public class StatisticsServiceImpl implements StatisticsService {
short lastCellNum = row_2.getLastCellNum();
for (int i = 2; i < lastCellNum / 2; i++) {
CellRangeAddress cellRangeAddress4 = new CellRangeAddress(userWorkTimeStatisticsReport.size() + 2, userWorkTimeStatisticsReport.size() + 2, i*2, i*2+1);
sheet1.addMergedRegion(cellRangeAddress4);
setBorderStyle(cellRangeAddress4, sheet1);
CellRangeAddress cellRangeAddress4 = new CellRangeAddress(userWorkTimeStatisticsReport.size() + 2, userWorkTimeStatisticsReport.size() + 2, i * 2, i * 2 + 1);
sheet1.addMergedRegion(cellRangeAddress4);
setBorderStyle(cellRangeAddress4, sheet1);
/**
* 这里i>0 改为了i>1
......
......@@ -246,7 +246,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
}
}
if (isCentre == 0) {
deptAndManager -= 10;
deptAndManager -= 1;
}
}
}
......
......@@ -68,13 +68,13 @@ public class ShiroConfig {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("/login", "anon");
//map.put("/swagger-ui.html","anon");
//map.put("/swagger/**","anon");
map.put("/swagger-ui.html","anon");
map.put("/swagger/**","anon");
map.put("/webjars/**", "anon");
//map.put("/swagger-resources/**","anon");
map.put("/swagger-resources/**","anon");
map.put("/v2/**","anon");
map.put("/static/**", "anon");
//map.put("/**", "kickout");
// map.put("/**", "kickout");
map.put("/wxLogout", "wxLogout");
shiroFilterFactoryBean.setFilterChainDefinitionMap(map);
......
......@@ -32,52 +32,7 @@ spring:
password: admin!@#123
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
# oa-datasource:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driver-class-name: com.mysql.cj.jdbc.Driver
# jdbc-url: jdbc:mysql://172.18.1.12:3306/view_wh?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
# username: wh_read
# password: 8ik,*IK<
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# datasource:
# type: com.alibaba.druid.pool.DruidDataSource
# druid:
# driver-class-name: com.mysql.cj.jdbc.Driver
# jdbc-url: jdbc:mysql://192.168.110.84:3306/work_test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
# username: root
# password: admin!@#123
# initial-size: 10
# max-active: 100
# min-idle: 10
# max-wait: 60000
# # 打开PSCache,并且指定每个连接上PSCache的大小
# pool-prepared-statements: true
# max-pool-prepared-statement-per-connection-size: 20
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# #Oracle需要打开注释
# #validation-query: SELECT 1 FROM DUAL
# test-while-idle: true
# test-on-borrow: false
# test-on-return: false
# stat-view-servlet:
# enabled: true
# url-pattern: /druid/*
# #login-username: admin
# #login-password: admin
# # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
# filter:
# stat:
# log-slow-sql: true
# slow-sql-millis: 1000
# merge-sql: false
# wall:
# config:
# multi-statement-allow: true
# #文件上传配置
servlet:
multipart:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment