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
9679eb3e
Commit
9679eb3e
authored
Jan 27, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出功能 完善
parent
78398dbd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
180 additions
and
38 deletions
+180
-38
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+27
-8
EquipmentController.java
...se/sc/cement/business/controller/EquipmentController.java
+6
-5
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+37
-4
EquipmentMapper.xml
...cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
+4
-0
MethodMapper.xml
...va/cn/wise/sc/cement/business/mapper/xml/MethodMapper.xml
+5
-5
TeamMapper.xml
...java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
+3
-3
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+4
-3
IEquipmentService.java
...cn/wise/sc/cement/business/service/IEquipmentService.java
+2
-2
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+14
-3
EquipmentServiceImpl.java
...sc/cement/business/service/impl/EquipmentServiceImpl.java
+5
-2
TeamServiceImpl.java
...wise/sc/cement/business/service/impl/TeamServiceImpl.java
+2
-3
WordUtil.java
...c/main/java/cn/wise/sc/cement/business/util/WordUtil.java
+71
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
9679eb3e
...
@@ -158,7 +158,7 @@ public class EntrustController {
...
@@ -158,7 +158,7 @@ public class EntrustController {
});
});
beanParams
.
put
(
"list"
,
sampleList
);
beanParams
.
put
(
"list"
,
sampleList
);
WordUtil
.
writeWordReport
(
entrustVo
.
getEntrustCode
()
+
"-"
+
entrustVo
.
getProjectName
()
+
"-委托单"
,
"entrust2.ftl"
,
WordUtil
.
writeWordReport
SXB
(
entrustVo
.
getEntrustCode
()
+
"-"
+
entrustVo
.
getProjectName
()
+
"-委托单"
,
"entrust2.ftl"
,
beanParams
,
response
,
FileExt
.
DOC
);
beanParams
,
response
,
FileExt
.
DOC
);
}
}
...
@@ -198,12 +198,22 @@ public class EntrustController {
...
@@ -198,12 +198,22 @@ public class EntrustController {
@ApiOperation
(
value
=
"样品处理任务分页"
)
@ApiOperation
(
value
=
"样品处理任务分页"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"entrustCode"
,
value
=
"委托单号"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态(0未评审,1已通过,2未通过,"
+
"3样品处理中,4样品处理完成,"
+
"5样品检测中,6样品检测完成,"
+
"7校核中,8校核完成)"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientName"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"isUrgent"
,
value
=
"(1加急,0不加急)"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
})
})
@GetMapping
(
"/getSampleHandlePage"
)
@GetMapping
(
"/getSampleHandlePage"
)
public
BaseResponse
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
)
{
public
BaseResponse
getSampleHandlePage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
)
{
try
{
try
{
return
entrustService
.
getSampleHandlePage
(
pageQuery
,
projectCode
);
return
entrustService
.
getSampleHandlePage
(
pageQuery
,
entrustCode
,
status
,
clientName
,
projectName
,
projectCode
,
isUrgent
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"样品处理任务分页{}"
,
e
);
log
.
debug
(
"样品处理任务分页{}"
,
e
);
}
}
...
@@ -289,14 +299,23 @@ public class EntrustController {
...
@@ -289,14 +299,23 @@ public class EntrustController {
@ApiOperation
(
value
=
"派发任务分页列表"
)
@ApiOperation
(
value
=
"派发任务分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"entrustCode"
,
value
=
"委托单号"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态(0未评审,1已通过,2未通过,"
+
"3样品处理中,4样品处理完成,"
+
"5样品检测中,6样品检测完成,"
+
"7校核中,8校核完成)"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientName"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"isUrgent"
,
value
=
"(1加急,0不加急)"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
})
})
@GetMapping
(
"/getSampleDistributionPage"
)
@GetMapping
(
"/getSampleDistributionPage"
)
public
BaseResponse
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
public
BaseResponse
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
projectCode
)
{
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
)
{
try
{
try
{
return
entrustService
.
getSampleDistributionPage
(
pageQuery
,
projectName
,
projectCode
);
return
entrustService
.
getSampleDistributionPage
(
pageQuery
,
entrustCode
,
status
,
clientName
,
projectName
,
projectCode
,
isUrgent
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"派发任务分页列表{}"
,
e
);
log
.
debug
(
"派发任务分页列表{}"
,
e
);
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EquipmentController.java
View file @
9679eb3e
...
@@ -47,12 +47,13 @@ public class EquipmentController {
...
@@ -47,12 +47,13 @@ public class EquipmentController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"brand"
,
value
=
"设备品牌"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"brand"
,
value
=
"设备品牌"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"supplierId"
,
value
=
"供应商表id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"supplierId"
,
value
=
"供应商表id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"设备名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"name"
,
value
=
"设备名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"设备分类"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
@GetMapping
(
"/getPage"
)
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
)
{
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
,
String
type
)
{
try
{
try
{
return
equipmentService
.
getPage
(
pageQuery
,
brand
,
supplierId
,
name
);
return
equipmentService
.
getPage
(
pageQuery
,
brand
,
supplierId
,
name
,
type
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"设备分页列表{}"
,
e
);
log
.
debug
(
"设备分页列表{}"
,
e
);
}
}
...
@@ -100,9 +101,9 @@ public class EquipmentController {
...
@@ -100,9 +101,9 @@ public class EquipmentController {
@ApiOperation
(
"设备列表导出"
)
@ApiOperation
(
"设备列表导出"
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
type
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
try
{
equipmentService
.
export
(
brand
,
supplierId
,
name
,
fileName
,
response
);
equipmentService
.
export
(
brand
,
supplierId
,
name
,
type
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"设备列表导出{}"
,
e
);
log
.
debug
(
"设备列表导出{}"
,
e
);
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
9679eb3e
...
@@ -159,13 +159,31 @@
...
@@ -159,13 +159,31 @@
left join entrust e on e.id = s.entrust_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join client c on c.id = e.client_id
where
1=
1
where
e.is_delete =
1
<if
test=
"params.userId != null"
>
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
and t.user_id = #{params.userId}
</if>
</if>
<if
test=
"params.entrustCode != null and params.entrustCode != ''"
>
and e.entrust_code like concat('%', #{params.entrustCode}, '%')
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
and p.code like concat('%', #{params.projectCode}, '%')
</if>
</if>
<if
test=
"params.projectType != null and params.projectType != ''"
>
and e.project_type = #{params.projectType}
</if>
<if
test=
"params.clientName != null and params.clientName != ''"
>
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if
test=
"params.status != null"
>
and e.status = #{params.status}
</if>
<if
test=
"params.isUrgent != null"
>
and e.is_urgent = #{params.isUrgent}
</if>
group by e.id
group by e.id
order by e.update_time desc
order by e.update_time desc
</select>
</select>
...
@@ -196,16 +214,31 @@
...
@@ -196,16 +214,31 @@
left join entrust e on e.id = s.entrust_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join client c on c.id = e.client_id
where
1=
1
where
e.is_delete =
1
<if
test=
"params.userId != null"
>
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
and t.user_id = #{params.userId}
</if>
</if>
<if
test=
"params.
projectCode != null and params.projec
tCode != ''"
>
<if
test=
"params.
entrustCode != null and params.entrus
tCode != ''"
>
and
p.code like concat('%', #{params.projec
tCode}, '%')
and
e.entrust_code like concat('%', #{params.entrus
tCode}, '%')
</if>
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
and p.name like concat('%', #{params.projectName}, '%')
</if>
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.projectType != null and params.projectType != ''"
>
and e.project_type = #{params.projectType}
</if>
<if
test=
"params.clientName != null and params.clientName != ''"
>
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if
test=
"params.status != null"
>
and e.status = #{params.status}
</if>
<if
test=
"params.isUrgent != null"
>
and e.is_urgent = #{params.isUrgent}
</if>
GROUP BY e.id
GROUP BY e.id
order by e.update_time desc
order by e.update_time desc
</select>
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
View file @
9679eb3e
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
<if
test=
"params.name != null and params.name != ''"
>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
and t.name like concat('%', #{params.name}, '%')
</if>
</if>
<if
test=
"params.type != null and params.type != ''"
>
and t.type like concat('%', #{params.type}, '%')
</if>
</where>
</where>
</sql>
</sql>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/MethodMapper.xml
View file @
9679eb3e
...
@@ -15,11 +15,11 @@
...
@@ -15,11 +15,11 @@
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
SELECT
(@i:=@i+1) as 序号,
(@i:=@i+1) as 序号,
t.name
as 检测依据名,
IF(ISNULL(t.name),'',t.name)
as 检测依据名,
t.standard
as 标准号,
IF(ISNULL(t.standard),'',t.standard)
as 标准号,
t.number
as 检测依据编号,
IF(ISNULL(t.number),'',t.number)
as 检测依据编号,
t.do_date
as 实施日期,
IF(ISNULL(t.do_date),'',t.do_date)
as 实施日期,
t.up_date
as 更新日期
IF(ISNULL(t.up_date),'',t.up_date)
as 更新日期
FROM method t ,(select @i:=0)t
FROM method t ,(select @i:=0)t
<include
refid=
"where"
/>
<include
refid=
"where"
/>
ORDER BY t.id DESC
ORDER BY t.id DESC
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
View file @
9679eb3e
...
@@ -38,10 +38,10 @@
...
@@ -38,10 +38,10 @@
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
SELECT
(@i:=@i+1) as 序号,
(@i:=@i+1) as 序号,
t.name
as 检测项目,
IF(ISNULL(t.name),'',t.name )
as 检测项目,
IF(ISNULL(tg.name ),'',tg.name ) 所在检测组,
IF(ISNULL(tg.name ),'',tg.name ) 所在检测组,
t.method_name
as 检测依据,
IF(ISNULL(t.method_name),'',t.method_name)
as 检测依据,
t.charge
as 收费标准,
IF(ISNULL(t.charge),'',t.charge)
as 收费标准,
(
(
CASE t.qualifications
CASE t.qualifications
WHEN 0 THEN '资质外'
WHEN 0 THEN '资质外'
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
9679eb3e
...
@@ -47,7 +47,8 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -47,7 +47,8 @@ public interface IEntrustService extends IService<Entrust> {
// BaseResponse<String> handle(HandleQuery query);
// BaseResponse<String> handle(HandleQuery query);
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
);
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
);
...
@@ -63,8 +64,8 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -63,8 +64,8 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
);
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
);
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
projectCode
);
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEquipmentService.java
View file @
9679eb3e
...
@@ -20,9 +20,9 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -20,9 +20,9 @@ import javax.servlet.http.HttpServletResponse;
*/
*/
public
interface
IEquipmentService
extends
IService
<
Equipment
>
{
public
interface
IEquipmentService
extends
IService
<
Equipment
>
{
BaseResponse
<
IPage
<
EquipmentVo
>>
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
);
BaseResponse
<
IPage
<
EquipmentVo
>>
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
,
String
type
);
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
type
,
String
fileName
,
HttpServletResponse
response
);
void
exportTest
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
void
exportTest
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
9679eb3e
...
@@ -1306,13 +1306,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1306,13 +1306,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
)
{
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"entrustCode"
,
entrustCode
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientName"
,
clientName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"isUrgent"
,
isUrgent
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
params
.
put
(
"userId"
,
loginUser
.
getId
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
...
@@ -1723,15 +1729,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1723,15 +1729,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
entrustCode
,
Integer
status
,
String
projectCode
)
{
String
clientName
,
String
projectName
,
String
projectCode
,
Integer
isUrgent
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"entrustCode"
,
entrustCode
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientName"
,
clientName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"isUrgent"
,
isUrgent
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
params
.
put
(
"userId"
,
loginUser
.
getId
());
params
.
put
(
"userId"
,
loginUser
.
getId
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleDistributionPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleDistributionPage
(
page
,
params
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EquipmentServiceImpl.java
View file @
9679eb3e
...
@@ -78,11 +78,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -78,11 +78,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EquipmentVo
>>
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
)
{
public
BaseResponse
<
IPage
<
EquipmentVo
>>
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
,
String
type
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"brand"
,
brand
);
params
.
put
(
"brand"
,
brand
);
params
.
put
(
"supplierId"
,
supplierId
);
params
.
put
(
"supplierId"
,
supplierId
);
params
.
put
(
"name"
,
name
);
params
.
put
(
"name"
,
name
);
params
.
put
(
"type"
,
type
);
Page
<
EquipmentVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EquipmentVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EquipmentVo
>
pages
=
equipmentMapper
.
getPage
(
page
,
params
);
IPage
<
EquipmentVo
>
pages
=
equipmentMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
return
BaseResponse
.
okData
(
pages
);
...
@@ -98,10 +99,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
...
@@ -98,10 +99,12 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
* @param response
* @param response
*/
*/
@Override
@Override
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
type
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"brand"
,
brand
);
params
.
put
(
"brand"
,
brand
);
params
.
put
(
"supplierId"
,
supplierId
);
params
.
put
(
"supplierId"
,
supplierId
);
params
.
put
(
"name"
,
name
);
params
.
put
(
"type"
,
type
);
List
<
Map
<
String
,
Object
>>
list
=
equipmentMapper
.
exportList
(
params
);
List
<
Map
<
String
,
Object
>>
list
=
equipmentMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/TeamServiceImpl.java
View file @
9679eb3e
...
@@ -263,8 +263,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
...
@@ -263,8 +263,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
headers
[
2
]
=
"所在检测组"
;
headers
[
2
]
=
"所在检测组"
;
headers
[
3
]
=
"检测依据"
;
headers
[
3
]
=
"检测依据"
;
headers
[
4
]
=
"收费标准"
;
headers
[
4
]
=
"收费标准"
;
headers
[
5
]
=
"建议产值"
;
headers
[
5
]
=
"资质范围"
;
headers
[
6
]
=
"资质范围"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
Object
[]
objects
=
new
Object
[
headers
.
length
];
...
@@ -275,7 +274,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
...
@@ -275,7 +274,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
}
}
objects
[
j
]
=
obj
;
objects
[
j
]
=
obj
;
}
}
datas
.
add
(
objects
);
datas
.
add
(
objects
);
}
}
ExcelUtil
.
excelExport
(
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"检测项"
:
fileName
,
headers
,
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"检测项"
:
fileName
,
headers
,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/WordUtil.java
View file @
9679eb3e
...
@@ -48,6 +48,77 @@ public class WordUtil {
...
@@ -48,6 +48,77 @@ public class WordUtil {
FileExt
fileExt
)
{
FileExt
fileExt
)
{
Writer
out
=
null
;
Writer
out
=
null
;
File
file
=
null
;
File
file
=
null
;
try
{
configuration
.
setClassForTemplateLoading
(
WordUtil
.
class
,
FTL_FP
);
Template
template
=
configuration
.
getTemplate
(
templateFileName
,
"UTF-8"
);
if
(
template
==
null
){
System
.
out
.
println
(
"==========================\n 报错-================\n"
);
}
String
filePath
;
filePath
=
""
;
file
=
new
File
(
filePath
+
templeName
);
//输出文件
FileOutputStream
fos
=
new
FileOutputStream
(
file
);
out
=
new
OutputStreamWriter
(
fos
,
StandardCharsets
.
UTF_8
);
//变量替换
template
.
process
(
beanParams
,
out
);
FileInputStream
in
=
new
FileInputStream
(
file
);
/*HSSFWorkbook xssfWorkbook = new HSSFWorkbook(in);
ByteArrayOutputStream os = new ByteArrayOutputStream();
xssfWorkbook.write(os);
byte[] bytes = os.toByteArray();*/
byte
[]
buffer
=
new
byte
[
in
.
available
()];
int
i
=
in
.
read
(
buffer
);
if
(
i
==
-
1
)
{
return
;
}
in
.
close
();
response
.
reset
();
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
toString
());
response
.
setContentType
(
"application/octet-stream"
);
templeName
=
new
String
((
templeName
).
getBytes
(
StandardCharsets
.
UTF_8
),
StandardCharsets
.
ISO_8859_1
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
templeName
+
fileExt
.
getName
());
outputStream
.
write
(
buffer
);
outputStream
.
flush
();
outputStream
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
boolean
delete
=
file
.
delete
();
if
(!
delete
)
{
log
.
debug
(
file
.
getName
()
+
"文件删除失败!"
);
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 根据模板导出office文件 带上下标的
*
* @param templeName 导出的文件名
* @param templateFileName 模板名字
* @param beanParams 替换模板中的参数 <${模板占位符},对应值>
* @param response 响应体
*/
public
static
void
writeWordReportSXB
(
String
templeName
,
String
templateFileName
,
Map
<
String
,
Object
>
beanParams
,
HttpServletResponse
response
,
FileExt
fileExt
)
{
Writer
out
=
null
;
File
file
=
null
;
try
{
try
{
configuration
.
setClassForTemplateLoading
(
WordUtil
.
class
,
FTL_FP
);
configuration
.
setClassForTemplateLoading
(
WordUtil
.
class
,
FTL_FP
);
Template
template
=
configuration
.
getTemplate
(
templateFileName
,
"UTF-8"
);
Template
template
=
configuration
.
getTemplate
(
templateFileName
,
"UTF-8"
);
...
...
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