Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
072f1fa2
Commit
072f1fa2
authored
Oct 11, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出完成中
parent
62fa9a5a
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
373 additions
and
24 deletions
+373
-24
ConsumablesController.java
.../sc/cement/business/controller/ConsumablesController.java
+13
-0
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+10
-0
EquipmentController.java
...se/sc/cement/business/controller/EquipmentController.java
+10
-0
SampleController.java
.../wise/sc/cement/business/controller/SampleController.java
+17
-0
ConsumablesMapper.java
.../cn/wise/sc/cement/business/mapper/ConsumablesMapper.java
+5
-0
ConsumablesOutMapper.java
.../wise/sc/cement/business/mapper/ConsumablesOutMapper.java
+4
-0
EquipmentMapper.java
...va/cn/wise/sc/cement/business/mapper/EquipmentMapper.java
+3
-0
SampleMapper.java
.../java/cn/wise/sc/cement/business/mapper/SampleMapper.java
+2
-0
ConsumablesMapper.xml
.../wise/sc/cement/business/mapper/xml/ConsumablesMapper.xml
+29
-0
EquipmentMapper.xml
...cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
+17
-0
SampleMapper.xml
...va/cn/wise/sc/cement/business/mapper/xml/SampleMapper.xml
+31
-2
TeamMapper.xml
...java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
+26
-17
IConsumablesService.java
.../wise/sc/cement/business/service/IConsumablesService.java
+4
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+1
-0
IEquipmentService.java
...cn/wise/sc/cement/business/service/IEquipmentService.java
+4
-0
ISampleService.java
...va/cn/wise/sc/cement/business/service/ISampleService.java
+5
-0
ConsumablesServiceImpl.java
.../cement/business/service/impl/ConsumablesServiceImpl.java
+53
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+28
-2
EquipmentServiceImpl.java
...sc/cement/business/service/impl/EquipmentServiceImpl.java
+46
-0
MethodServiceImpl.java
...se/sc/cement/business/service/impl/MethodServiceImpl.java
+8
-1
SampleServiceImpl.java
...se/sc/cement/business/service/impl/SampleServiceImpl.java
+55
-0
TeamServiceImpl.java
...wise/sc/cement/business/service/impl/TeamServiceImpl.java
+2
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ConsumablesController.java
View file @
072f1fa2
...
...
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -55,6 +56,18 @@ public class ConsumablesController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"消耗品导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
name
,
String
supplierName
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
consumablesService
.
export
(
name
,
supplierName
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"消耗品导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"新增消耗品"
)
@PostMapping
(
"/create"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
072f1fa2
...
...
@@ -278,6 +278,16 @@ public class EntrustController {
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"详情-样品处理信息-附件列表"
)
@GetMapping
(
"/getSampleHandleDtailEnclosureList"
)
public
BaseResponse
getSampleHandleDtailEnclosureList
(
Integer
sampleHandleId
)
{
try
{
return
entrustService
.
getSampleHandleDtailEnclosureList
(
sampleHandleId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"详情-样品处理信息-附件列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"详情-检测任务信息"
)
@GetMapping
(
"/getSampleCheckDtail/{id}"
)
public
BaseResponse
getSampleCheckDtail
(
@PathVariable
Integer
id
){
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EquipmentController.java
View file @
072f1fa2
...
...
@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -58,6 +59,15 @@ public class EquipmentController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"设备列表导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
equipmentService
.
export
(
brand
,
supplierId
,
name
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"设备列表导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"新增设备"
)
@PostMapping
(
"/create"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SampleController.java
View file @
072f1fa2
...
...
@@ -16,6 +16,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
...
...
@@ -51,6 +53,21 @@ public class SampleController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"样品列表导出"
)
@PostMapping
(
"/export"
)
public
void
export
(
String
sampleName
,
String
cementCode
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
sampleService
.
export
(
sampleName
,
cementCode
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"样品列表导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"样品详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ConsumablesMapper.java
View file @
072f1fa2
...
...
@@ -2,6 +2,10 @@ package cn.wise.sc.cement.business.mapper;
import
cn.wise.sc.cement.business.entity.Consumables
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
ConsumablesMapper
extends
BaseMapper
<
Consumables
>
{
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ConsumablesOutMapper.java
View file @
072f1fa2
...
...
@@ -2,6 +2,10 @@ package cn.wise.sc.cement.business.mapper;
import
cn.wise.sc.cement.business.entity.ConsumablesOut
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EquipmentMapper.java
View file @
072f1fa2
...
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -22,5 +23,7 @@ public interface EquipmentMapper extends BaseMapper<Equipment> {
IPage
<
EquipmentVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
EquipmentVo
getDetail
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleMapper.java
View file @
072f1fa2
...
...
@@ -24,6 +24,8 @@ public interface SampleMapper extends BaseMapper<Sample> {
IPage
<
SampleVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
SampleVo
getDetail
(
Integer
id
);
@Select
(
"select max(parallel_code) from sample"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ConsumablesMapper.xml
View file @
072f1fa2
...
...
@@ -2,4 +2,33 @@
<!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.ConsumablesMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
<if
test=
"params.supplierName != null and params.supplierName != ''"
>
and t.supplier_name = #{params.supplierName}
</if>
</where>
</sql>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 易耗品名称,
t.code as '易耗品代号',
t.supplier_name as 供应商,
t.position as 位置,
t.purchase_date as 购买日期,
t.stock_num as 库存数量
FROM consumables t ,(select @i:=0)t
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EquipmentMapper.xml
View file @
072f1fa2
...
...
@@ -24,6 +24,23 @@
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 设备名称,
t.code as 设备编号,
t.brand as 设备品牌,
t.model as '规格/型号',
s.name as 供应商,
t.position as 位置,
t.purchase_date as 购买日期
FROM equipment t
left join supplier s on s.id = t.supplier_id
,(select @i:=0)t
<include
refid=
"where"
/>
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EquipmentVo"
>
SELECT t.*, s.name as supplierName
FROM equipment t
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleMapper.xml
View file @
072f1fa2
...
...
@@ -14,14 +14,43 @@
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleVo"
>
select s.*,
p.id as projectId, p.name as projectName,p.
code as projectCode
select s.*,
e.project_id as projectId, e.project_name as projectName,e.project_
code as projectCode
from sample s
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
<include
refid=
"where"
/>
order by s.create_time desc
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
s.name as 样品名称,
s.cement_code as 样品本所编号,
e.project_name as 所属项目,
IF(ISNULL(s.little_position),'',s.little_position) 小样信息,
IF(ISNULL(s.original_position),'',s.original_position) 原样存储,
s.weight as 样品重量(kg),
(
CASE s.is_parallel
WHEN 1 THEN '是'
WHEN 0 THEN '否'
ELSE ''
END
) as 是否为平行样,
(
CASE s.status
WHEN 0 THEN '未领用'
WHEN 1 THEN '已领用'
WHEN 2 THEN '已销毁'
ELSE ''
END
) as 状态
from sample s
left join entrust e on e.id = s.entrust_id
,(select @i:=0)s
<include
refid=
"where"
/>
order by s.create_time desc
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleVo"
>
select s.*,s.name as sampleName, s.cement_code as cementCode, s.weight as weight
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
View file @
072f1fa2
...
...
@@ -20,8 +20,8 @@
m.name as methodName, m.standard as standard, m.number as number,
(
CASE t.qualifications
WHEN 0 THEN '资质
范围
外'
WHEN 1 THEN '资质
范围
内'
WHEN 0 THEN '资质外'
WHEN 1 THEN '资质内'
ELSE ''
END
) as qualificationsValue
...
...
@@ -32,6 +32,27 @@
ORDER BY t.id DESC
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 检测项目,
IF(ISNULL(tg.name ),'',tg.name ) 所在检测组,
m.name as 检测依据,
t.charge as 收费标准,
t.pro_charge as 建议产值,
(
CASE t.qualifications
WHEN 0 THEN '资质外'
WHEN 1 THEN '资质内'
ELSE ''
END
) as 资质范围
FROM team t
left join team_group tg on tg.id = t.group_id
left join method m on m.id = t.method_id
,(select @i:=0)t
<include
refid=
"where"
/>
</select>
<select
id=
"getList"
resultType=
"cn.wise.sc.cement.business.model.vo.TeamListVo"
>
SELECT t.id as id, t.name as name, t.group_id as groupId, t.method_id as methodId,
...
...
@@ -42,6 +63,8 @@
ORDER BY t.id ASC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.TeamVo"
>
SELECT t.*, tg.name as groupName,
m.name as methodName, m.standard as standard, m.number as number,
...
...
@@ -60,21 +83,7 @@
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
t.name as 检测项目,
tg.name as 检测组,
m.standard as 检测依据标准号,
t.charge as 收费标准,
t.pro_charge as 建议产值,
t.qualifications as 资质范围
FROM team t
left join team_group tg on tg.id = t.group_id
left join method m on m.id = t.method_id
,(select @i:=0)t
<include
refid=
"where"
/>
</select>
<!--根据检测组id 获取所有检测项信息-->
<select
id=
"getByGroup"
resultType=
"java.lang.String"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IConsumablesService.java
View file @
072f1fa2
...
...
@@ -8,6 +8,8 @@ import cn.wise.sc.cement.business.model.query.ChangeValidDateQuery;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务类
...
...
@@ -20,6 +22,8 @@ public interface IConsumablesService extends IService<Consumables> {
BaseResponse
<
IPage
<
Consumables
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
);
void
export
(
String
name
,
String
supplierName
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
Consumables
>
create
(
Consumables
query
);
BaseResponse
<
Consumables
>
update
(
Consumables
query
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
072f1fa2
...
...
@@ -102,6 +102,7 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
EntrustVo
>
getBaseDtail
(
Integer
id
);
BaseResponse
<
List
<
SampleHandleVo
>>
getSampleHandleDtail
(
Integer
id
);
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleDtailEnclosureList
(
Integer
sampleHandleId
);
BaseResponse
<
List
<
SampleVo
>>
getSampleCheckDtail
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEquipmentService.java
View file @
072f1fa2
...
...
@@ -8,6 +8,8 @@ import cn.wise.sc.cement.business.model.vo.*;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务类
...
...
@@ -20,6 +22,8 @@ public interface IEquipmentService extends IService<Equipment> {
BaseResponse
<
IPage
<
EquipmentVo
>>
getPage
(
PageQuery
pageQuery
,
String
brand
,
Integer
supplierId
,
String
name
);
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
Equipment
>
create
(
EquipmentQuery
query
);
BaseResponse
<
Equipment
>
update
(
EquipmentQuery
query
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISampleService.java
View file @
072f1fa2
...
...
@@ -8,6 +8,8 @@ import cn.wise.sc.cement.business.model.vo.SampleVo;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务类
...
...
@@ -26,4 +28,7 @@ public interface ISampleService extends IService<Sample> {
BaseResponse
<
String
>
destruction
(
Integer
id
);
void
export
(
String
sampleName
,
String
cementCode
,
String
fileName
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/ConsumablesServiceImpl.java
View file @
072f1fa2
...
...
@@ -11,8 +11,10 @@ import cn.wise.sc.cement.business.model.query.ChangeValidDateQuery;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.service.IConsumablesService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.Builder
;
...
...
@@ -22,7 +24,12 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -66,6 +73,52 @@ public class ConsumablesServiceImpl extends ServiceImpl<ConsumablesMapper, Consu
return
BaseResponse
.
okData
(
page
);
}
/**
* 消耗品导出
* @param name
* @param supplierName
* @param fileName
* @param response
*/
@Override
public
void
export
(
String
name
,
String
supplierName
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"supplierName"
,
supplierName
);
params
.
put
(
"name"
,
name
);
List
<
Map
<
String
,
Object
>>
list
=
consumablesMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"易耗品名称"
;
headers
[
2
]
=
"'易耗品代号'"
;
headers
[
3
]
=
"供应商"
;
headers
[
4
]
=
"位置"
;
headers
[
5
]
=
"购买日期"
;
headers
[
6
]
=
"库存数量"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"消耗品"
:
fileName
,
headers
,
datas
,
response
);
}
}
/**
* 新增消耗品
* @param query
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
072f1fa2
...
...
@@ -468,6 +468,32 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
return
BaseResponse
.
okData
(
sampleHandleList
);
}
/**
* 详情-样品处理信息-附件列表
*
* @param sampleHandleId 样品处理表id
* @return
*/
public
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleDtailEnclosureList
(
Integer
sampleHandleId
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
return
BaseResponse
.
errorMsg
(
"权限不足"
);
}
if
(
sampleHandleId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sampleHandleId"
,
sampleHandleId
);
List
<
SampleHandleEnclosureVo
>
list
=
sampleHandleEnclosureMapper
.
getList
(
params
);
return
BaseResponse
.
okData
(
list
);
}
/**
* 详情-检测任务信息
...
...
@@ -1575,7 +1601,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVo
.
setCountResult
(
sampleCheck
.
getCountResult
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
QueryWrapper
<
SampleCheckTeam
>
sampleCheckTeamQW
=
new
QueryWrapper
<>();
sampleCheckTeamQW
.
eq
(
"check
I
d"
,
sampleCheck
.
getId
());
sampleCheckTeamQW
.
eq
(
"check
_i
d"
,
sampleCheck
.
getId
());
List
<
SampleCheckTeam
>
sampleCheckTeamList
=
sampleCheckTeamMapper
.
selectList
(
sampleCheckTeamQW
);
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
if
(
sampleCheckTeamList
!=
null
&&
sampleCheckTeamList
.
size
()
>
0
)
{
...
...
@@ -2285,7 +2311,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托列表"
:
fileName
,
headers
,
datas
,
response
);
}
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EquipmentServiceImpl.java
View file @
072f1fa2
...
...
@@ -8,8 +8,10 @@ import cn.wise.sc.cement.business.model.query.*;
import
cn.wise.sc.cement.business.model.vo.*
;
import
cn.wise.sc.cement.business.service.IEquipmentService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -70,6 +73,49 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
return
BaseResponse
.
okData
(
pages
);
}
/**
* 设备列表导出
* @param brand
* @param supplierId
* @param name
* @param fileName
* @param response
*/
@Override
public
void
export
(
String
brand
,
Integer
supplierId
,
String
name
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"brand"
,
brand
);
params
.
put
(
"supplierId"
,
supplierId
);
List
<
Map
<
String
,
Object
>>
list
=
equipmentMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"设备名称"
;
headers
[
2
]
=
"设备编号"
;
headers
[
3
]
=
"设备品牌"
;
headers
[
4
]
=
"规格/型号"
;
headers
[
5
]
=
"供应商"
;
headers
[
6
]
=
"位置"
;
headers
[
7
]
=
"购买日期"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"设备列表"
:
fileName
,
headers
,
datas
,
response
);
}
}
/**
* 新增设备
* @param query
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/MethodServiceImpl.java
View file @
072f1fa2
...
...
@@ -90,6 +90,13 @@ public class MethodServiceImpl extends ServiceImpl<MethodMapper, Method> impleme
return
BaseResponse
.
okData
(
update
);
}
/**
* 检测依据导出
* @param name
* @param standard
* @param fileName
* @param response
*/
@Override
public
void
export
(
String
name
,
String
standard
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
@@ -102,7 +109,7 @@ public class MethodServiceImpl extends ServiceImpl<MethodMapper, Method> impleme
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测依据名"
;
headers
[
2
]
=
"
依据
号"
;
headers
[
2
]
=
"
标准
号"
;
headers
[
3
]
=
"编号"
;
headers
[
4
]
=
"实施日期"
;
headers
[
5
]
=
"更新日期"
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SampleServiceImpl.java
View file @
072f1fa2
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.Method
;
import
cn.wise.sc.cement.business.entity.Sample
;
import
cn.wise.sc.cement.business.entity.SampleTmp
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.mapper.SampleMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
...
...
@@ -8,7 +11,10 @@ import cn.wise.sc.cement.business.model.query.SampleManageQuery;
import
cn.wise.sc.cement.business.model.vo.SampleVo
;
import
cn.wise.sc.cement.business.service.ISampleService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -16,8 +22,11 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -115,6 +124,52 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
return
BaseResponse
.
okData
(
"样品已销毁"
);
}
/**
* 样品列表导出
* @param sampleName
* @param cementCode
* @param fileName
* @param response
*/
public
void
export
(
String
sampleName
,
String
cementCode
,
String
fileName
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sampleName"
,
sampleName
);
params
.
put
(
"cementCode"
,
cementCode
);
List
<
Map
<
String
,
Object
>>
list
=
sampleMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"样品名称"
;
headers
[
2
]
=
"样品本所编号"
;
headers
[
3
]
=
"所属项目"
;
headers
[
4
]
=
"小样信息"
;
headers
[
5
]
=
"原样存储"
;
headers
[
6
]
=
"样品重量(kg)"
;
headers
[
7
]
=
"是否为平行样"
;
headers
[
8
]
=
"状态"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
headers
.
length
);
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
]).
toString
();
//如果序号带小数点 去除.0,保留整数
if
(
j
==
0
)
{
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"样品列表"
:
fileName
,
headers
,
datas
,
response
);
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/TeamServiceImpl.java
View file @
072f1fa2
...
...
@@ -181,8 +181,8 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"检测项目"
;
headers
[
2
]
=
"检测组"
;
headers
[
3
]
=
"检测依据
标准号
"
;
headers
[
2
]
=
"
所在
检测组"
;
headers
[
3
]
=
"检测依据"
;
headers
[
4
]
=
"收费标准"
;
headers
[
5
]
=
"建议产值"
;
headers
[
6
]
=
"资质范围"
;
...
...
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