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

修改查询项目数量出错

parent 2f8e33d5
...@@ -36,9 +36,9 @@ public class DayWorkTimeAndType implements Serializable { ...@@ -36,9 +36,9 @@ public class DayWorkTimeAndType implements Serializable {
private String type; private String type;
/** /**
* 工时类型,正常,请假,调休 * 是否加班
*/ */
@ApiModelProperty(name = "type", value = "工时类型,正常,请假,调休") @ApiModelProperty(name = "type", value = "是否加班")
private String isOvertime; private String isOvertime;
/** /**
......
...@@ -135,31 +135,31 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -135,31 +135,31 @@ public class StatisticsServiceImpl implements StatisticsService {
//获取用户加班天数和漏报天数 //获取用户加班天数和漏报天数
Map<String, Object> map = new HashMap<>(6); Map<String, Object> map = new HashMap<>(6);
map.put("deptId",deptId); // map.put("deptId", deptId);
map.put("month",month); map.put("month", month);
map.put("year",year); map.put("year", year);
for (StatisticsTableDto statisticsTableDto : statisticsTableDtos) { 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); List<WorkTimeOrder> isOvertime = workTimeOrderMapper.getIsOvertime(map);
for (WorkTimeOrder workTimeOrder : isOvertime) { for (WorkTimeOrder workTimeOrder : isOvertime) {
if (workTimeOrder.getIsOvertime()==1) { if (workTimeOrder.getIsOvertime() == 1) {
//当前天数 //当前天数
double overtimes1=workTimeOrder.getWorkTime(); double overtimes1 = workTimeOrder.getWorkTime();
//统计天数 //统计天数
overtimes+=overtimes1/8; overtimes += overtimes1 / 8;
continue; 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); statisticsTableDto.setOvertimes(overtimes);
...@@ -451,7 +451,7 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -451,7 +451,7 @@ public class StatisticsServiceImpl implements StatisticsService {
public HSSFWorkbook exportWorkTimeExcel(GetMonthlyCollectParam param) { public HSSFWorkbook exportWorkTimeExcel(GetMonthlyCollectParam param) {
log.info("StatisticsServiceImpl[]exportWorkTimeExcel[]input.param{}" + param); log.info("StatisticsServiceImpl[]exportWorkTimeExcel[]input.param{}" + param);
//是否为当月,默认为false //是否为当月,默认为false
boolean isToday=false; boolean isToday = false;
// 去除分页条件 // 去除分页条件
param.setSize(null); param.setSize(null);
param.setCurrentPage(null); param.setCurrentPage(null);
...@@ -468,12 +468,12 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -468,12 +468,12 @@ public class StatisticsServiceImpl implements StatisticsService {
Date now = new Date(); Date now = new Date();
int dayCount1; int dayCount1;
int year = DateUtil.getYear(now); int year = DateUtil.getYear(now);
int month = DateUtil.getMonth(now) + 1 ; int month = DateUtil.getMonth(now) + 1;
if (year == param.getYear() && month == param.getMonth()) { if (year == param.getYear() && month == param.getMonth()) {
dayCount1 = DateUtil.daysBetween(DateUtil.getFirstDayOfMonth(now), now) + 1; dayCount1 = DateUtil.daysBetween(DateUtil.getFirstDayOfMonth(now), now) + 1;
isToday=true; isToday = true;
}else{ } else {
dayCount1 = dayCount; dayCount1 = dayCount;
} }
...@@ -547,7 +547,7 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -547,7 +547,7 @@ public class StatisticsServiceImpl implements StatisticsService {
row_i.createCell(3).setCellValue(next.getOvertimes()); row_i.createCell(3).setCellValue(next.getOvertimes());
row_i.getCell(3).setCellStyle(cellStyle); 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); row_i.getCell(4).setCellStyle(cellStyle);
// 日期与工时集合 // 日期与工时集合
List<DayWorkTimeAndType> timeAndTypes = next.getDayWorkTimeAndTypeList(); List<DayWorkTimeAndType> timeAndTypes = next.getDayWorkTimeAndTypeList();
...@@ -593,7 +593,6 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -593,7 +593,6 @@ public class StatisticsServiceImpl implements StatisticsService {
// cell.setCellStyle(cellStyle); // cell.setCellStyle(cellStyle);
// } // }
} }
} }
this.closeSheets(sheets); this.closeSheets(sheets);
...@@ -734,19 +733,19 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -734,19 +733,19 @@ public class StatisticsServiceImpl implements StatisticsService {
map.remove("isAll"); map.remove("isAll");
for (UserWorkTimeStatisticsByProject userProjectWorkTimeStatistic : userProjectWorkTimeStatistics) { for (UserWorkTimeStatisticsByProject userProjectWorkTimeStatistic : userProjectWorkTimeStatistics) {
//项目数 //项目数
Integer projectNumbers=0; Integer projectNumbers = 0;
//商机数 //商机数
Integer businessNumbers=0; Integer businessNumbers = 0;
map.put("userId",userProjectWorkTimeStatistic.getUserId()); map.put("userId", userProjectWorkTimeStatistic.getUserId());
//查询出用户项目和商机并分类统计 //查询出用户项目和商机并分类统计
List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectPeojectNumbers(map); List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectPeojectNumbers(map);
for (WorkTimeOrder workTimeOrder : workTimeOrders) { for (WorkTimeOrder workTimeOrder : workTimeOrders) {
if (workTimeOrder.getType()==1) { if (workTimeOrder.getType() == 1) {
projectNumbers+=1; projectNumbers += 1;
} }
if (workTimeOrder.getType()==2) { if (workTimeOrder.getType() == 2) {
businessNumbers+=1; businessNumbers += 1;
} }
} }
ProjectNumbers projectNumbers1 = new ProjectNumbers(); ProjectNumbers projectNumbers1 = new ProjectNumbers();
...@@ -936,8 +935,6 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -936,8 +935,6 @@ public class StatisticsServiceImpl implements StatisticsService {
row_1Cell4.setCellValue("参与商机数"); row_1Cell4.setCellValue("参与商机数");
// 合计行 // 合计行
HSSFRow totalRow1 = sheet1.createRow(userWorkTimeStatisticsReport.size() + 1); HSSFRow totalRow1 = sheet1.createRow(userWorkTimeStatisticsReport.size() + 1);
totalRow1.createCell(0).setCellValue("合计"); totalRow1.createCell(0).setCellValue("合计");
...@@ -1004,9 +1001,9 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -1004,9 +1001,9 @@ public class StatisticsServiceImpl implements StatisticsService {
for (ProjectWorkTimeAndType projectWorkTimeAndType2 : projectWorkTimeAndType1) { for (ProjectWorkTimeAndType projectWorkTimeAndType2 : projectWorkTimeAndType1) {
// 累加用户参与项目和商机数量 // 累加用户参与项目和商机数量
if (projectWorkTimeAndType2.getWorkTimeType() == 1) { if (projectWorkTimeAndType2.getWorkTimeType() == 1) {
projectCount ++; projectCount++;
}else if (projectWorkTimeAndType2.getWorkTimeType() == 2){ } else if (projectWorkTimeAndType2.getWorkTimeType() == 2) {
boCount ++; boCount++;
} }
/** /**
* 这里k从2变为4 * 这里k从2变为4
...@@ -1079,7 +1076,7 @@ public class StatisticsServiceImpl implements StatisticsService { ...@@ -1079,7 +1076,7 @@ public class StatisticsServiceImpl implements StatisticsService {
short lastCellNum = row_2.getLastCellNum(); short lastCellNum = row_2.getLastCellNum();
for (int i = 2; i < lastCellNum / 2; i++) { for (int i = 2; i < lastCellNum / 2; i++) {
CellRangeAddress cellRangeAddress4 = new CellRangeAddress(userWorkTimeStatisticsReport.size() + 2, userWorkTimeStatisticsReport.size() + 2, i*2, i*2+1); CellRangeAddress cellRangeAddress4 = new CellRangeAddress(userWorkTimeStatisticsReport.size() + 2, userWorkTimeStatisticsReport.size() + 2, i * 2, i * 2 + 1);
sheet1.addMergedRegion(cellRangeAddress4); sheet1.addMergedRegion(cellRangeAddress4);
setBorderStyle(cellRangeAddress4, sheet1); setBorderStyle(cellRangeAddress4, sheet1);
......
...@@ -246,7 +246,7 @@ public class WorkProjectServiceImpl implements WorkProjectService { ...@@ -246,7 +246,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
} }
} }
if (isCentre == 0) { if (isCentre == 0) {
deptAndManager -= 10; deptAndManager -= 1;
} }
} }
} }
......
...@@ -68,13 +68,13 @@ public class ShiroConfig { ...@@ -68,13 +68,13 @@ public class ShiroConfig {
LinkedHashMap<String, String> map = new LinkedHashMap<>(); LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("/login", "anon"); map.put("/login", "anon");
//map.put("/swagger-ui.html","anon"); map.put("/swagger-ui.html","anon");
//map.put("/swagger/**","anon"); map.put("/swagger/**","anon");
map.put("/webjars/**", "anon"); map.put("/webjars/**", "anon");
//map.put("/swagger-resources/**","anon"); map.put("/swagger-resources/**","anon");
map.put("/v2/**","anon"); map.put("/v2/**","anon");
map.put("/static/**", "anon"); map.put("/static/**", "anon");
//map.put("/**", "kickout"); // map.put("/**", "kickout");
map.put("/wxLogout", "wxLogout"); map.put("/wxLogout", "wxLogout");
shiroFilterFactoryBean.setFilterChainDefinitionMap(map); shiroFilterFactoryBean.setFilterChainDefinitionMap(map);
......
...@@ -32,52 +32,7 @@ spring: ...@@ -32,52 +32,7 @@ spring:
password: admin!@#123 password: admin!@#123
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource 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: servlet:
multipart: 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