Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
6ed334c1
Commit
6ed334c1
authored
Nov 05, 2020
by
mengbali153
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into master
parents
c86a51f8
a992516f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
2333 additions
and
532 deletions
+2333
-532
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+9
-8
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+46
-11
PrecipriceController.java
...e/sc/cement/business/controller/PrecipriceController.java
+215
-0
QualityController.java
...wise/sc/cement/business/controller/QualityController.java
+1
-1
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+53
-0
SysApprovalController.java
.../sc/cement/business/controller/SysApprovalController.java
+26
-0
SysGroupController.java
...ise/sc/cement/business/controller/SysGroupController.java
+11
-0
SysPostController.java
...wise/sc/cement/business/controller/SysPostController.java
+11
-0
EntityEnclosure.java
...va/cn/wise/sc/cement/business/entity/EntityEnclosure.java
+1
-0
Preciprice.java
...in/java/cn/wise/sc/cement/business/entity/Preciprice.java
+143
-0
TokenFilter.java
...n/java/cn/wise/sc/cement/business/filter/TokenFilter.java
+1
-1
EquipmentUseMapper.java
...cn/wise/sc/cement/business/mapper/EquipmentUseMapper.java
+8
-0
PrecipriceMapper.java
...a/cn/wise/sc/cement/business/mapper/PrecipriceMapper.java
+16
-0
SampleDistributionMapper.java
...e/sc/cement/business/mapper/SampleDistributionMapper.java
+3
-0
SysGroupMapper.java
...ava/cn/wise/sc/cement/business/mapper/SysGroupMapper.java
+2
-0
SysUserMapper.java
...java/cn/wise/sc/cement/business/mapper/SysUserMapper.java
+13
-0
EquipmentUseMapper.xml
...wise/sc/cement/business/mapper/xml/EquipmentUseMapper.xml
+8
-0
PrecipriceMapper.xml
...n/wise/sc/cement/business/mapper/xml/PrecipriceMapper.xml
+5
-0
SampleDistributionMapper.xml
...c/cement/business/mapper/xml/SampleDistributionMapper.xml
+14
-0
SysRoleMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/SysRoleMapper.xml
+1
-0
SysUserMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/SysUserMapper.xml
+5
-0
FileExt.java
...c/main/java/cn/wise/sc/cement/business/model/FileExt.java
+2
-1
UserQuery.java
...ava/cn/wise/sc/cement/business/model/query/UserQuery.java
+3
-0
EntrustVo.java
...n/java/cn/wise/sc/cement/business/model/vo/EntrustVo.java
+13
-0
IPrecipriceService.java
...n/wise/sc/cement/business/service/IPrecipriceService.java
+99
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+134
-31
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+5
-10
PrecipriceServiceImpl.java
...c/cement/business/service/impl/PrecipriceServiceImpl.java
+691
-0
SysRoleServiceImpl.java
...e/sc/cement/business/service/impl/SysRoleServiceImpl.java
+6
-0
UserServiceImpl.java
...wise/sc/cement/business/service/impl/UserServiceImpl.java
+36
-0
WeiXinService.java
...n/wise/sc/cement/business/service/impl/WeiXinService.java
+6
-1
CheckCountUtil.java
.../java/cn/wise/sc/cement/business/util/CheckCountUtil.java
+732
-459
PageUtil.java
...c/main/java/cn/wise/sc/cement/business/util/PageUtil.java
+4
-0
Global.java
...n/java/cn/wise/sc/cement/business/util/weixin/Global.java
+7
-7
application.yml
cement-business/src/main/resources/application.yml
+1
-1
fastdfs-client.properties
cement-business/src/main/resources/fastdfs-client.properties
+1
-1
entrust2.ftl
cement-business/src/main/resources/templates/entrust2.ftl
+1
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
6ed334c1
...
...
@@ -118,18 +118,19 @@ public class EntrustController {
@ApiOperation
(
"导出委托单"
)
public
void
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
HttpServletResponse
response
)
{
EntrustVo
entrustVo
=
entrustService
.
getDetailCapacity
(
entrustId
).
getData
();
// EntrustVo entrustVo = entrustService.getDetailCapacity(entrustId).getData();
EntrustVo
entrustVo
=
entrustService
.
getBaseDtail
(
entrustId
).
getData
();
if
(
entrustVo
==
null
)
{
return
;
}
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
7
);
beanParams
.
put
(
"clientName"
,
entrustVo
.
getClientName
());
beanParams
.
put
(
"entrustCode"
,
entrustVo
.
getEntrustCode
());
beanParams
.
put
(
"userName"
,
entrustVo
.
getUserName
());
beanParams
.
put
(
"userPhone"
,
entrustVo
.
getUserPhone
());
beanParams
.
put
(
"userFax"
,
entrustVo
.
getUserFax
());
beanParams
.
put
(
"projectName"
,
entrustVo
.
getProjectName
());
beanParams
.
put
(
"sampleNum"
,
entrustVo
.
getSampleNum
());
beanParams
.
put
(
"clientName"
,
entrustVo
.
getClientName
()
==
null
?
""
:
entrustVo
.
getClientName
()
);
beanParams
.
put
(
"entrustCode"
,
entrustVo
.
getEntrustCode
()
==
null
?
""
:
entrustVo
.
getEntrustCode
()
);
beanParams
.
put
(
"userName"
,
entrustVo
.
getUserName
()
==
null
?
""
:
entrustVo
.
getUserName
()
);
beanParams
.
put
(
"userPhone"
,
entrustVo
.
getUserPhone
()
==
null
?
""
:
entrustVo
.
getUserPhone
()
);
beanParams
.
put
(
"userFax"
,
entrustVo
.
getUserFax
()
==
null
?
""
:
entrustVo
.
getUserFax
()
);
beanParams
.
put
(
"projectName"
,
entrustVo
.
getProjectName
()
==
null
?
""
:
entrustVo
.
getProjectName
()
);
beanParams
.
put
(
"sampleNum"
,
entrustVo
.
getSampleNum
()
==
null
?
""
:
entrustVo
.
getSampleNum
()
);
//获取委托单样品列表(不包含平行样)
List
<
SampleVo
>
sampleList
=
new
ArrayList
<>(
entrustVo
.
getSampleList
().
size
());
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.model.vo.WorkloadStatisticsVo
;
import
cn.wise.sc.cement.business.service.INonStandardValueService
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.service.IPrecipriceService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -29,6 +37,7 @@ import java.util.Date;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -45,9 +54,18 @@ public class NormProductionController {
final
INormProductionService
iNormProductionService
;
final
IPrecipriceService
iPrecipriceService
;
final
INonStandardValueService
inonStandardValueService
;
final
ISysUserService
iSysUserService
;
public
NormProductionController
(
INormProductionService
iNormProductionService
)
{
public
NormProductionController
(
INormProductionService
iNormProductionService
,
IPrecipriceService
iPrecipriceService
,
INonStandardValueService
inonStandardValueService
,
ISysUserService
iSysUserService
)
{
this
.
iNormProductionService
=
iNormProductionService
;
this
.
iPrecipriceService
=
iPrecipriceService
;
this
.
inonStandardValueService
=
inonStandardValueService
;
this
.
iSysUserService
=
iSysUserService
;
}
@PostMapping
(
"/create"
)
...
...
@@ -93,6 +111,7 @@ public class NormProductionController {
return
iNormProductionService
.
activeOrForbidden
(
id
);
}
@GetMapping
(
"/statistics"
)
@ApiOperation
(
"标准产值统计"
)
public
BaseResponse
<
Page
<
NormProductionStatistics
>>
normProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
PageQuery
pageQuery
)
{
...
...
@@ -105,7 +124,7 @@ public class NormProductionController {
}
//将list拆分成分页
BaseResponse
<
List
<
NormProductionStatistics
>>
baseResponse
=
i
NormProduction
Service
BaseResponse
<
List
<
NormProductionStatistics
>>
baseResponse
=
i
Preciprice
Service
.
normProductionStatistics
(
startTime
,
endTime
,
name
,
groupId
);
if
(
baseResponse
.
getCode
()
==
200
)
{
List
<
NormProductionStatistics
>
data
=
baseResponse
.
getData
();
...
...
@@ -114,25 +133,32 @@ public class NormProductionController {
return
BaseResponse
.
okData
(
rts
);
}
}
return
BaseResponse
.
errorMsg
(
"没有找到相关数据!"
);
return
BaseResponse
.
okData
(
null
);
}
@GetMapping
(
"/statistics/detail"
)
@ApiOperation
(
"标准产值详情"
)
public
BaseResponse
<
Page
<
NormProduction
.
NormProductionDetail
>>
normProductionDetails
(
Integer
userId
,
String
start
,
String
end
,
PageQuery
pageQuery
)
{
Assert
.
notNull
(
userId
,
"用户id是必填的!"
);
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
NormProduction
.
NormProductionDetail
>
data
=
iNormProductionService
.
normProductionDetails
(
userId
,
startTime
,
endTime
);
if
(
data
.
size
()
!=
0
)
{
Page
<
NormProduction
.
NormProductionDetail
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
List
<
NormProduction
.
NormProductionDetail
>
data
=
iPrecipriceService
.
normProductionDetails
(
userId
,
startTime
,
endTime
);
List
<
NormProduction
.
NormProductionDetail
>
collect
=
data
.
stream
()
.
filter
(
arg
->
arg
.
getUserId
().
intValue
()
==
userId
)
.
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
!=
0
)
{
Page
<
NormProduction
.
NormProductionDetail
>
rts
=
PageUtil
.
listConvertToPage
(
collect
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
return
BaseResponse
.
errorMsg
(
"没有找到相关数据!"
);
return
BaseResponse
.
okData
(
null
);
}
@GetMapping
(
"/total/production"
)
...
...
@@ -146,8 +172,8 @@ public class NormProductionController {
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
ProductionVo
>
rts
=
i
NormProduction
Service
.
production
(
name
,
startTime
,
endTime
,
groupId
);
if
(!
rts
.
isEmpty
(
))
{
List
<
ProductionVo
>
rts
=
i
Preciprice
Service
.
production
(
name
,
startTime
,
endTime
,
groupId
);
if
(!
CollectionUtil
.
isEmpty
(
rts
))
{
Set
<
Integer
>
ids
=
new
HashSet
<>();
for
(
ProductionVo
productionVo
:
rts
)
{
Integer
groupId1
=
productionVo
.
getGroupId
();
...
...
@@ -207,7 +233,7 @@ public class NormProductionController {
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
i
NormProduction
Service
.
exportNormProductionDetail
(
userId
,
startTime
,
endTime
,
response
);
i
Preciprice
Service
.
exportNormProductionDetail
(
userId
,
startTime
,
endTime
,
response
);
}
@PostMapping
(
"/export/total/production"
)
...
...
@@ -228,6 +254,15 @@ public class NormProductionController {
@ApiOperation
(
"工作量统计"
)
public
BaseResponse
<
List
<
WorkloadStatisticsVo
>>
workloadStatistics
(
String
start
,
String
end
,
Integer
userId
)
{
LoginUser
loginUser
=
iSysUserService
.
getLoginUser
();
if
(
BeanUtil
.
isEmpty
(
loginUser
)){
return
BaseResponse
.
errorMsg
(
"请登录!"
);
}
if
(!
loginUser
.
getRoleList
().
getName
().
equals
(
"系统管理员"
))
{
userId
=
loginUser
.
getId
();
}
Date
startTime
=
null
;
Date
endTime
=
DateUtil
.
date
();
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
...
...
@@ -235,7 +270,7 @@ public class NormProductionController {
endTime
=
DateUtil
.
parseDate
(
end
);
}
return
BaseResponse
.
okData
(
i
NormProduction
Service
.
workloadStatistics
(
startTime
,
endTime
,
userId
));
return
BaseResponse
.
okData
(
i
Preciprice
Service
.
workloadStatistics
(
startTime
,
endTime
,
userId
));
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PrecipriceController.java
0 → 100644
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.model.vo.WorkloadStatisticsVo
;
import
cn.wise.sc.cement.business.service.INonStandardValueService
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.service.IPrecipriceService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-11-02
*/
@RestController
@Api
(
hidden
=
true
)
@RequestMapping
(
"/business/preciprice"
)
public
class
PrecipriceController
{
@Autowired
IPrecipriceService
iNormProductionService
;
@Autowired
INonStandardValueService
inonStandardValueService
;
@GetMapping
(
"/ddd"
)
@ApiOperation
(
"aaa"
)
public
void
add
(){
iNormProductionService
.
createPreciprice
(
1
,
1
,
1
,
1
,
1
);
}
@GetMapping
(
"/statistics"
)
@ApiOperation
(
"标准产值统计"
)
public
BaseResponse
<
Page
<
NormProductionStatistics
>>
normProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
PageQuery
pageQuery
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
//将list拆分成分页
BaseResponse
<
List
<
NormProductionStatistics
>>
baseResponse
=
iNormProductionService
.
normProductionStatistics
(
startTime
,
endTime
,
name
,
groupId
);
if
(
baseResponse
.
getCode
()
==
200
)
{
List
<
NormProductionStatistics
>
data
=
baseResponse
.
getData
();
if
(
data
.
size
()
!=
0
)
{
Page
<
NormProductionStatistics
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
}
return
BaseResponse
.
okData
(
null
);
}
@GetMapping
(
"/statistics/detail"
)
@ApiOperation
(
"标准产值详情"
)
public
BaseResponse
<
Page
<
NormProduction
.
NormProductionDetail
>>
normProductionDetails
(
Integer
userId
,
String
start
,
String
end
,
PageQuery
pageQuery
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
NormProduction
.
NormProductionDetail
>
data
=
iNormProductionService
.
normProductionDetails
(
userId
,
startTime
,
endTime
);
List
<
NormProduction
.
NormProductionDetail
>
collect
=
data
.
stream
()
.
filter
(
arg
->
arg
.
getUserId
().
intValue
()
==
userId
)
.
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
!=
0
)
{
Page
<
NormProduction
.
NormProductionDetail
>
rts
=
PageUtil
.
listConvertToPage
(
collect
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
return
BaseResponse
.
okData
(
null
);
}
@GetMapping
(
"/total/production"
)
@ApiOperation
(
"总产值统计"
)
public
BaseResponse
<
Page
<
ProductionVo
>>
production
(
PageQuery
pageQuery
,
String
name
,
String
start
,
String
end
,
Integer
groupId
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
ProductionVo
>
rts
=
iNormProductionService
.
production
(
name
,
startTime
,
endTime
,
groupId
);
if
(!
CollectionUtil
.
isEmpty
(
rts
))
{
Set
<
Integer
>
ids
=
new
HashSet
<>();
for
(
ProductionVo
productionVo
:
rts
)
{
Integer
groupId1
=
productionVo
.
getGroupId
();
ids
.
add
(
groupId1
);
}
List
<
ProductionVo
>
newRts
=
new
ArrayList
<>();
for
(
Integer
groupId1
:
ids
)
{
ProductionVo
finalNormProduction
=
new
ProductionVo
();
for
(
ProductionVo
productionVo
:
rts
)
{
if
(
productionVo
.
getGroupId
().
intValue
()
==
groupId1
)
{
finalNormProduction
.
setUserId
(
productionVo
.
getUserId
());
finalNormProduction
.
setUserName
(
productionVo
.
getUserName
());
finalNormProduction
.
setAccount
(
productionVo
.
getAccount
());
finalNormProduction
.
setPositionId
(
productionVo
.
getPositionId
());
finalNormProduction
.
setPosition
(
productionVo
.
getPosition
());
finalNormProduction
.
setTime
(
productionVo
.
getTime
());
finalNormProduction
.
setGroupId
(
productionVo
.
getGroupId
());
finalNormProduction
.
setGroupName
(
productionVo
.
getGroupName
());
Double
newFinalValue
=
productionVo
.
getProductionTotalValue
()
+
finalNormProduction
.
getProductionTotalValue
();
finalNormProduction
.
setProductionTotalValue
(
newFinalValue
);
Double
newNonProductionValue
=
productionVo
.
getNonProductionValue
()
+
finalNormProduction
.
getNonProductionValue
();
finalNormProduction
.
setNonProductionValue
(
newNonProductionValue
);
Double
newProductionValue
=
productionVo
.
getProductionValue
()
+
finalNormProduction
.
getProductionValue
();
finalNormProduction
.
setProductionValue
(
newProductionValue
);
}
}
newRts
.
add
(
finalNormProduction
);
}
rts
=
newRts
;
}
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
}
@PostMapping
(
"/export/statistics"
)
@ApiOperation
(
"导出标准产值列表"
)
public
void
exportNormProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
iNormProductionService
.
exportNormProductionStatistics
(
startTime
,
endTime
,
name
,
groupId
,
response
);
}
@PostMapping
(
"/export/statistics/detail"
)
@ApiOperation
(
"导出个人标准产值详情列表"
)
public
void
exportNormProductionDetails
(
Integer
userId
,
String
start
,
String
end
,
HttpServletResponse
response
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
iNormProductionService
.
exportNormProductionDetail
(
userId
,
startTime
,
endTime
,
response
);
}
@PostMapping
(
"/export/total/production"
)
@ApiOperation
(
"导出总产值"
)
public
void
exportProduction
(
String
name
,
String
start
,
String
end
,
Integer
groupId
,
HttpServletResponse
response
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
iNormProductionService
.
exportProduction
(
name
,
startTime
,
endTime
,
groupId
,
response
);
}
@GetMapping
(
"/workload/statistics"
)
@ApiOperation
(
"工作量统计"
)
public
BaseResponse
<
List
<
WorkloadStatisticsVo
>>
workloadStatistics
(
String
start
,
String
end
,
Integer
userId
)
{
Date
startTime
=
null
;
Date
endTime
=
DateUtil
.
date
();
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
);
endTime
=
DateUtil
.
parseDate
(
end
);
}
return
BaseResponse
.
okData
(
iNormProductionService
.
workloadStatistics
(
startTime
,
endTime
,
userId
));
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/QualityController.java
View file @
6ed334c1
...
...
@@ -61,7 +61,7 @@ public class QualityController {
List
<
EntrustVo
>
records
=
baseResponse
.
getData
().
getRecords
();
if
(
records
.
size
()
==
0
)
{
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
return
BaseResponse
.
okData
(
null
);
}
List
<
Integer
>
projectIds
=
records
.
stream
().
map
(
EntrustVo:
:
getId
).
collect
(
Collectors
.
toList
());
Set
<
Integer
>
qualityApplyIds
=
iQualityApplyService
.
selectQualityApplyStatusByProIds
(
projectIds
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.wise.sc.cement.business.entity.EntityEnclosure
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.FileExt
;
import
cn.wise.sc.cement.business.model.IndustrialElementKey
;
...
...
@@ -8,25 +10,33 @@ import cn.wise.sc.cement.business.model.PageQuery;
import
cn.wise.sc.cement.business.model.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.SixElementKey
;
import
cn.wise.sc.cement.business.model.SixElementReport
;
import
cn.wise.sc.cement.business.model.query.SampleHandleEnclosureQuery
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.service.IEntityEnclosureService
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.util.WordUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -47,6 +57,8 @@ public class ReportController {
final
IEntrustService
iEntrustService
;
@Autowired
IEntityEnclosureService
iEntityEnclosureService
;
public
ReportController
(
IEntrustService
iEntrustService
)
{
this
.
iEntrustService
=
iEntrustService
;
...
...
@@ -129,6 +141,45 @@ public class ReportController {
}
@PostMapping
(
"/upload"
)
@ApiOperation
(
"上传报告"
)
public
BaseResponse
<
Boolean
>
uploadReport
(
@RequestBody
SampleHandleEnclosureQuery
query
){
Assert
.
notNull
(
query
.
getId
(),
"委托id不能为空!"
);
QueryWrapper
<
EntityEnclosure
>
qw
=
new
QueryWrapper
();
qw
.
eq
(
"entity_type"
,
5
);
qw
.
eq
(
"entity_id"
,
query
.
getId
());
if
(
FileExt
.
EXCL
.
getName
().
equals
(
query
.
getExtName
())
||
FileExt
.
EXCLX
.
getName
().
equals
(
query
.
getExtName
())){
EntityEnclosure
one
=
iEntityEnclosureService
.
getOne
(
qw
);
if
(
BeanUtil
.
isEmpty
(
one
)){
EntityEnclosure
entityEnclosure
=
new
EntityEnclosure
();
entityEnclosure
.
setEntityId
(
query
.
getId
());
entityEnclosure
.
setExtName
(
query
.
getExtName
());
entityEnclosure
.
setCreateTime
(
LocalDateTime
.
now
());
entityEnclosure
.
setUpdateTime
(
LocalDateTime
.
now
());
entityEnclosure
.
setEnclosureUrl
(
query
.
getEnclosureUrl
());
entityEnclosure
.
setAlias
(
query
.
getAlias
());
entityEnclosure
.
setEntityType
(
5
);
iEntityEnclosureService
.
save
(
entityEnclosure
);
return
BaseResponse
.
okData
(
true
);
}
else
{
one
.
setAlias
(
query
.
getAlias
());
one
.
setEnclosureUrl
(
query
.
getEnclosureUrl
());
one
.
setExtName
(
query
.
getExtName
());
one
.
setUpdateTime
(
LocalDateTime
.
now
());
iEntityEnclosureService
.
updateById
(
one
);
return
BaseResponse
.
okData
(
true
);
}
}
else
{
return
BaseResponse
.
errorMsg
(
"文件类型只能是excel!"
);
}
}
/**
* 将样品六元素检测Map转换成单独属性
*
...
...
@@ -202,4 +253,6 @@ public class ReportController {
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysApprovalController.java
View file @
6ed334c1
...
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.SysGroup;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.service.ISysApprovalService
;
import
cn.wise.sc.cement.business.service.ISysDictionaryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
...
...
@@ -29,6 +30,8 @@ public class SysApprovalController {
@Autowired
private
ISysApprovalService
approvalService
;
@Autowired
private
ISysDictionaryService
dictionaryService
;
@ApiOperation
(
value
=
"审批分页列表"
)
@GetMapping
(
"/getPage"
)
...
...
@@ -78,5 +81,28 @@ public class SysApprovalController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除审批"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
approvalService
.
removeById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"删除审批{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取审批流程列表"
)
@GetMapping
(
"/getSampleFormList"
)
public
BaseResponse
getSampleFormList
()
{
try
{
return
dictionaryService
.
getContent
(
"审批流程"
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取审批流程列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysGroupController.java
View file @
6ed334c1
...
...
@@ -7,6 +7,9 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.RoleQuery
;
import
cn.wise.sc.cement.business.service.ISysGroupService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.wrapper.page.Query
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -35,6 +38,8 @@ public class SysGroupController {
@Autowired
private
ISysGroupService
groupService
;
@Autowired
private
ISysUserService
userService
;
@ApiOperation
(
value
=
"工作组分页列表"
)
@GetMapping
(
"/getPage"
)
...
...
@@ -100,6 +105,12 @@ public class SysGroupController {
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
QueryWrapper
<
SysUser
>
sysUserQueryWrapper
=
new
QueryWrapper
<>();
sysUserQueryWrapper
.
eq
(
"group_id"
,
id
);
Integer
conunts
=
userService
.
count
(
sysUserQueryWrapper
);
if
(
conunts
!=
0
&&
conunts
>
0
)
{
return
BaseResponse
.
errorMsg
(
conunts
+
"个用户正在使用!"
);
}
groupService
.
removeById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
catch
(
Exception
e
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysPostController.java
View file @
6ed334c1
...
...
@@ -2,10 +2,13 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.entity.SysPost
;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PostQuery
;
import
cn.wise.sc.cement.business.service.ISysPostService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -34,6 +37,8 @@ public class SysPostController {
@Autowired
private
ISysPostService
postService
;
@Autowired
private
ISysUserService
userService
;
@ApiOperation
(
value
=
"职务分页列表"
)
@ApiImplicitParams
(
value
=
{
...
...
@@ -102,6 +107,12 @@ public class SysPostController {
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
QueryWrapper
<
SysUser
>
sysUserQueryWrapper
=
new
QueryWrapper
<>();
sysUserQueryWrapper
.
eq
(
"post_id"
,
id
);
Integer
conunts
=
userService
.
count
(
sysUserQueryWrapper
);
if
(
conunts
!=
0
&&
conunts
>
0
)
{
return
BaseResponse
.
errorMsg
(
conunts
+
"个用户正在使用!"
);
}
postService
.
removeById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
catch
(
Exception
e
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/EntityEnclosure.java
View file @
6ed334c1
...
...
@@ -64,6 +64,7 @@ public class EntityEnclosure implements Serializable {
int
HEAD
=
0
;
int
EQUIPMENT_TEST
=
3
;
int
STANDARD_SAMPLE
=
4
;
int
ENTRUST_REPORT
=
5
;
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/Preciprice.java
0 → 100644
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-11-02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
Preciprice
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 样品名字
*/
private
String
sampleName
;
private
Integer
sex
;
/**
* 用户id
*/
private
Integer
userId
;
/**
* 样品id
*/
private
Integer
sampleId
;
/**
* 检测/处理Id
*/
private
Integer
targetId
;
/**
* 检测:1 处理:0
*/
private
Integer
type
;
/**
* 工值
*/
private
BigDecimal
preciprice
;
/**
* 考核占比
*/
private
BigDecimal
assessRate
;
/**
* 分析占比
*/
private
BigDecimal
analyseRate
;
/**
* 分样占比
*/
private
BigDecimal
separateRate
;
/**
* 报出分析结果
*/
private
BigDecimal
reportedAnalyseResult
;
/**
* 定额工日
*/
private
BigDecimal
quotaDay
;
/**
* 建议系数
*/
private
BigDecimal
coefficient
;
/**
* 考核工值
*/
private
BigDecimal
assessValue
;
/**
* 报结果占比
*/
private
BigDecimal
reportedResultRate
;
/**
* 时间
*/
private
long
createTime
;
/**
* 项目id
*/
private
Integer
entrustId
;
/**
* 项目id
*/
private
String
entrustName
;
/**
* 项目编号
*/
private
String
entrustCode
;
/**
* 账号
*/
private
String
account
;
/**
* 职位
*/
private
String
position
;
/**
* 部门id
*/
private
Integer
groupId
;
private
String
userName
;
/**
* 检测组名
*/
private
String
groupTeamName
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/filter/TokenFilter.java
View file @
6ed334c1
...
...
@@ -25,7 +25,7 @@ import org.springframework.web.filter.OncePerRequestFilter;
@Component
public
class
TokenFilter
extends
OncePerRequestFilter
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"
WeiXinService
"
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"
TokenFilter
"
);
public
static
final
String
TOKEN_KEY
=
"Authorization"
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EquipmentUseMapper.java
View file @
6ed334c1
...
...
@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* <p>
...
...
@@ -32,4 +33,11 @@ public interface EquipmentUseMapper extends BaseMapper<EquipmentUse> {
* @return list
*/
List
<
String
>
getEquipmentNamesByProjectId
(
@Param
(
"param"
)
Integer
entrustId
);
/**
* 根据设备ids获取使用到的设备名字
* @param ids 设备id
* @return list
*/
List
<
String
>
getEquipmentNamesByEquipmentIds
(
@Param
(
"params"
)
Set
<
Integer
>
ids
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PrecipriceMapper.java
0 → 100644
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Preciprice
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-11-02
*/
public
interface
PrecipriceMapper
extends
BaseMapper
<
Preciprice
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleDistributionMapper.java
View file @
6ed334c1
...
...
@@ -31,6 +31,9 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution>
List
<
SampleDistributionTeamVo
>
getDistributionTeamList
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
List
<
SampleDistributionTeamVo
>
getDistributionTeamGroupList
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
List
<
SampleCheckGroupVo
>
getSampleCheckGroupList
(
@Param
(
"sampleId"
)
Integer
sampleId
);
List
<
EntrustSample
>
getEntrustSample
();
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SysGroupMapper.java
View file @
6ed334c1
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.Map
;
...
...
@@ -21,4 +22,5 @@ public interface SysGroupMapper extends BaseMapper<SysGroup> {
IPage
<
GroupVo
>
getPage
(
@Param
(
"page"
)
Page
page
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SysUserMapper.java
View file @
6ed334c1
...
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.model.vo.UserVo;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Delete
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -26,4 +27,16 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
// List<Map<String,Object>> exportList(@Param("params") Map<String,Object> params);
@Delete
(
"delete from sys_role_user where user_id = #{userId}"
)
int
deleteUserRole
(
Integer
userId
);
int
saveUserRoles
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"roleId"
)
Integer
roleId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EquipmentUseMapper.xml
View file @
6ed334c1
...
...
@@ -52,5 +52,13 @@
WHERE eu.id IS NOT NULL
</select>
<select
id=
"getEquipmentNamesByEquipmentIds"
resultType=
"java.lang.String"
>
SELECT CONCAT(`name`,' (',`code`,')') FROM equipment
where id in
<foreach
collection=
"params"
open=
"("
close=
")"
item=
"id"
separator=
","
>
#{id}
</foreach>
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PrecipriceMapper.xml
0 → 100644
View file @
6ed334c1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PrecipriceMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionMapper.xml
View file @
6ed334c1
...
...
@@ -75,6 +75,20 @@
order by t.id asc
</select>
<select
id=
"getDistributionTeamGroupList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo"
>
select su.id as userId,
t.team_group_id as teamGroupId
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if
test=
"userId != null"
>
and t.user_id = #{userId}
</if>
group by t.team_group_id
</select>
<select
id=
"getSampleCheckGroupList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleCheckGroupVo"
>
select sd.team_group_id as teamGroupId, tg.name as teamGroupName,
sd.user_id as userId, su.name as userName
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SysRoleMapper.xml
View file @
6ed334c1
...
...
@@ -11,4 +11,5 @@
</insert>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SysUserMapper.xml
View file @
6ed334c1
...
...
@@ -38,6 +38,11 @@
where su.id = #{id}
</select>
<insert
id=
"saveUserRoles"
>
insert into sys_role_user(role_id, user_id) values
(#{roleId}, #{userId})
</insert>
<!-- <select id="exportList" resultType="java.util.HashMap">-->
<!-- SELECT-->
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/FileExt.java
View file @
6ed334c1
...
...
@@ -10,7 +10,8 @@ public enum FileExt {
//office后缀名
DOC
(
".doc"
),
EXCL
(
".xls"
);
EXCL
(
".xls"
),
EXCLX
(
".xlsx"
);
private
String
name
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/UserQuery.java
View file @
6ed334c1
...
...
@@ -68,4 +68,7 @@ public class UserQuery {
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"角色id"
)
private
Integer
roleId
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/EntrustVo.java
View file @
6ed334c1
...
...
@@ -126,4 +126,17 @@ public class EntrustVo {
@ApiModelProperty
(
"评审意见"
)
private
String
opinion
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"路径"
)
private
String
enclosureUrl
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPrecipriceService.java
0 → 100644
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.entity.Preciprice
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.model.vo.WorkloadStatisticsVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-11-02
*/
public
interface
IPrecipriceService
extends
IService
<
Preciprice
>
{
boolean
createPreciprice
(
final
Integer
userId
,
final
Integer
entrustId
,
final
Integer
targetId
,
final
Integer
type
,
final
Integer
sampleId
);
/**
* 标准产值统计
*
* @param start 开始时间
* @param end 结束时间
* @param groupId 部门id
* @return BaseResponse
*/
BaseResponse
<
List
<
NormProductionStatistics
>>
normProductionStatistics
(
Long
start
,
Long
end
,
String
name
,
Integer
groupId
);
/**
* 标准产值统计 单人详情
*
* @param userId 用户id
* @param start 开始时间
* @param end 结束时间
* @return 详细信息
*/
List
<
NormProduction
.
NormProductionDetail
>
normProductionDetails
(
Integer
userId
,
Long
start
,
Long
end
);
/**
* 总产值统计
*
* @param name 用户
* @param start 开始时间
* @param end 结束时间
* @return 详细信息
*/
List
<
ProductionVo
>
production
(
String
name
,
Long
start
,
Long
end
,
Integer
groupId
);
/**
* 导出标准统计
* @param start 开始时间
* @param end 结束时间
* @param name 人员名字
* @param groupId 部门id
* @param response 响应体
*/
void
exportNormProductionStatistics
(
Long
start
,
Long
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
);
/**
* 导出个人标准产值详情列表
* @param userId 用户id
* @param startTime 开始时间
* @param endTime 结束时间
* @param response 响应体
*/
void
exportNormProductionDetail
(
Integer
userId
,
Long
startTime
,
Long
endTime
,
HttpServletResponse
response
);
/**
* 导出产值总统计列表
* @param name 名字检索
* @param startTime 开始时间
* @param endTime 结束时间
* @param response 响应体
*/
void
exportProduction
(
String
name
,
Long
startTime
,
Long
endTime
,
Integer
groupId
,
HttpServletResponse
response
);
/**
* 统计工作量
* @param startTime 开始时间
* @param endTime 结束时间
* @return 统计对象
*/
List
<
WorkloadStatisticsVo
>
workloadStatistics
(
Date
startTime
,
Date
endTime
,
Integer
userId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
6ed334c1
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
6ed334c1
...
...
@@ -250,7 +250,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
normProductionDetails
(
null
,
start
,
end
);
if
(
normProductionDetails
.
size
()
==
0
)
{
BaseResponse
<
List
<
NormProductionStatistics
>>
rts
=
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
BaseResponse
<
List
<
NormProductionStatistics
>>
rts
=
BaseResponse
.
okData
(
null
);
rts
.
setData
(
new
ArrayList
<>());
return
rts
;
}
...
...
@@ -285,6 +285,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
continue
;
}
if
(
sysGroup
==
null
)
{
log
.
debug
(
"用户分组未设置!关联用户部门失败!"
);
continue
;
}
NormProductionStatistics
productionStatistics
=
new
NormProductionStatistics
();
...
...
@@ -346,22 +347,13 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
* 1.获取处理派发表数据,获取标准产值配置,查询处理项。
* */
//获取标准产值数据
QueryWrapper
<
SampleDistribution
>
qwDis
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleHandle
>
qwHan
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleCheckTeam
>
qwCT
=
new
QueryWrapper
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
2
);
if
(
userId
!=
null
&&
userId
>
0
)
{
qwDis
.
eq
(
"user_id"
,
userId
);
qwHan
.
eq
(
"user_id"
,
userId
);
qwCT
.
eq
(
"user_id"
,
userId
);
params
.
put
(
"user_id"
,
userId
);
}
if
(
start
!=
null
&&
end
!=
null
)
{
DateTime
startTime
=
DateUtil
.
date
(
start
);
DateTime
endTime
=
DateUtil
.
date
(
end
);
qwDis
.
between
(
"finish_time"
,
startTime
,
endTime
);
qwHan
.
between
(
"finish_time"
,
startTime
,
endTime
);
qwCT
.
between
(
"finish_time"
,
startTime
,
endTime
);
params
.
put
(
"start_time"
,
DateUtil
.
format
(
startTime
,
"yyyy-MM-dd"
));
params
.
put
(
"end_time"
,
DateUtil
.
format
(
endTime
,
"yyyy-MM-dd"
));
}
...
...
@@ -444,6 +436,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
//处理非标准产值没有用名职位信息
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
in
(
"id"
,
userIds
);
if
(
CollectionUtil
.
isEmpty
(
userIds
)){
return
null
;
}
List
<
SysUser
>
users
=
iSysUserService
.
list
(
qw
);
List
<
SysPost
>
sysPosts
=
iSysPostService
.
list
();
List
<
SysGroup
>
sysGroups
=
iSysGroupService
.
list
();
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PrecipriceServiceImpl.java
0 → 100644
View file @
6ed334c1
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SysRoleServiceImpl.java
View file @
6ed334c1
...
...
@@ -93,6 +93,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
@Transactional
public
BaseResponse
<
SysRole
>
update
(
RoleQuery
query
)
{
if
(
query
.
getId
()
==
1
){
return
BaseResponse
.
errorMsg
(
"系统管理员角色不允许修改!"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"角色名称不能为空!"
);
}
...
...
@@ -138,6 +141,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
@Transactional
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
if
(
id
==
1
){
return
BaseResponse
.
errorMsg
(
"系统管理员角色不允许删除!"
);
}
SysRole
role
=
roleMapper
.
selectById
(
id
);
if
(
role
==
null
)
{
return
BaseResponse
.
errorMsg
(
"角色不存在!"
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/UserServiceImpl.java
View file @
6ed334c1
...
...
@@ -2,9 +2,11 @@ package cn.wise.sc.cement.business.service.impl;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.entity.SysPermission
;
import
cn.wise.sc.cement.business.entity.SysRole
;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.exception.BusinessExceptionEnum
;
import
cn.wise.sc.cement.business.mapper.SysPermissionMapper
;
import
cn.wise.sc.cement.business.mapper.SysRoleMapper
;
import
cn.wise.sc.cement.business.mapper.SysUserMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
...
...
@@ -56,6 +58,8 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
RedisUtil
redisUtil
;
@Resource
private
SysPermissionMapper
permissionMapper
;
@Resource
private
SysRoleMapper
roleMapper
;
/**
* 当前登录用户
...
...
@@ -75,6 +79,8 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
LoginUser
loginUser
=
new
LoginUser
();
BeanUtils
.
copyProperties
(
sysUser
,
loginUser
);
List
<
SysPermission
>
permissionList
=
permissionMapper
.
listByUserId
(
loginUser
.
getId
());
SysRole
sysRole
=
roleMapper
.
byUserId
(
sysUser
.
getId
());
loginUser
.
setRoleList
(
sysRole
);
loginUser
.
setPermissions
(
permissionList
);
return
loginUser
;
}
catch
(
Exception
e
)
{
...
...
@@ -114,6 +120,9 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
if
(
StringUtils
.
isEmpty
(
query
.
getPhone
()))
{
return
BaseResponse
.
errorMsg
(
"手机号码不可为空!"
);
}
if
(
query
.
getRoleId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"请选择角色信息!"
);
}
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"phone"
,
query
.
getPhone
());
int
count
=
userMapper
.
selectCount
(
qw
);
...
...
@@ -124,6 +133,8 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
BeanUtils
.
copyProperties
(
query
,
user
);
user
.
setStatus
(
1
).
setIsDelete
(
1
).
setCreateTime
(
LocalDateTime
.
now
());
userMapper
.
insert
(
user
);
saveUserRoles
(
user
.
getId
(),
query
.
getRoleId
());
return
BaseResponse
.
okData
(
user
);
}
...
...
@@ -136,9 +147,15 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
@Override
@Transactional
public
BaseResponse
<
SysUser
>
update
(
UserQuery
query
)
{
if
(
query
.
getId
()
==
1
){
return
BaseResponse
.
errorMsg
(
"不允许更改系统管理员信息!"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getPhone
()))
{
return
BaseResponse
.
errorMsg
(
"手机号码不可为空!"
);
}
if
(
query
.
getRoleId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"请选择角色信息!"
);
}
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"phone"
,
query
.
getPhone
());
qw
.
ne
(
"id"
,
query
.
getId
());
...
...
@@ -150,9 +167,25 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
BeanUtils
.
copyProperties
(
query
,
user
);
user
.
setId
(
query
.
getId
());
userMapper
.
updateById
(
user
);
saveUserRoles
(
user
.
getId
(),
query
.
getRoleId
());
return
BaseResponse
.
okData
(
user
);
}
/**
* 保存用户和角色信息
* @param userId
* @param roleId
*/
private
void
saveUserRoles
(
Integer
userId
,
Integer
roleId
)
{
if
(
userId
!=
null
)
{
userMapper
.
deleteUserRole
(
userId
);
if
(
roleId
!=
null
)
{
userMapper
.
saveUserRoles
(
userId
,
roleId
);
}
}
}
/**
* 禁用启用
*
...
...
@@ -163,6 +196,9 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
@Override
@Transactional
public
BaseResponse
<
String
>
status
(
Integer
status
,
Integer
id
)
{
if
(
id
==
1
){
return
BaseResponse
.
errorMsg
(
"不允许更改系统管理员状态!"
);
}
if
(
status
==
null
||
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/WeiXinService.java
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
...
...
@@ -21,6 +22,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
@Service
public
class
WeiXinService
{
...
...
@@ -232,6 +235,8 @@ public class WeiXinService {
}
public
static
void
main
(
String
[]
args
)
{
BigDecimal
bigDecimal
=
NumberUtil
.
toBigDecimal
(
StrUtil
.
trim
(
"111 "
));
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/CheckCountUtil.java
View file @
6ed334c1
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/util/PageUtil.java
View file @
6ed334c1
package
cn
.
wise
.
sc
.
cement
.
business
.
util
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -13,6 +14,9 @@ import java.util.List;
public
class
PageUtil
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
null
;
}
int
start
=
pageQuery
.
getPageNo
()
>
0
?
pageQuery
.
getPageNo
()
:
1
;
int
pageSize
=
pageQuery
.
getPageSize
()
>
0
?
pageQuery
.
getPageSize
()
:
10
;
int
end
=
Math
.
min
((
start
*
pageSize
),
list
.
size
());
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/weixin/Global.java
View file @
6ed334c1
...
...
@@ -10,22 +10,22 @@ package cn.wise.sc.cement.business.util.weixin;
public
interface
Global
{
//企业应用的id,整型。可在应用的设置页面查看
public
final
static
int
agentId
=
1000002
;
//企业ID
public
final
static
String
corpId
=
"ww348f91b2573c1867"
;
//企业应用的id,整型。可在应用的设置页面查看
public
final
static
int
agentId
=
1000002
;
public
final
static
int
agentIdPC
=
1000003
;
//应用的凭证密钥
public
final
static
String
agentSecret
=
"gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o"
;
public
final
static
String
agentSecretPC
=
"itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A"
;
//编译后的回调地址
public
final
static
String
backUrl
=
"https%3a%2f%2fprogram.oxogroup.com%2flab-system"
;
//实验室管理系统链接
public
final
static
String
systemUrl
=
"<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
corpId
+
"&redirect_uri="
+
backUrl
+
"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统"
+
"</a>,"
;
//应用的凭证密钥PC
public
final
static
String
agentSecretPC
=
"itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A"
;
public
final
static
String
systemUrl
=
"<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
corpId
+
"&redirect_uri="
+
backUrl
+
"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统"
+
"</a>,"
;
/**
* 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET
...
...
cement-business/src/main/resources/application.yml
View file @
6ed334c1
...
...
@@ -8,7 +8,7 @@ spring:
datasource
:
# 192.168.110.85 admin!@#123
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
password
:
admin!@#123
driverClassName
:
com.mysql.cj.jdbc.Driver
...
...
cement-business/src/main/resources/fastdfs-client.properties
View file @
6ed334c1
...
...
@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port
=
8888
fastdfs.http.anti_steal_token
=
no
fastdfs.http.secret_key
=
FastDFS1234567890
fastdfs.tracker_servers
=
192.168.110.85
:22122
fastdfs.tracker_servers
=
localhost
:22122
#fastdfs.tracker_servers=localhost:22122
cement-business/src/main/resources/templates/entrust2.ftl
View file @
6ed334c1
...
...
@@ -2126,6 +2126,7 @@
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW
w:w=
"1754"
w:type=
"dxa"
/>
...
...
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