Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
work_service
Commits
7a45539d
Commit
7a45539d
authored
May 10, 2021
by
liaoanyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加工单筛选条件和工时导出信息
parent
c6872d2d
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
335 additions
and
64 deletions
+335
-64
PrimaryConfig.java
...nergy/common/config/multipleDatasource/PrimaryConfig.java
+0
-0
wisenergy-common.iml
wisenergy-common/wisenergy-common.iml
+2
-0
WorkProjectMapper.java
.../src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
+7
-0
WorkTimeOrderMapper.java
...rc/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
+14
-0
WorkOrderChangeMapper.xml
...apper/src/main/resources/mapper/WorkOrderChangeMapper.xml
+6
-4
WorkProjectMapper.xml
...gy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
+11
-2
WorkTimeOrderMapper.xml
...-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
+40
-2
wisenergy-mapper.iml
wisenergy-mapper/wisenergy-mapper.iml
+3
-6
DayWorkTimeAndType.java
.../main/java/cn/wisenergy/model/dto/DayWorkTimeAndType.java
+6
-0
ProjectNumbers.java
.../src/main/java/cn/wisenergy/model/dto/ProjectNumbers.java
+17
-0
StatisticsTableDto.java
.../main/java/cn/wisenergy/model/dto/StatisticsTableDto.java
+12
-0
UserWorkTimeStatisticsByProject.java
.../wisenergy/model/dto/UserWorkTimeStatisticsByProject.java
+7
-1
wisenergy-model.iml
wisenergy-model/wisenergy-model.iml
+2
-0
wisenergy-parent.iml
wisenergy-parent.iml
+2
-0
WorkProjectService.java
...rc/main/java/cn/wisenergy/service/WorkProjectService.java
+7
-0
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+145
-44
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+1
-0
WorkProjectServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
+30
-0
wisenergy-service.iml
wisenergy-service/wisenergy-service.iml
+2
-0
ShiroConfig.java
.../src/main/java/cn/wisenergy/shiro/config/ShiroConfig.java
+4
-4
wisenergy-shiro.iml
wisenergy-shiro/wisenergy-shiro.iml
+3
-1
WorkProjectController.java
...nergy/web/admin/controller/app/WorkProjectController.java
+12
-0
wisenergy-web-admin.iml
wisenergy-web-admin/wisenergy-web-admin.iml
+2
-0
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/config/multipleDatasource/
p
rimaryConfig.java
→
wisenergy-common/src/main/java/cn/wisenergy/common/config/multipleDatasource/
P
rimaryConfig.java
View file @
7a45539d
File moved
wisenergy-common/wisenergy-common.iml
View file @
7a45539d
...
...
@@ -82,6 +82,8 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkProjectMapper.java
View file @
7a45539d
...
...
@@ -79,4 +79,11 @@ public interface WorkProjectMapper extends BaseMapper<WorkProject> {
WorkProject
getByProjectOaId
(
@Param
(
"oaId"
)
String
oaId
);
/**
* 改变项目状态为恢复
* @param id 项目id
* @return
*/
int
updateIsConclusionById2
(
Integer
id
);
}
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/WorkTimeOrderMapper.java
View file @
7a45539d
...
...
@@ -112,6 +112,20 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
List
<
ProjectWorkTimeStatisticsDto
>
getProjectStatisticsDetail
(
Map
<
String
,
Object
>
map
);
/**
* 查询用户的商机数和项目数
* @param map
* @return
*/
List
<
WorkTimeOrder
>
selectPeojectNumbers
(
Map
<
String
,
Object
>
map
);
/**
* 查询加班数
* @param map
* @return
*/
List
<
WorkTimeOrder
>
getIsOvertime
(
Map
<
String
,
Object
>
map
);
int
countByWorkDay
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"enbDate"
)
String
endDate
);
int
addManyLeaveOrder
(
@Param
(
"workTimeOrders"
)
List
<
WorkTimeOrder
>
workTimeOrders
);
...
...
wisenergy-mapper/src/main/resources/mapper/WorkOrderChangeMapper.xml
View file @
7a45539d
...
...
@@ -21,8 +21,9 @@
AND DATE_FORMAT(oc.change_date, '%Y%m%d')
<
= DATE_FORMAT(#{endDate} ,'%Y%m%d')
</if>
<if
test=
"userName !=null"
>
AND (u2.name like concat('%',#{userName},'%')
OR u1.name like concat('%',#{userName},'%'))
AND (u1.name like concat('%',#{userName},'%') or
p.project_name like concat('%',#{userName},'%') or
u2.name like concat('%',#{userName},'%'))
</if>
AND oc.project_id IN
...
...
@@ -50,8 +51,9 @@
AND DATE_FORMAT(oc.change_date, '%Y%m%d')
<
= DATE_FORMAT(#{endDate} ,'%Y%m%d')
</if>
<if
test=
"userName !=null"
>
AND (u2.name like concat('%',#{userName},'%')
OR u1.name like concat('%',#{userName},'%'))
AND (u1.name like concat('%',#{userName},'%') or
p.project_name like concat('%',#{userName},'%') or
u2.name like concat('%',#{userName},'%'))
</if>
)
</if>
...
...
wisenergy-mapper/src/main/resources/mapper/WorkProjectMapper.xml
View file @
7a45539d
...
...
@@ -57,6 +57,13 @@
WHERE id = #{id}
</update>
<update
id=
"updateIsConclusionById2"
>
UPDATE
<include
refid=
"table"
/>
SET is_conclusion = 1, conclusion_time = now()
WHERE id = #{id}
</update>
<update
id=
"updateProject"
>
UPDATE
<include
refid=
"table"
/>
...
...
@@ -158,7 +165,8 @@
<if
test=
"null != key and key!=''"
>
AND (
p.project_name like concat('%',#{key},'%') OR
lu.manager_name like concat('%',#{key},'%')
lu.manager_name like concat('%',#{key},'%') or
p.business_id like concat('%',#{key},'%')
)
</if>
</if>
...
...
@@ -180,7 +188,8 @@
<if
test=
"null != key and key!=''"
>
AND (
p.project_name like concat('%',#{key},'%') OR
lu.manager_name like concat('%',#{key},'%')
lu.manager_name like concat('%',#{key},'%') or
p.business_id like concat('%',#{key},'%')
)
</if>
)
...
...
wisenergy-mapper/src/main/resources/mapper/WorkTimeOrderMapper.xml
View file @
7a45539d
...
...
@@ -528,7 +528,8 @@
AND o.work_day
<
= #{endDate}
</if>
<if
test=
"userName !=null"
>
AND u.name like concat('%',#{userName},'%')
AND (u.name like concat('%',#{userName},'%') or
p.project_name like concat('%',#{userName},'%'))
</if>
</if>
<if
test=
"types !=null and types.size()>0 "
>
...
...
@@ -547,7 +548,8 @@
AND o.work_day
<
= #{endDate}
</if>
<if
test=
"userName !=null"
>
AND u.name like concat('%',#{userName},'%')
AND (u.name like concat('%',#{userName},'%') or
p.project_name like concat('%',#{userName},'%'))
</if>
)
</if>
...
...
@@ -561,4 +563,40 @@
FROM work_time_order
WHERE work_day >= #{startDate} AND work_day
<
= #{enbDate} AND user_id = #{userId}
</select>
<select
id=
"selectPeojectNumbers"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select project_id,user_id,`type`
from work_time_order
<where>
<if
test=
"deptId !=null"
>
dept_id =#{deptId}
</if>
AND type IN (1,2)
<if
test=
"userId !=null"
>
AND user_id=#{userId}
</if>
<if
test=
"startDate !=null"
>
AND work_day >= #{startDate}
</if>
<if
test=
"endDate !=null"
>
AND work_day
<
= #{endDate}
</if>
</where>
GROUP BY project_id,user_id
</select>
<select
id=
"getIsOvertime"
resultMap=
"BaseResultMap"
parameterType=
"map"
>
select project_id,user_id,`type`,is_overtime
from work_time_order
<where>
<if
test=
"deptId !=null"
>
dept_id =#{deptId}
</if>
AND year(work_day) = #{year} AND month(work_day) = #{month} AND (status = 2 OR status=5)
<if
test=
"userId !=null"
>
AND user_id=#{userId}
</if>
</where>
group by day(work_day),is_overtime
</select>
</mapper>
wisenergy-mapper/wisenergy-mapper.iml
View file @
7a45539d
...
...
@@ -7,10 +7,6 @@
<facet
type=
"web"
name=
"Web"
>
<configuration>
<webroots
/>
<sourceRoots>
<root
url=
"file://$MODULE_DIR$/src/main/java"
/>
<root
url=
"file://$MODULE_DIR$/src/main/resources"
/>
</sourceRoots>
</configuration>
</facet>
</component>
...
...
@@ -18,9 +14,8 @@
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/resources"
type=
"java-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/
test"
isTestSource=
"tru
e"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/
main/resources"
type=
"java-resourc
e"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
...
...
@@ -91,6 +86,8 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/DayWorkTimeAndType.java
View file @
7a45539d
...
...
@@ -35,6 +35,12 @@ public class DayWorkTimeAndType implements Serializable {
@ApiModelProperty
(
name
=
"type"
,
value
=
"工时类型,正常,请假,调休"
)
private
String
type
;
/**
* 工时类型,正常,请假,调休
*/
@ApiModelProperty
(
name
=
"type"
,
value
=
"工时类型,正常,请假,调休"
)
private
String
isOvertime
;
/**
* 工时
*/
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/ProjectNumbers.java
0 → 100644
View file @
7a45539d
package
cn
.
wisenergy
.
model
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ProjectNumbers
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5380242876701694128L
;
//项目数
private
Integer
projectNumbers
;
//商机数
private
Integer
businessNumbers
;
}
wisenergy-model/src/main/java/cn/wisenergy/model/dto/StatisticsTableDto.java
View file @
7a45539d
...
...
@@ -36,6 +36,18 @@ public class StatisticsTableDto implements Serializable {
@ApiModelProperty
(
name
=
"userName"
,
value
=
"用户姓名"
)
private
String
userName
;
/**
* 用户姓名
*/
@ApiModelProperty
(
name
=
"overtimes"
,
value
=
"员工的加班天数"
)
private
Integer
overtimes
;
/**
* 用户姓名
*/
@ApiModelProperty
(
name
=
"underreportings"
,
value
=
"漏报天数"
)
private
Integer
underreportings
;
/**
* 一天工时类型和工时的集合
*/
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/UserWorkTimeStatisticsByProject.java
View file @
7a45539d
...
...
@@ -49,7 +49,13 @@ public class UserWorkTimeStatisticsByProject implements Serializable{
@ApiModelProperty
(
name
=
"projectWorkTimeAndType"
,
value
=
"项目工时列表"
)
private
List
<
ProjectWorkTimeAndType
>
projectWorkTimeAndType
;
/**
* 用户项目商机数
* @param obj
* @return
*/
@ApiModelProperty
(
name
=
"projectNumbers"
,
value
=
"用户的项目和商机数"
)
private
ProjectNumbers
projectNumbers
;
@Override
public
boolean
equals
(
Object
obj
)
{
...
...
wisenergy-model/wisenergy-model.iml
View file @
7a45539d
...
...
@@ -84,6 +84,8 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
wisenergy-parent.iml
View file @
7a45539d
...
...
@@ -35,5 +35,7 @@
<orderEntry
type=
"library"
name=
"Maven: org.ow2.asm:asm:4.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.slf4j:slf4j-api:1.7.26"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.ehcache:ehcache:3.6.3"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.pagehelper:pagehelper:5.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.github.jsqlparser:jsqlparser:1.0"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
wisenergy-service/src/main/java/cn/wisenergy/service/WorkProjectService.java
View file @
7a45539d
...
...
@@ -82,4 +82,11 @@ public interface WorkProjectService {
List
<
DeptOfProjectAndOrderType
>
getProjectOfFind
(
Integer
userId
);
PageInfo
queryOaProject
(
Integer
userId
,
Integer
typeId
,
String
projectNameOrNo
,
Integer
currentPage
,
Integer
pageSize
);
/**
* 改变项目状态为恢复
* @param projectId 项目id
* @return
*/
Boolean
updateIsConclusionById2
(
Integer
userId
,
Integer
projectId
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
7a45539d
...
...
@@ -121,16 +121,45 @@ public class StatisticsServiceImpl implements StatisticsService {
StatisticsTableDto
statisticsTableDto
=
statisticsTableDtoIterator
.
next
();
// 存放一位用户一个月中每天的工时信息
ArrayList
<
DayWorkTimeAndType
>
dayWorkTimeAndTypes1
=
new
ArrayList
<>();
// 查询出的工时信息遍历
Iterator
<
DayWorkTimeAndType
>
workTimeAndTypeIterator
=
dayWorkTimeAndTypes
.
iterator
();
while
(
workTimeAndTypeIterator
.
hasNext
())
{
DayWorkTimeAndType
dayWorkTimeAndType
=
workTimeAndTypeIterator
.
next
();
if
(
dayWorkTimeAndType
.
getUserId
().
equals
(
statisticsTableDto
.
getUserId
()))
{
dayWorkTimeAndTypes1
.
add
(
dayWorkTimeAndType
);
}
}
statisticsTableDto
.
setDayWorkTimeAndTypeList
(
dayWorkTimeAndTypes1
);
}
//获取用户加班天数和漏报天数
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
6
);
map
.
put
(
"deptId"
,
deptId
);
map
.
put
(
"month"
,
month
);
map
.
put
(
"year"
,
year
);
for
(
StatisticsTableDto
statisticsTableDto
:
statisticsTableDtos
)
{
map
.
put
(
"userId"
,
statisticsTableDto
.
getUserId
());
//员工的加班天数
Integer
overtimes
=
0
;
//正常天数
Integer
days
=
0
;
List
<
WorkTimeOrder
>
isOvertime
=
workTimeOrderMapper
.
getIsOvertime
(
map
);
for
(
WorkTimeOrder
workTimeOrder
:
isOvertime
)
{
if
(
workTimeOrder
.
getIsOvertime
()==
1
)
{
overtimes
+=
1
;
continue
;
}
if
(
workTimeOrder
.
getIsOvertime
()==
0
)
{
days
+=
1
;
}
}
statisticsTableDto
.
setOvertimes
(
overtimes
);
statisticsTableDto
.
setUnderreportings
(
days
);
}
pageInfo
.
setList
(
statisticsTableDtos
);
return
pageInfo
;
}
...
...
@@ -304,6 +333,7 @@ public class StatisticsServiceImpl implements StatisticsService {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"firstDayOfMonth"
,
startTime
);
// 中心级用户,
if
(
rank
.
contains
(
LevelRankEnum
.
CENTRAL_LEVEL
.
getRank
()))
{
// 获取用户所在中心
...
...
@@ -432,6 +462,7 @@ public class StatisticsServiceImpl implements StatisticsService {
int
dayCount1
;
int
year
=
DateUtil
.
getYear
(
now
);
int
month
=
DateUtil
.
getMonth
(
now
)
+
1
;
if
(
year
==
param
.
getYear
()
&&
month
==
param
.
getMonth
())
{
dayCount1
=
DateUtil
.
daysBetween
(
DateUtil
.
getFirstDayOfMonth
(
now
),
now
)
+
1
;
}
else
{
...
...
@@ -470,12 +501,16 @@ public class StatisticsServiceImpl implements StatisticsService {
row1
.
createCell
(
0
).
setCellValue
(
"序号"
);
row1
.
createCell
(
1
).
setCellValue
(
"部门名称"
);
row1
.
createCell
(
2
).
setCellValue
(
"姓名"
);
row1
.
createCell
(
3
).
setCellValue
(
"加班天数"
);
row1
.
createCell
(
4
).
setCellValue
(
"漏报天数"
);
row1
.
getCell
(
0
).
setCellStyle
(
cellStyle
);
row1
.
getCell
(
1
).
setCellStyle
(
cellStyle
);
row1
.
getCell
(
2
).
setCellStyle
(
cellStyle
);
row1
.
getCell
(
3
).
setCellStyle
(
cellStyle
);
row1
.
getCell
(
4
).
setCellStyle
(
cellStyle
);
for
(
int
i
=
1
;
i
<=
dayCount
;
i
++)
{
HSSFCell
cell
=
row1
.
createCell
(
2
+
i
);
HSSFCell
cell
=
row1
.
createCell
(
4
+
i
);
cell
.
setCellValue
(
i
+
"日"
);
// 如果为节假日
if
(!
days
.
contains
(
i
)
&&
i
<=
dayCount1
)
{
...
...
@@ -499,17 +534,25 @@ public class StatisticsServiceImpl implements StatisticsService {
// 姓名
row_i
.
createCell
(
2
).
setCellValue
(
next
.
getUserName
());
row_i
.
getCell
(
2
).
setCellStyle
(
cellStyle
);
//加班天数
row_i
.
createCell
(
3
).
setCellValue
(
next
.
getOvertimes
());
row_i
.
getCell
(
3
).
setCellStyle
(
cellStyle
);
//漏报天数
row_i
.
createCell
(
4
).
setCellValue
(
dates
.
size
()-
next
.
getUnderreportings
());
row_i
.
getCell
(
4
).
setCellStyle
(
cellStyle
);
// 日期与工时集合
List
<
DayWorkTimeAndType
>
timeAndTypes
=
next
.
getDayWorkTimeAndTypeList
();
// 在excel中对应日期单元格添加工时
for
(
DayWorkTimeAndType
timeAndType
:
timeAndTypes
)
{
HSSFCell
cell
=
row_i
.
getCell
(
timeAndType
.
getDay
()
+
2
);
HSSFCell
cell
=
row_i
.
getCell
(
timeAndType
.
getDay
()
+
4
);
String
cellValue
=
ExcelUtils
.
getCellValue
(
cell
,
true
);
// 单元格为空则直接写入,否则追加
if
(!
StringUtils
.
isEmpty
(
cellValue
))
{
cell
.
setCellValue
(
timeAndType
.
getType
()
+
timeAndType
.
getWorkTime
().
toString
()
+
"\n"
+
cellValue
);
}
else
{
HSSFCell
emptyCell
=
row_i
.
createCell
(
timeAndType
.
getDay
()
+
2
);
HSSFCell
emptyCell
=
row_i
.
createCell
(
timeAndType
.
getDay
()
+
4
);
emptyCell
.
setCellValue
(
timeAndType
.
getType
()
+
timeAndType
.
getWorkTime
().
toString
());
}
}
...
...
@@ -521,10 +564,10 @@ public class StatisticsServiceImpl implements StatisticsService {
HSSFRow
row
=
sheet
.
getRow
(
j
+
1
);
for
(
int
r
=
0
;
r
<
dayCount1
;
r
++)
{
HSSFCell
cell
;
if
(
row
.
getCell
(
r
+
3
)
==
null
)
{
cell
=
row
.
createCell
(
r
+
3
);
if
(
row
.
getCell
(
r
+
5
)
==
null
)
{
cell
=
row
.
createCell
(
r
+
5
);
}
else
{
cell
=
row
.
getCell
(
r
+
3
);
cell
=
row
.
getCell
(
r
+
5
);
}
// 获取单元格中的工时,当日总工时小于8,则单元格底色为红色
...
...
@@ -680,6 +723,34 @@ public class StatisticsServiceImpl implements StatisticsService {
projectWorkTimeAndType
.
setTotalTime
(
projectWorkTimeAndType
.
getNormalTime
()
+
projectWorkTimeAndType
.
getOverTime
());
}
//清楚查询条件
map
.
remove
(
"isAll"
);
for
(
UserWorkTimeStatisticsByProject
userProjectWorkTimeStatistic
:
userProjectWorkTimeStatistics
)
{
//项目数
Integer
projectNumbers
=
0
;
//商机数
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
()==
2
)
{
businessNumbers
+=
1
;
}
}
ProjectNumbers
projectNumbers1
=
new
ProjectNumbers
();
projectNumbers1
.
setProjectNumbers
(
projectNumbers
);
projectNumbers1
.
setBusinessNumbers
(
businessNumbers
);
userProjectWorkTimeStatistic
.
setProjectNumbers
(
projectNumbers1
);
//清除查询用户id
map
.
remove
(
"userId"
);
}
return
userProjectWorkTimeStatistics
;
}
...
...
@@ -835,7 +906,7 @@ public class StatisticsServiceImpl implements StatisticsService {
row0Cell0
.
setCellValue
(
"部门:"
+
dept
.
getDeptName
()
+
" 时间:"
+
statisticsStart
+
"-"
+
statisticsEnd
);
row0
.
setHeight
((
short
)
500
);
// 获取合计,写入项目名称和正常工时加班工时表头,
除开请假和调休,这两种类型没有正常和加班之分
// 获取合计,写入项目名称和正常工时加班工时表头,
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject
=
userWorkTimeStatisticsReport
.
get
(
userWorkTimeStatisticsReport
.
size
()
-
1
);
List
<
ProjectWorkTimeAndType
>
projectWorkTimeAndType
=
userWorkTimeStatisticsByProject
.
getProjectWorkTimeAndType
();
// 第1行,序号和人员的表头
...
...
@@ -847,6 +918,18 @@ public class StatisticsServiceImpl implements StatisticsService {
row_1Cell2
.
setCellValue
(
" 单位(小时)\n 姓名"
);
setDrawingPatriarch
(
sheet1
,
0
,
0
,
1023
,
255
,
(
short
)
1
,
1
,
(
short
)
1
,
2
);
/**
* 这里是增加
*/
// 参与项目数
HSSFCell
row_1Cell3
=
row_1
.
createCell
(
2
);
row_1Cell3
.
setCellValue
(
"参与项目数"
);
// 参数商机数
HSSFCell
row_1Cell4
=
row_1
.
createCell
(
3
);
row_1Cell4
.
setCellValue
(
"参数商机数"
);
// 合计行
HSSFRow
totalRow1
=
sheet1
.
createRow
(
userWorkTimeStatisticsReport
.
size
()
+
1
);
totalRow1
.
createCell
(
0
).
setCellValue
(
"合计"
);
...
...
@@ -855,53 +938,39 @@ public class StatisticsServiceImpl implements StatisticsService {
totalRow2
.
createCell
(
0
).
setCellValue
(
"总计"
);
// 项目行
HSSFRow
row_2
=
sheet1
.
createRow
(
2
);
/**
* // 这里面的i+1变成了i+2
*/
for
(
int
i
=
0
;
i
<
projectWorkTimeAndType
.
size
();
i
++)
{
// 项目名称单元格
HSSFCell
row_1Cell
;
// 总计行单元格
HSSFCell
totalRow2Cell
;
// if (!"请假".equals(projectWorkTimeAndType.get(i).getProjectName()) && !"调休".equals(projectWorkTimeAndType.get(i).getProjectName())) {
// 项目名称或类型名称
row_1Cell
=
row_1
.
createCell
((
i
+
1
)
*
2
);
totalRow2Cell
=
totalRow2
.
createCell
((
i
+
1
)
*
2
);
row_1Cell
=
row_1
.
createCell
((
i
+
2
)
*
2
);
totalRow2Cell
=
totalRow2
.
createCell
((
i
+
2
)
*
2
);
// 正常工时
HSSFCell
row2Cell
=
row_2
.
createCell
((
i
+
1
)
*
2
);
HSSFCell
row2Cell
=
row_2
.
createCell
((
i
+
2
)
*
2
);
row2Cell
.
setCellValue
(
"正常工时"
);
// 该项目正常工时合计
HSSFCell
cell1
=
totalRow1
.
createCell
((
i
+
1
)
*
2
);
HSSFCell
cell1
=
totalRow1
.
createCell
((
i
+
2
)
*
2
);
cell1
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getNormalTime
());
// 加班工时
HSSFCell
row2Cell1
=
row_2
.
createCell
((
i
+
1
)
*
2
+
1
);
HSSFCell
row2Cell1
=
row_2
.
createCell
((
i
+
2
)
*
2
+
1
);
row2Cell1
.
setCellValue
(
"加班工时"
);
// 该项目加班工时合计
HSSFCell
cell2
=
totalRow1
.
createCell
((
i
+
1
)
*
2
+
1
);
HSSFCell
cell2
=
totalRow1
.
createCell
((
i
+
2
)
*
2
+
1
);
cell2
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getOverTime
());
// } else {
// 合计行最后的列
// short lastCellNum = totalRow1.getLastCellNum();
// 调休和请假的类型名单元格
// row_1Cell = row_1.createCell(lastCellNum);
// 请假或调休的总计单元格
// totalRow2Cell = totalRow2.createCell(lastCellNum);
// 请假或调休合计
// HSSFCell cell1 = totalRow1.createCell(lastCellNum);
// cell1.setCellValue(projectWorkTimeAndType.get(i).getNormalTime());
// }
row_1Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getProjectName
());
totalRow2Cell
.
setCellValue
(
projectWorkTimeAndType
.
get
(
i
).
getTotalTime
());
}
// 所有项目的合计
// String lastProjectName = projectWorkTimeAndType.get(projectWorkTimeAndType.size() - 1).getProjectName();
short
row1_lastCellNum
=
row_1
.
getLastCellNum
();
// if (lastProjectName.equals("请假") || lastProjectName.equals("调休")) {
// row_1.createCell(row1_lastCellNum).setCellValue("合计");
// totalRow1.createCell(row1_lastCellNum).setCellValue(userWorkTimeStatisticsByProject.getTotalTime());
// totalRow2.createCell(row1_lastCellNum).setCellValue(userWorkTimeStatisticsByProject.getTotalTime());
// } else {
row_1
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
"总计"
);
totalRow1
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
totalRow2
.
createCell
(
row1_lastCellNum
+
1
).
setCellValue
(
userWorkTimeStatisticsByProject
.
getTotalTime
());
// }
for
(
int
i
=
0
;
i
<
userWorkTimeStatisticsReport
.
size
()
-
2
;
i
++)
{
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject1
=
userWorkTimeStatisticsReport
.
get
(
i
);
...
...
@@ -913,9 +982,29 @@ public class StatisticsServiceImpl implements StatisticsService {
// 第二列:姓名
HSSFCell
cell_1
=
row_i
.
createCell
(
1
);
cell_1
.
setCellValue
(
userWorkTimeStatisticsByProject1
.
getUserName
());
/**
* 参与项目和商机数量
*/
// 用户参与项目数量
int
projectCount
=
0
;
// 用户参与商机数量
int
boCount
=
0
;
// 项目的工时
for
(
ProjectWorkTimeAndType
projectWorkTimeAndType2
:
projectWorkTimeAndType1
)
{
for
(
int
k
=
2
;
k
<
row1_lastCellNum
;
k
++)
{
// 累加用户参与项目和商机数量
if
(
projectWorkTimeAndType2
.
getWorkTimeType
()
==
1
)
{
projectCount
++;
}
else
if
(
projectWorkTimeAndType2
.
getWorkTimeType
()
==
2
){
boCount
++;
}
/**
* 这里k从2变为4
*/
// 写入工时
for
(
int
k
=
4
;
k
<
row1_lastCellNum
;
k
++)
{
if
(
row_1
.
getCell
(
k
)
!=
null
&&
projectWorkTimeAndType2
.
getProjectName
().
equals
(
row_1
.
getCell
(
k
).
getStringCellValue
()))
{
if
(
projectWorkTimeAndType2
.
getNormalTime
()
!=
null
)
{
HSSFCell
cell_k_1
=
row_i
.
createCell
(
k
);
...
...
@@ -926,15 +1015,17 @@ public class StatisticsServiceImpl implements StatisticsService {
cell_k_2
.
setCellValue
(
projectWorkTimeAndType2
.
getOverTime
());
}
}
// if (row_1.getCell(k) != null && projectWorkTimeAndType1.get(j).getProjectName().equals(row_1.getCell(k).getStringCellValue())) {
// if (projectWorkTimeAndType1.get(j).getNormalTime() != null) {
// HSSFCell cell_k_1 = row_i.createCell(k);
// cell_k_1.setCellValue(projectWorkTimeAndType1.get(j).getNormalTime());
// }
// }
}
}
/**
* 写入参与项目商机数量
*/
// 项目数量
row_i
.
createCell
(
2
).
setCellValue
(
projectCount
);
// 商机数量
row_i
.
createCell
(
3
).
setCellValue
(
boCount
);
// 个人合计
short
lastCellNum
=
totalRow1
.
getLastCellNum
();
row_i
.
createCell
(
lastCellNum
-
1
).
setCellValue
(
userWorkTimeStatisticsByProject1
.
getTotalTime
());
...
...
@@ -952,6 +1043,15 @@ public class StatisticsServiceImpl implements StatisticsService {
CellRangeAddress
cellRangeAddress2
=
new
CellRangeAddress
(
1
,
2
,
1
,
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress2
);
setBorderStyle
(
cellRangeAddress2
,
sheet1
);
// 序号
CellRangeAddress
cellRangeAddressx
=
new
CellRangeAddress
(
1
,
2
,
2
,
2
);
sheet1
.
addMergedRegion
(
cellRangeAddressx
);
setBorderStyle
(
cellRangeAddressx
,
sheet1
);
// 人员
CellRangeAddress
cellRangeAddressy
=
new
CellRangeAddress
(
1
,
2
,
3
,
3
);
sheet1
.
addMergedRegion
(
cellRangeAddressy
);
setBorderStyle
(
cellRangeAddressy
,
sheet1
);
// 项目名后的合计
short
lastCellNum1
=
row_1
.
getLastCellNum
();
CellRangeAddress
cellRangeAddress6
=
new
CellRangeAddress
(
1
,
2
,
lastCellNum1
-
1
,
lastCellNum1
-
1
);
...
...
@@ -965,14 +1065,15 @@ public class StatisticsServiceImpl implements StatisticsService {
// 项目行和总计行,正常工时和加班工时表头列数
short
lastCellNum
=
row_2
.
getLastCellNum
();
for
(
int
i
=
0
;
i
<
lastCellNum
/
2
;
i
++)
{
// if (row_1.getCell(2 * i).getStringCellValue().equals("请假") || row_1.getCell(2 * i).getStringCellValue().equals("调休")) {
// continue;
// }
// 总计行
CellRangeAddress
cellRangeAddress4
=
new
CellRangeAddress
(
userWorkTimeStatisticsReport
.
size
()
+
2
,
userWorkTimeStatisticsReport
.
size
()
+
2
,
i
*
2
,
i
*
2
+
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress4
);
setBorderStyle
(
cellRangeAddress4
,
sheet1
);
if
(
i
>
0
)
{
/**
* 这里i>0 改为了i>1
*/
// 合并项目名称和其所在的行的下一列
if
(
i
>
1
)
{
CellRangeAddress
cellRangeAddress5
=
new
CellRangeAddress
(
1
,
1
,
i
*
2
,
i
*
2
+
1
);
sheet1
.
addMergedRegion
(
cellRangeAddress5
);
setBorderStyle
(
cellRangeAddress5
,
sheet1
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
7a45539d
...
...
@@ -158,6 +158,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
holidayAndAutoDto
.
setWorkTypes
(
workTypes
);
}
return
holidayAndAutoDto
;
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkProjectServiceImpl.java
View file @
7a45539d
...
...
@@ -292,6 +292,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
if
(
null
==
workProject
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_PROJECT_IS_NULL
);
}
workProjectMapper
.
updateIsConclusionById
(
projectId
);
// 插入更变日志
...
...
@@ -911,6 +912,35 @@ public class WorkProjectServiceImpl implements WorkProjectService {
return
pageInfo
;
}
@Override
public
Boolean
updateIsConclusionById2
(
Integer
userId
,
Integer
projectId
)
{
log
.
info
(
"WorkProjectServiceImpl[]endProject[]input.param.userId:{},projectId:{}"
+
userId
,
projectId
);
if
(!
UserRoleLevelUtils
.
isManagerLevel
(
userId
,
LevelEnum
.
PROJECT_MANAGER
.
getLevelName
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN
);
}
if
(
null
==
projectId
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
INPUT_PARAM_IS_NULL
);
}
WorkProject
workProject
=
workProjectMapper
.
selectById
(
projectId
);
if
(
null
==
workProject
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_PROJECT_IS_NULL
);
}
workProjectMapper
.
updateIsConclusionById2
(
projectId
);
// 插入更变日志
List
<
WorkProjectChange
>
workProjectChanges
=
new
ArrayList
<>();
WorkProjectChange
workProjectChange
=
new
WorkProjectChange
();
workProjectChange
.
setProjectId
(
projectId
);
workProjectChange
.
setReviserId
(
userId
);
workProjectChange
.
setModifyTime
(
new
Date
());
workProjectChange
.
setOperationType
(
2
);
workProjectChanges
.
add
(
workProjectChange
);
workProjectChangeService
.
insertbatch
(
workProjectChanges
);
return
true
;
}
private
PageInfo
<
ManagerProjectsDto
>
returnPageInfo
(
List
<
ManagerProjectsDto
>
managerProjectsDto
)
{
if
(
CollectionUtils
.
isEmpty
(
managerProjectsDto
))
{
...
...
wisenergy-service/wisenergy-service.iml
View file @
7a45539d
...
...
@@ -82,6 +82,8 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
wisenergy-shiro/src/main/java/cn/wisenergy/shiro/config/ShiroConfig.java
View file @
7a45539d
...
...
@@ -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
);
...
...
wisenergy-shiro/wisenergy-shiro.iml
View file @
7a45539d
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
version=
"4"
>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
...
...
@@ -80,6 +80,8 @@
<orderEntry
type=
"library"
name=
"Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/WorkProjectController.java
View file @
7a45539d
...
...
@@ -64,6 +64,18 @@ public class WorkProjectController extends BaseController {
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"恢复项目/商机"
,
notes
=
"恢复项目/商机"
,
httpMethod
=
"PUT"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"管理员id"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目id"
,
dataType
=
"int"
)
})
@PutMapping
(
value
=
"/startProject"
)
public
Result
<
Boolean
>
cProject
(
Integer
userId
,
Integer
projectId
)
{
log
.
info
(
"WorkProjectController[]startProject[]input.param.userId:{},projectId:{}"
+
userId
,
projectId
);
Boolean
aBoolean
=
workProjectService
.
updateIsConclusionById2
(
userId
,
projectId
);
return
getResult
(
aBoolean
);
}
@ApiOperation
(
value
=
"编辑项目/商机"
,
notes
=
"编辑项目/商机"
,
httpMethod
=
"PUT"
)
@ApiImplicitParam
(
name
=
"modifyProjectVo"
,
value
=
"编辑内容"
,
dataType
=
"ModifyProjectVo"
,
required
=
true
)
...
...
wisenergy-web-admin/wisenergy-web-admin.iml
View file @
7a45539d
...
...
@@ -80,6 +80,8 @@
<orderEntry
type=
"library"
name=
"Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-test:5.1.7.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.2"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.5.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.zaxxer:HikariCP:3.2.0"
level=
"project"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment