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
4e5794fd
Commit
4e5794fd
authored
Apr 19, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
扫码获取样品信息2
parent
a0c78d89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
54 deletions
+22
-54
CabinetController.java
...wise/sc/cement/business/controller/CabinetController.java
+21
-0
SampleController.java
.../wise/sc/cement/business/controller/SampleController.java
+1
-54
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/CabinetController.java
View file @
4e5794fd
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.extra.qrcode.QrCodeUtil
;
import
cn.wise.sc.cement.business.entity.Cabinet
;
import
cn.wise.sc.cement.business.entity.Cabinet
;
import
cn.wise.sc.cement.business.entity.SysPost
;
import
cn.wise.sc.cement.business.entity.SysPost
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.SampleVo
;
import
cn.wise.sc.cement.business.service.ICabinetService
;
import
cn.wise.sc.cement.business.service.ICabinetService
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -22,6 +26,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -22,6 +26,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.imageio.ImageIO
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -86,6 +94,19 @@ public class CabinetController {
...
@@ -86,6 +94,19 @@ public class CabinetController {
}
}
}
}
@ApiOperation
(
"获取存储柜二维码"
)
@PostMapping
(
"/cabinetrq/init"
)
public
BaseResponse
<
String
>
getCabinetRQ
(
String
cabinetId
)
throws
IOException
{
if
(
StrUtil
.
isBlank
(
cabinetId
))
{
log
.
error
(
"生成存储柜二维码失败!cabinetId 参数为空!"
);
}
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
BufferedImage
bufferedImage
=
QrCodeUtil
.
generate
(
cabinetId
,
200
,
200
);
ImageIO
.
write
(
bufferedImage
,
"png"
,
stream
);
stream
.
close
();
return
BaseResponse
.
okData
(
Base64
.
encode
(
stream
.
toByteArray
()));
}
@ApiOperation
(
value
=
"存储柜列表"
)
@ApiOperation
(
value
=
"存储柜列表"
)
@GetMapping
(
"/getList"
)
@GetMapping
(
"/getList"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SampleController.java
View file @
4e5794fd
...
@@ -131,24 +131,6 @@ public class SampleController {
...
@@ -131,24 +131,6 @@ public class SampleController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
value
=
"APP样品扫码样获取品信息"
)
@GetMapping
(
"/sampleScanInfo"
)
public
BaseResponse
sampleScanInfo
(
String
param
)
{
try
{
System
.
out
.
println
(
"*********psram******"
+
param
);
String
[]
params
=
param
.
split
(
","
);
SampleScanQuery
query
=
new
SampleScanQuery
();
query
.
setSampleId
(
Integer
.
valueOf
(
params
[
0
]));
query
.
setCabinetId
(
Integer
.
valueOf
(
params
[
1
]));
return
sampleService
.
sampleScan
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"APP样品扫码样获取品信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"样品复查取消复查"
)
@ApiOperation
(
"样品复查取消复查"
)
@PutMapping
(
"/review"
)
@PutMapping
(
"/review"
)
public
BaseResponse
<
Boolean
>
ampleReview
(
Integer
id
)
{
public
BaseResponse
<
Boolean
>
ampleReview
(
Integer
id
)
{
...
@@ -182,7 +164,7 @@ public class SampleController {
...
@@ -182,7 +164,7 @@ public class SampleController {
@PostMapping
(
"/samplerq/init"
)
@PostMapping
(
"/samplerq/init"
)
public
BaseResponse
<
String
>
getSampleRQ
(
String
sampleId
)
throws
IOException
{
public
BaseResponse
<
String
>
getSampleRQ
(
String
sampleId
)
throws
IOException
{
if
(
StrUtil
.
isBlank
(
sampleId
))
{
if
(
StrUtil
.
isBlank
(
sampleId
))
{
log
.
error
(
"生成样品二维码失败!sa
vePosition
参数为空!"
);
log
.
error
(
"生成样品二维码失败!sa
mpleId
参数为空!"
);
}
}
SampleVo
sampleVo
=
sampleService
.
getDetail
(
Integer
.
valueOf
(
sampleId
)).
getData
();
SampleVo
sampleVo
=
sampleService
.
getDetail
(
Integer
.
valueOf
(
sampleId
)).
getData
();
String
content
=
""
;
String
content
=
""
;
...
@@ -200,41 +182,6 @@ public class SampleController {
...
@@ -200,41 +182,6 @@ public class SampleController {
return
BaseResponse
.
okData
(
Base64
.
encode
(
stream
.
toByteArray
()));
return
BaseResponse
.
okData
(
Base64
.
encode
(
stream
.
toByteArray
()));
}
}
private
static
final
String
CABINET_KEY
=
"CABINET:CACHE:"
;
public
BaseResponse
<
String
>
newCabinet
(
String
cabinetName
)
{
if
(
StrUtil
.
isBlank
(
cabinetName
))
{
return
BaseResponse
.
errorMsg
(
"柜子名不能为空!"
);
}
//如果存在
if
(
redisUtil
.
existsKey
(
CABINET_KEY
))
{
String
cabinetStr
=
redisUtil
.
getString
(
CABINET_KEY
).
toString
();
List
<
String
>
list
=
JSON
.
parseObject
(
cabinetStr
,
ArrayList
.
class
);
list
.
add
(
cabinetName
);
String
newCabinetStr
=
JSON
.
toJSONString
(
list
);
redisUtil
.
setString
(
newCabinetStr
,
CABINET_KEY
);
return
BaseResponse
.
okData
(
newCabinetStr
);
}
else
{
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
cabinetName
);
String
newCabinetStr
=
JSON
.
toJSONString
(
list
);
redisUtil
.
setString
(
CABINET_KEY
,
newCabinetStr
);
return
BaseResponse
.
okData
(
newCabinetStr
);
}
}
public
BaseResponse
<
String
>
editCabinet
(
String
cabinetNames
)
{
if
(
StrUtil
.
isBlank
(
cabinetNames
))
{
redisUtil
.
setString
(
CABINET_KEY
,
cabinetNames
);
return
BaseResponse
.
okData
(
"更新成功!"
);
}
else
{
return
BaseResponse
.
errorMsg
(
"更新字符串不能为空!"
);
}
}
@ApiOperation
(
value
=
"样品销毁"
)
@ApiOperation
(
value
=
"样品销毁"
)
@PostMapping
(
"/destruction/{id}"
)
@PostMapping
(
"/destruction/{id}"
)
...
...
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