Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-acquisition
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
竹天卫
data-acquisition
Commits
e5267295
Commit
e5267295
authored
Apr 27, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/zhutianwei/data-acquisition
parents
19e214a4
28ae1e11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1859 additions
and
1 deletion
+1859
-1
TSampleLaboratorysheetController.java
...business/controller/TSampleLaboratorysheetController.java
+98
-0
TSampleListController.java
...cquisition/business/controller/TSampleListController.java
+107
-0
TSampleLaboratorysheet.java
...c/acquisition/business/entity/TSampleLaboratorysheet.java
+131
-0
TSampleList.java
...a/cn/wise/sc/acquisition/business/entity/TSampleList.java
+107
-0
ProjectEnum.java
...n/wise/sc/acquisition/business/enumation/ProjectEnum.java
+123
-0
TSampleLaboratorysheetMapper.java
...isition/business/mapper/TSampleLaboratorysheetMapper.java
+16
-0
TSampleListMapper.java
...ise/sc/acquisition/business/mapper/TSampleListMapper.java
+18
-0
TSampleLaboratorysheetMapper.xml
...tion/business/mapper/xml/TSampleLaboratorysheetMapper.xml
+5
-0
TSampleListMapper.xml
.../sc/acquisition/business/mapper/xml/TSampleListMapper.xml
+24
-0
TSampleLaboratorysheetQuery.java
...ion/business/model/query/TSampleLaboratorysheetQuery.java
+126
-0
TSampleListQuery.java
...sc/acquisition/business/model/query/TSampleListQuery.java
+119
-0
ITSampleLaboratorysheetService.java
...tion/business/service/ITSampleLaboratorysheetService.java
+30
-0
ITSampleListService.java
.../sc/acquisition/business/service/ITSampleListService.java
+36
-0
TSampleLaboratorysheetServiceImpl.java
...iness/service/impl/TSampleLaboratorysheetServiceImpl.java
+167
-0
TSampleListServiceImpl.java
...isition/business/service/impl/TSampleListServiceImpl.java
+218
-0
ImageUtil.java
.../java/cn/wise/sc/acquisition/business/util/ImageUtil.java
+189
-0
acquisition-business.kotlin_module
...arget/classes/META-INF/acquisition-business.kotlin_module
+0
-0
application-dev.yml
acquisition-business/target/classes/application-dev.yml
+51
-0
application.yml
acquisition-business/target/classes/application.yml
+0
-0
TEquipmentAccountMapper.xml
...c/acquisition/business/mapper/TEquipmentAccountMapper.xml
+5
-0
TSampleLaboratorysheetMapper.xml
...uisition/business/mapper/TSampleLaboratorysheetMapper.xml
+5
-0
TSampleListMapper.xml
...wise/sc/acquisition/business/mapper/TSampleListMapper.xml
+24
-0
TSysDeptMapper.xml
...cn/wise/sc/acquisition/business/mapper/TSysDeptMapper.xml
+5
-0
TSysDictMapper.xml
...cn/wise/sc/acquisition/business/mapper/TSysDictMapper.xml
+5
-0
TSysPowerMapper.xml
...n/wise/sc/acquisition/business/mapper/TSysPowerMapper.xml
+5
-0
TSysRoleMapper.xml
...cn/wise/sc/acquisition/business/mapper/TSysRoleMapper.xml
+5
-0
TSysRolepowerMapper.xml
...se/sc/acquisition/business/mapper/TSysRolepowerMapper.xml
+5
-0
TSysUserLoginMapper.xml
...se/sc/acquisition/business/mapper/TSysUserLoginMapper.xml
+5
-0
TSysUserMapper.xml
...cn/wise/sc/acquisition/business/mapper/TSysUserMapper.xml
+5
-0
fastdfs-client.properties
...isition-business/target/classes/fastdfs-client.properties
+9
-0
license.xml
acquisition-business/target/classes/license.xml
+13
-0
logback-spring.xml
acquisition-business/target/classes/logback-spring.xml
+193
-0
spring.factories
im-common/target/classes/META-INF/spring.factories
+4
-0
application.yml
im-common/target/classes/application.yml
+5
-0
GeneratorApplication.java
.../java/cn/wise/sc/acquisition/mg/GeneratorApplication.java
+1
-1
No files found.
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/controller/TSampleLaboratorysheetController.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
controller
;
import
cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery
;
import
cn.wise.sc.acquisition.business.service.ITSampleLaboratorysheetService
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
* </p>
*
* @author renchao
* @since 2021-04-25
*/
@Api
(
tags
=
"送验单分析结果"
)
@RestController
@RequestMapping
(
"/business/t-sample-laboratorysheet"
)
public
class
TSampleLaboratorysheetController
{
@Autowired
private
ITSampleLaboratorysheetService
itSampleLaboratorysheetService
;
/**
* 根据样号查看分析结果
*
* @param tSampleLaboratorysheetQuery
* @return
*/
@ApiOperation
(
value
=
"根据样号查看分析结果"
)
@RequestMapping
(
value
=
"/getByYh"
,
method
=
RequestMethod
.
GET
)
public
R
getByYh
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
)
{
return
itSampleLaboratorysheetService
.
getByYh
(
tSampleLaboratorysheetQuery
);
}
/**
* 根据样号修改分析结果
*
* @param tSampleLaboratorysheetQuery
* @return
*/
@ApiOperation
(
value
=
"根据样号修改分析结果"
)
@RequestMapping
(
value
=
"/updateByYh"
,
method
=
RequestMethod
.
POST
)
public
R
updateByYh
(
@RequestBody
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
)
{
return
itSampleLaboratorysheetService
.
updateByYh
(
tSampleLaboratorysheetQuery
);
}
/**
* 根据样号删除分析结果
*
* @param tSampleLaboratorysheetQuery
* @return
*/
@ApiOperation
(
value
=
"根据样号删除分析结果"
)
@RequestMapping
(
value
=
"/deleteByYh"
,
method
=
RequestMethod
.
POST
)
public
R
deleteByYh
(
@RequestBody
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
)
{
return
itSampleLaboratorysheetService
.
deleteByYh
(
tSampleLaboratorysheetQuery
);
}
/**
* 增加分析结果
*
* @param tSampleLaboratorysheetQuery
* @return
*/
@ApiOperation
(
value
=
"增加分析结果"
)
@RequestMapping
(
value
=
"/insertTSampleLaboratorysheet"
,
method
=
RequestMethod
.
POST
)
public
R
insertTSampleLaboratorysheet
(
@RequestBody
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
)
{
return
itSampleLaboratorysheetService
.
insertTSampleLaboratorysheet
(
tSampleLaboratorysheetQuery
);
}
/**
* 二维码下载
*
* @param tSampleLaboratorysheetQuery
* @return
*/
@ApiOperation
(
value
=
"二维码下载"
)
@RequestMapping
(
value
=
"/getImage"
,
method
=
RequestMethod
.
POST
)
public
R
getImage
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
,
final
HttpServletResponse
response
)
{
return
itSampleLaboratorysheetService
.
getImage
(
tSampleLaboratorysheetQuery
,
response
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/controller/TSampleListController.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
controller
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.service.ITSampleListService
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2021-04-22
*/
@Api
(
tags
=
"送验单接口"
)
@RestController
@RequestMapping
(
"/business/t-sample-list"
)
public
class
TSampleListController
{
@Autowired
private
ITSampleListService
itSampleListService
;
/**
* 根据条件查询送验单 分页
*
* @param tSampleListQuery
* @return
*/
@ApiOperation
(
value
=
"获取送验单列表 可分页模糊查询"
)
@RequestMapping
(
value
=
"/getPage"
,
method
=
RequestMethod
.
GET
)
public
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
return
itSampleListService
.
getPage
(
tSampleListQuery
,
query
);
}
/**
* 根据样号修改送验单
*
* @param tSampleListQuery
* @return
*/
@ApiOperation
(
value
=
"根据样号修改送验单"
)
@RequestMapping
(
value
=
"/updateByYh"
,
method
=
RequestMethod
.
POST
)
public
R
updateByYh
(
@RequestBody
TSampleListQuery
tSampleListQuery
)
{
return
itSampleListService
.
updateByYh
(
tSampleListQuery
);
}
/**
* 增加送验单
*
* @param tSampleListQuery
* @return
*/
@ApiOperation
(
value
=
"增加送验单"
)
@RequestMapping
(
value
=
"/insertSampleList"
,
method
=
RequestMethod
.
POST
)
public
R
insertSampleList
(
@RequestBody
TSampleListQuery
tSampleListQuery
)
{
return
itSampleListService
.
insertSampleList
(
tSampleListQuery
);
}
/**
* 根据样号删除送验单
*
* @param tSampleListQuery
* @return
*/
@ApiOperation
(
value
=
"根据样号删除送验单"
)
@RequestMapping
(
value
=
"/deleteByYh"
,
method
=
RequestMethod
.
POST
)
public
R
deleteByYh
(
@RequestBody
TSampleListQuery
tSampleListQuery
)
{
return
itSampleListService
.
deleteByYh
(
tSampleListQuery
);
}
/**
* 保存图片
*
* @return
*/
@ApiOperation
(
value
=
"保存图片"
)
@RequestMapping
(
value
=
"/saveImage"
,
method
=
RequestMethod
.
POST
)
public
R
saveImage
(
TSampleListQuery
query
,
@RequestParam
(
value
=
"file"
,
required
=
true
)
MultipartFile
file
){
return
itSampleListService
.
saveImage
(
query
,
file
);
}
/**
* 下载图片
*
* @return
*/
@ApiOperation
(
value
=
"下载图片"
)
@RequestMapping
(
value
=
"/getImage"
,
method
=
RequestMethod
.
GET
)
public
R
getImage
(
TSampleListQuery
query
,
final
HttpServletResponse
response
){
return
itSampleListService
.
getImage
(
query
,
response
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/entity/TSampleLaboratorysheet.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author renchao
* @since 2021-04-25
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
"T_Sample_LaboratorySheet"
)
public
class
TSampleLaboratorysheet
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 样号
*/
@TableId
(
"Yh"
)
private
String
Yh
;
/**
* 二维码
*/
@TableField
(
"QRCode"
)
private
byte
[]
QRCode
;
/**
* 化验室编号
*/
@TableField
(
"LaboratoryID"
)
private
String
LaboratoryID
;
/**
* 副品存放位置
*/
@TableField
(
"Fpcfwz"
)
private
String
Fpcfwz
;
/**
* 氧化钙
*/
@TableField
(
"Cao"
)
private
Float
Cao
;
/**
* 氧化镁
*/
@TableField
(
"MgO"
)
private
Float
MgO
;
/**
* 三氧化二铝
*/
@TableField
(
"Al2O3"
)
private
Float
Al2O3
;
/**
* 二氧化硅
*/
@TableField
(
"SiO2"
)
private
Float
SiO2
;
/**
* 三氧化二铁
*/
@TableField
(
"Fe2O3"
)
private
Float
Fe2O3
;
/**
* 氧化钾
*/
@TableField
(
"K2O"
)
private
Float
k2o
;
/**
* 氧化钠
*/
@TableField
(
"Na2O"
)
private
Float
Na2O
;
/**
* 三氧化硫
*/
@TableField
(
"SO3"
)
private
Float
so3
;
/**
* 氯离子
*/
@TableField
(
"Cl"
)
private
Float
Cl
;
/**
* 烧失量
*/
@TableField
(
"Ssl"
)
private
Float
Ssl
;
/**
* 收样时间
*/
@TableField
(
"Sysj"
)
private
LocalDateTime
Sysj
;
/**
* 化验人
*/
@TableField
(
"Hyr"
)
private
String
Hyr
;
/**
* 化验时间
*/
@TableField
(
"Hysj"
)
private
LocalDateTime
Hysj
;
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/entity/TSampleList.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author renchao
* @since 2021-04-22
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
"T_Sample_List"
)
public
class
TSampleList
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 样号
*/
@TableId
(
"Yh"
)
private
String
Yh
;
/**
* 二维码 因为是字节,很长,不查询这个字段
*/
@TableField
(
"QRCode"
)
private
byte
[]
QRCode
;
/**
* 采区名称
*/
@TableField
(
"StopeName"
)
private
String
StopeName
;
/**
* 平台名称
*/
@TableField
(
"StepName"
)
private
String
StepName
;
/**
* 爆区名称
*/
@TableField
(
"BlastAreaName"
)
private
String
BlastAreaName
;
/**
* 炮孔编号
*/
@TableField
(
"HolesID"
)
private
String
HolesID
;
/**
* 从
*/
@TableField
(
"Start"
)
private
String
Start
;
/**
* 至
*/
@TableField
(
"EndTo"
)
private
String
EndTo
;
/**
* 送样人
*/
@TableField
(
"Syr"
)
private
String
Syr
;
/**
* 送样时间
*/
@TableField
(
"Syrq"
)
private
LocalDateTime
Syrq
;
/**
* 备注
*/
@TableField
(
"Bz"
)
private
String
Bz
;
/**
* 记录对象
*/
@TableField
(
"RecordName"
)
private
String
RecordName
;
/**
* 记录形式 因为是字节,很长,不查询这个字段
*/
@TableField
(
"RecordCode"
)
private
byte
[]
RecordCode
;
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/enumation/ProjectEnum.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
enumation
;
import
org.apache.commons.lang3.StringUtils
;
/**
* Author:renchao
* 送验单模块枚举
*/
public
class
ProjectEnum
{
/**
* 保存图片类型判断 1.记录形式 2.二维码
*/
public
enum
ImageType
{
RECORD_CODE
(
1
,
"RecordCode"
,
"记录形式"
),
QR_CODE
(
2
,
"QRCode"
,
"二维码"
);
// 成员变量
private
int
value
;
private
String
label
;
private
String
explain
;
// 构造方法
ImageType
(
int
value
,
String
label
,
String
explain
)
{
this
.
value
=
value
;
this
.
label
=
label
;
this
.
explain
=
explain
;
}
/**
* 根据value,获取label
*/
public
static
String
getLabel
(
int
value
)
{
for
(
ImageType
c
:
ImageType
.
values
())
{
if
(
c
.
value
==
value
)
{
return
c
.
label
;
}
}
return
ImageType
.
RECORD_CODE
.
label
;
}
/**
* 根据label,获取value
*/
public
static
int
getValue
(
String
label
)
{
for
(
ImageType
c
:
ImageType
.
values
())
{
if
(
StringUtils
.
equalsIgnoreCase
(
label
,
c
.
label
))
{
return
c
.
value
;
}
}
return
ImageType
.
RECORD_CODE
.
value
;
}
public
int
getValue
()
{
return
value
;
}
public
String
getLabel
()
{
return
label
;
}
}
/**
* 保存图片类型判断 1.记录形式 2.二维码
*/
public
enum
TSampleListType
{
YH
(
1
,
"Yh"
,
"样号"
),
HOLES_ID
(
2
,
"HolesID"
,
"炮孔编号"
);
// 成员变量
private
int
value
;
private
String
label
;
private
String
explain
;
// 构造方法
TSampleListType
(
int
value
,
String
label
,
String
explain
)
{
this
.
value
=
value
;
this
.
label
=
label
;
this
.
explain
=
explain
;
}
/**
* 根据value,获取label
*/
public
static
String
getLabel
(
int
value
)
{
for
(
ImageType
c
:
ImageType
.
values
())
{
if
(
c
.
value
==
value
)
{
return
c
.
label
;
}
}
return
ImageType
.
RECORD_CODE
.
label
;
}
/**
* 根据label,获取value
*/
public
static
int
getValue
(
String
label
)
{
for
(
ImageType
c
:
ImageType
.
values
())
{
if
(
StringUtils
.
equalsIgnoreCase
(
label
,
c
.
label
))
{
return
c
.
value
;
}
}
return
ImageType
.
RECORD_CODE
.
value
;
}
public
int
getValue
()
{
return
value
;
}
public
String
getLabel
()
{
return
label
;
}
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/mapper/TSampleLaboratorysheetMapper.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
mapper
;
import
cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author renchao
* @since 2021-04-25
*/
public
interface
TSampleLaboratorysheetMapper
extends
BaseMapper
<
TSampleLaboratorysheet
>
{
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/mapper/TSampleListMapper.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
mapper
;
import
cn.wise.sc.acquisition.business.entity.TSampleList
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2021-04-22
*/
public
interface
TSampleListMapper
extends
BaseMapper
<
TSampleList
>
{
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/mapper/xml/TSampleLaboratorysheetMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSampleLaboratorysheetMapper"
>
</mapper>
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/mapper/xml/TSampleListMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSampleListMapper"
>
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql
id=
"TSampleListColumns"
>
a.Yh,
a.QRCode,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HolesID,
a.Start,
a.EndTo,
a.Syr,
a.Syrq,
a.Bz
</sql>
<sql
id=
"TSampleListJoins"
>
</sql>
</mapper>
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/model/query/TSampleLaboratorysheetQuery.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author renchao
* @since 2021-04-25
*/
@Data
@ApiModel
(
"样品化验单query"
)
public
class
TSampleLaboratorysheetQuery
implements
Serializable
{
/**
* 样号
*/
@ApiModelProperty
(
"样号"
)
private
String
Yh
;
/**
* 二维码
*/
@ApiModelProperty
(
"二维码"
)
private
byte
[]
QRCode
;
/**
* 化验室编号
*/
@ApiModelProperty
(
"化验室编号"
)
private
String
LaboratoryID
;
/**
* 副品存放位置
*/
@ApiModelProperty
(
"副品存放位置"
)
private
String
Fpcfwz
;
/**
* 氧化钙
*/
@ApiModelProperty
(
"氧化钙"
)
private
Float
Cao
;
/**
* 氧化镁
*/
@ApiModelProperty
(
"氧化镁"
)
private
Float
MgO
;
/**
* 三氧化二铝
*/
@ApiModelProperty
(
"三氧化二铝"
)
private
Float
Al2O3
;
/**
* 二氧化硅
*/
@ApiModelProperty
(
"二氧化硅"
)
private
Float
SiO2
;
/**
* 三氧化二铁
*/
@ApiModelProperty
(
"三氧化二铁"
)
private
Float
Fe2O3
;
/**
* 氧化钾
*/
@ApiModelProperty
(
"氧化钾"
)
private
Float
k2o
;
/**
* 氧化钠
*/
@ApiModelProperty
(
"氧化钠"
)
private
Float
Na2O
;
/**
* 三氧化硫
*/
@ApiModelProperty
(
"三氧化硫"
)
private
Float
so3
;
/**
* 氯离子
*/
@ApiModelProperty
(
"氯离子"
)
private
Float
Cl
;
/**
* 烧失量
*/
@ApiModelProperty
(
"烧失量"
)
private
Float
Ssl
;
/**
* 收样时间
*/
@ApiModelProperty
(
"收样时间"
)
private
LocalDateTime
Sysj
;
/**
* 化验人
*/
@ApiModelProperty
(
"化验人"
)
private
String
Hyr
;
/**
* 化验时间
*/
@ApiModelProperty
(
"化验时间"
)
private
LocalDateTime
Hysj
;
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/model/query/TSampleListQuery.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author renchao
* @since 2021-04-22
*/
@Data
@ApiModel
(
"送样单query"
)
public
class
TSampleListQuery
implements
Serializable
{
/**
* 搜索字段
*/
@ApiModelProperty
(
"搜索字段"
)
private
String
search
;
/**
* 图片保存下载类型
*/
@ApiModelProperty
(
"图片保存下载类型 传“1”保存记录形式"
)
private
Integer
imageType
;
/**
* 样号
*/
@ApiModelProperty
(
"样号"
)
private
String
Yh
;
/**
* 二维码
*/
@ApiModelProperty
(
"二维码"
)
private
byte
[]
QRCode
;
/**
* 采区名称
*/
@ApiModelProperty
(
"职务名称"
)
private
String
StopeName
;
/**
* 平台名称
*/
@ApiModelProperty
(
"平台名称"
)
private
String
StepName
;
/**
* 爆区名称
*/
@ApiModelProperty
(
"爆区名称"
)
private
String
BlastAreaName
;
/**
* 炮孔编号
*/
@ApiModelProperty
(
"炮孔编号"
)
private
String
HolesID
;
/**
* 从
*/
@ApiModelProperty
(
"从"
)
private
String
Start
;
/**
* 至
*/
@ApiModelProperty
(
"至"
)
private
String
EndTo
;
/**
* 送样人
*/
@ApiModelProperty
(
"送样人"
)
private
String
Syr
;
/**
* 送样时间
*/
@ApiModelProperty
(
"送样时间"
)
private
LocalDateTime
Syrq
;
/**
* 备注
*/
@ApiModelProperty
(
"备注"
)
private
String
Bz
;
/**
* 记录对象
*/
@ApiModelProperty
(
"记录对象"
)
private
String
RecordName
;
/**
* 记录形式
*/
@ApiModelProperty
(
"记录形式"
)
private
byte
[]
RecordCode
;
public
TSampleListQuery
(){}
public
TSampleListQuery
(
String
yh
)
{
this
.
Yh
=
yh
;
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/ITSampleLaboratorysheetService.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
;
import
cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet
;
import
cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务类
* </p>
*
* @author renchao
* @since 2021-04-25
*/
public
interface
ITSampleLaboratorysheetService
extends
IService
<
TSampleLaboratorysheet
>
{
R
getByYh
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
);
R
updateByYh
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
);
R
deleteByYh
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
);
R
insertTSampleLaboratorysheet
(
TSampleLaboratorysheetQuery
tSampleLaboratorysheetQuery
);
R
getImage
(
TSampleLaboratorysheetQuery
query
,
final
HttpServletResponse
response
);
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/ITSampleListService.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
;
import
cn.wise.sc.acquisition.business.entity.TSampleList
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2021-04-22
*/
public
interface
ITSampleListService
extends
IService
<
TSampleList
>
{
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
);
R
updateByYh
(
TSampleListQuery
tSampleListQuery
);
R
deleteByYh
(
TSampleListQuery
tSampleListQuery
);
R
insertSampleList
(
TSampleListQuery
tSampleListQuery
);
R
saveImage
(
TSampleListQuery
query
,
MultipartFile
file
);
R
getImage
(
TSampleListQuery
query
,
final
HttpServletResponse
response
);
R
getByYh
(
TSampleListQuery
query
);
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TSampleLaboratorysheetServiceImpl.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
.
impl
;
import
cn.wise.sc.acquisition.business.constant.Rcode
;
import
cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet
;
import
cn.wise.sc.acquisition.business.enumation.ProjectEnum
;
import
cn.wise.sc.acquisition.business.mapper.TSampleLaboratorysheetMapper
;
import
cn.wise.sc.acquisition.business.model.query.TSampleLaboratorysheetQuery
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.service.ITSampleLaboratorysheetService
;
import
cn.wise.sc.acquisition.business.service.ITSampleListService
;
import
cn.wise.sc.acquisition.business.util.ImageUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
/**
* <p>
* 服务实现类
* </p>
*
* @author renchao
* @since 2021-04-25
*/
@Service
@Slf4j
public
class
TSampleLaboratorysheetServiceImpl
extends
ServiceImpl
<
TSampleLaboratorysheetMapper
,
TSampleLaboratorysheet
>
implements
ITSampleLaboratorysheetService
{
@Autowired
private
ITSampleListService
tSampleListService
;
@Override
public
R
getByYh
(
TSampleLaboratorysheetQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
TSampleLaboratorysheet
tSampleLaboratorysheet
=
baseMapper
.
selectById
(
query
.
getYh
());
return
R
.
ok
(
tSampleLaboratorysheet
);
}
@Override
public
R
updateByYh
(
TSampleLaboratorysheetQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//查询数据
TSampleLaboratorysheet
tSampleLaboratorysheet
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
tSampleLaboratorysheet
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//封装
tSampleLaboratorysheet
=
new
TSampleLaboratorysheet
();
BeanUtils
.
copyProperties
(
query
,
tSampleLaboratorysheet
);
int
update
=
baseMapper
.
updateById
(
tSampleLaboratorysheet
);
if
(
update
>
0
)
{
return
R
.
ok
(
"修改成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleLaboratorysheet
));
return
R
.
failed
(
"修改失败"
);
}
}
@Override
public
R
deleteByYh
(
TSampleLaboratorysheetQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//查询数据
TSampleLaboratorysheet
tSampleLaboratorysheet
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
tSampleLaboratorysheet
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//删除
int
delete
=
baseMapper
.
deleteById
(
query
.
getYh
());
if
(
delete
>
0
)
{
return
R
.
ok
(
"修改成功"
);
}
else
{
return
R
.
failed
(
"修改失败"
);
}
}
@Override
public
R
insertTSampleLaboratorysheet
(
TSampleLaboratorysheetQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断是否存在送样号
R
temp
=
tSampleListService
.
getByYh
(
new
TSampleListQuery
(
query
.
getYh
()));
if
(
temp
.
getData
()
==
null
)
{
return
R
.
failed
(
"送验单不存在,样号:"
+
query
.
getYh
());
}
//判断是否已经存在分析结果单
R
temp1
=
getByYh
(
query
);
if
(
temp1
.
getData
()
!=
null
)
{
return
R
.
failed
(
"分析结果样号已存在,样号:"
+
query
.
getYh
());
}
//继续判断参数
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getLaboratoryID
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getSysj
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getHysj
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getHyr
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getFpcfwz
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getCao
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getMgO
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getSiO2
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getAl2O3
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getFe2O3
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getK2o
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getNa2O
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getSo3
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getCl
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getSsl
());
//封装
TSampleLaboratorysheet
tSampleLaboratorysheet
=
new
TSampleLaboratorysheet
();
BeanUtils
.
copyProperties
(
query
,
tSampleLaboratorysheet
);
//生成二维码 并且保存
//tSampleLaboratorysheet.setQRCode(ImageUtil.QRCodeGenerator(JSON.toJSONString(tSampleLaboratorysheet)));
//保存
int
insert
=
baseMapper
.
insert
(
tSampleLaboratorysheet
);
if
(
insert
>
0
)
{
return
R
.
ok
(
"添加成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleLaboratorysheet
));
return
R
.
failed
(
"添加失败"
);
}
}
/**
* 获取图片二维码
*
* @param query
* @param response
*/
@Override
@Transactional
public
R
getImage
(
TSampleLaboratorysheetQuery
query
,
final
HttpServletResponse
response
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参加校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//查询
TSampleLaboratorysheet
tSampleLaboratorysheet
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
tSampleLaboratorysheet
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//获取二维码或者记录形式
//先生成二维码并且放到实体中
tSampleLaboratorysheet
.
setQRCode
(
ImageUtil
.
QRCodeGenerator
(
JSON
.
toJSONString
(
tSampleLaboratorysheet
)));
//下载图片
ImageUtil
.
getImage
(
ProjectEnum
.
ImageType
.
QR_CODE
.
getValue
(),
tSampleLaboratorysheet
,
response
);
//如果下载失败才会执行return
return
R
.
failed
(
"该条数据没有图片"
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TSampleListServiceImpl.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
.
impl
;
import
cn.wise.sc.acquisition.business.constant.Rcode
;
import
cn.wise.sc.acquisition.business.entity.TSampleList
;
import
cn.wise.sc.acquisition.business.enumation.ProjectEnum
;
import
cn.wise.sc.acquisition.business.mapper.TSampleListMapper
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
cn.wise.sc.acquisition.business.service.ITSampleListService
;
import
cn.wise.sc.acquisition.business.util.ImageUtil
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.Optional
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2021-04-22
*/
@Service
@Slf4j
public
class
TSampleListServiceImpl
extends
ServiceImpl
<
TSampleListMapper
,
TSampleList
>
implements
ITSampleListService
{
@Override
public
R
getPage
(
TSampleListQuery
tSampleListQuery
,
Query
query
)
{
log
.
info
(
JSON
.
toJSONString
(
tSampleListQuery
));
//参数校验
//分页
Page
<
TSampleList
>
page
=
new
Page
<>(
query
.
getPageNum
(),
query
.
getPageSize
());
//条件封装 因为图片字节太长,排除QR_CODE,RECORD_CODE
QueryWrapper
<
TSampleList
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
TSampleList
.
class
,
info
->
!
info
.
getColumn
().
equals
(
ProjectEnum
.
ImageType
.
QR_CODE
.
getLabel
())
&&
!
info
.
getColumn
().
equals
(
ProjectEnum
.
ImageType
.
RECORD_CODE
.
getLabel
()))
.
like
(
StringUtils
.
isNotBlank
(
tSampleListQuery
.
getSearch
()),
ProjectEnum
.
TSampleListType
.
YH
.
getLabel
(),
tSampleListQuery
.
getSearch
())
.
or
()
.
like
(
StringUtils
.
isNotBlank
(
tSampleListQuery
.
getSearch
()),
ProjectEnum
.
TSampleListType
.
HOLES_ID
.
getLabel
(),
tSampleListQuery
.
getSearch
());
//查询
Page
<
TSampleList
>
tSampleListPage
=
baseMapper
.
selectPage
(
page
,
queryWrapper
);
return
R
.
ok
(
tSampleListPage
);
}
@Override
@Transactional
public
R
getByYh
(
TSampleListQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//查询并且返回
return
R
.
ok
(
baseMapper
.
selectById
(
query
.
getYh
()));
}
@Override
@Transactional
public
R
updateByYh
(
TSampleListQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否存在
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//条件封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
query
,
tSampleList
);
QueryWrapper
<
TSampleList
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
ProjectEnum
.
TSampleListType
.
YH
.
getLabel
(),
query
.
getYh
());
//修改
int
update
=
baseMapper
.
update
(
tSampleList
,
queryWrapper
);
if
(
update
>
0
)
{
return
R
.
ok
(
"修改成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
return
R
.
failed
(
"修改失败"
);
}
}
@Override
@Transactional
public
R
insertSampleList
(
TSampleListQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否已存在,如果存在不能添加
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
!=
null
)
{
return
R
.
failed
(
"送验单样号已存在,样号:"
+
query
.
getYh
());
}
//继续判断参数
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getHolesID
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getStart
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getEndTo
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getRecordName
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getBz
());
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getSyr
());
//条件封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
query
,
tSampleList
);
//若时间送样为空,创建当前时间
Optional
<
LocalDateTime
>
ofNullable
=
Optional
.
ofNullable
(
tSampleList
.
getSyrq
());
if
(!
ofNullable
.
isPresent
())
{
tSampleList
.
setSyrq
(
LocalDateTime
.
now
());
}
//增加
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
int
insert
=
baseMapper
.
insert
(
tSampleList
);
if
(
insert
>
0
)
{
return
R
.
ok
(
"增加成功"
);
}
else
{
log
.
info
(
JSON
.
toJSONString
(
tSampleList
));
return
R
.
failed
(
"增加失败"
);
}
}
@Override
@Transactional
public
R
deleteByYh
(
TSampleListQuery
query
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参数校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//删除
int
delete
=
baseMapper
.
delete
(
new
QueryWrapper
<
TSampleList
>().
eq
(
ProjectEnum
.
TSampleListType
.
YH
.
getLabel
(),
query
.
getYh
()));
if
(
delete
>
0
)
{
return
R
.
ok
(
"删除成功"
);
}
else
{
return
R
.
failed
(
"删除失败"
);
}
}
@Override
@Transactional
public
R
saveImage
(
TSampleListQuery
query
,
MultipartFile
file
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参加校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
//判断数据是否存在
TSampleList
temp
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
temp
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getImageType
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
file
);
//封装
TSampleList
tSampleList
=
new
TSampleList
();
BeanUtils
.
copyProperties
(
query
,
tSampleList
);
//转化图片
ImageUtil
.
setImage
(
query
.
getImageType
(),
tSampleList
,
file
);
//保存
int
update
=
baseMapper
.
updateById
(
tSampleList
);
if
(
update
>
0
)
{
return
R
.
ok
(
"保存成功"
);
}
else
{
return
R
.
failed
(
"保存失败"
);
}
}
/**
* 获取图片二维码
*
* @param query
* @param response
*/
@Override
@Transactional
public
R
getImage
(
TSampleListQuery
query
,
final
HttpServletResponse
response
)
{
log
.
info
(
JSON
.
toJSONString
(
query
));
//参加校验
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotEmpty
(
query
.
getYh
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getImageType
());
TSampleList
tSampleList
=
baseMapper
.
selectById
(
query
.
getYh
());
if
(
tSampleList
==
null
)
{
return
R
.
failed
(
"数据不存在,样号:"
+
query
.
getYh
());
}
//获取二维码或者记录形式
ImageUtil
.
getImage
(
query
.
getImageType
(),
tSampleList
,
response
);
//如果下载失败才会执行return
return
R
.
failed
(
"该条数据没有图片"
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/util/ImageUtil.java
0 → 100644
View file @
e5267295
package
cn
.
wise
.
sc
.
acquisition
.
business
.
util
;
import
cn.hutool.core.codec.Base64
;
import
cn.hutool.extra.qrcode.QrCodeUtil
;
import
cn.wise.sc.acquisition.business.entity.TSampleLaboratorysheet
;
import
cn.wise.sc.acquisition.business.entity.TSampleList
;
import
cn.wise.sc.acquisition.business.enumation.ProjectEnum
;
import
cn.wise.sc.acquisition.business.model.query.TSampleListQuery
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletResponse
;
import
java.awt.image.BufferedImage
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
/**
* Author renchao
* 文件上传下载转化工具类,二维码生成
*/
public
class
ImageUtil
{
/**
* 将文件转化为字节
*/
public
static
byte
[]
transformByte
(
MultipartFile
file
)
{
if
(
file
==
null
)
throw
new
RuntimeException
(
"文件为空"
);
try
{
byte
[]
pictureData
=
new
byte
[(
int
)
file
.
getSize
()];
InputStream
inputStream
=
file
.
getInputStream
();
inputStream
.
read
(
pictureData
);
inputStream
.
close
();
return
pictureData
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"图片转化失败"
);
}
}
/**
* 将字节转化为文件,并下载
*/
public
static
void
transformImage
(
byte
[]
data
,
final
HttpServletResponse
response
)
{
if
(
data
.
length
==
0
)
throw
new
RuntimeException
(
"图片数据为空"
);
response
.
setContentType
(
"image/jpeg"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
OutputStream
outputSream
;
try
{
outputSream
=
response
.
getOutputStream
();
outputSream
.
write
(
data
);
outputSream
.
flush
();
outputSream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"图片下载失败"
);
}
}
/**
* 将多个文件转化为字节
*/
public
static
byte
[]
transformByteMore
(
MultipartFile
[]
files
)
{
if
(
files
==
null
||
files
.
length
==
0
)
throw
new
RuntimeException
(
"文件为空"
);
try
{
//创建字节流数组
List
<
byte
[]>
bytes
=
new
ArrayList
<>();
InputStream
inputStream
=
null
;
//循环读取文件
for
(
MultipartFile
file
:
files
)
{
byte
[]
pictureData
=
new
byte
[(
int
)
file
.
getSize
()];
inputStream
=
file
.
getInputStream
();
inputStream
.
read
(
pictureData
);
bytes
.
add
(
pictureData
);
}
//关流
if
(
inputStream
!=
null
)
{
inputStream
.
close
();
}
//将数组转化为字节
byte
[]
data
=
JSON
.
toJSONString
(
bytes
,
true
).
getBytes
();
return
data
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"图片转化失败"
);
}
}
/**
* 将字节转化为文件,并下载
*/
public
static
void
transformImageMore
(
byte
[]
data
,
final
HttpServletResponse
response
)
{
if
(
data
==
null
||
data
.
length
==
0
)
throw
new
RuntimeException
(
"图片数据为空"
);
response
.
setContentType
(
"image/jpeg"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
OutputStream
outputSream
=
null
;
try
{
List
<
byte
[]>
bytes
=
JSON
.
parseObject
(
new
String
(
data
),
new
TypeReference
<
List
<
byte
[]>>()
{
});
outputSream
=
response
.
getOutputStream
();
for
(
byte
[]
picture
:
bytes
)
{
outputSream
.
write
(
picture
);
}
outputSream
.
flush
();
if
(
outputSream
!=
null
)
{
outputSream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"图片下载失败"
);
}
}
/**
* 根据obj类型获取图片
*/
public
static
void
getImage
(
Integer
imageType
,
Object
obj
,
final
HttpServletResponse
response
)
{
if
(
imageType
==
null
||
imageType
.
intValue
()
==
0
)
throw
new
RuntimeException
(
"下载图片时imageType为空"
);
if
(
obj
==
null
)
throw
new
RuntimeException
(
"下载图片时obj为空"
);
if
(
response
==
null
)
throw
new
RuntimeException
(
"下载图片时response为空"
);
byte
[]
data
=
null
;
if
(
obj
instanceof
TSampleList
)
{
TSampleList
tSampleList
=
(
TSampleList
)
obj
;
//判断获取二维码还是记录形式
if
(
ProjectEnum
.
ImageType
.
getLabel
(
imageType
).
equals
(
ProjectEnum
.
ImageType
.
RECORD_CODE
.
getLabel
()))
{
data
=
tSampleList
.
getRecordCode
();
}
if
(
ProjectEnum
.
ImageType
.
getLabel
(
imageType
).
equals
(
ProjectEnum
.
ImageType
.
QR_CODE
.
getLabel
()))
{
data
=
tSampleList
.
getQRCode
();
}
}
else
if
(
obj
instanceof
TSampleLaboratorysheet
)
{
TSampleLaboratorysheet
tSampleLaboratorysheet
=
(
TSampleLaboratorysheet
)
obj
;
data
=
tSampleLaboratorysheet
.
getQRCode
();
}
if
(
data
!=
null
)
{
//下载图片
ImageUtil
.
transformImage
(
data
,
response
);
}
return
;
}
/**
* 根据类型保存并转化文件为图片 需要请求参数ImageType 保存的实体TSampleList 以及file
*/
public
static
void
setImage
(
Integer
imageType
,
Object
obj
,
MultipartFile
file
)
{
if
(
obj
instanceof
TSampleList
)
{
TSampleList
tSampleList
=
(
TSampleList
)
obj
;
//判断保存二维码还是记录形式
if
(
ProjectEnum
.
ImageType
.
getLabel
(
imageType
).
equals
(
ProjectEnum
.
ImageType
.
RECORD_CODE
.
getLabel
()))
{
tSampleList
.
setRecordCode
(
transformByte
(
file
));
}
if
(
ProjectEnum
.
ImageType
.
getLabel
(
imageType
).
equals
(
ProjectEnum
.
ImageType
.
QR_CODE
.
getLabel
()))
{
tSampleList
.
setQRCode
(
transformByte
(
file
));
}
}
else
if
(
obj
instanceof
TSampleLaboratorysheet
)
{
TSampleLaboratorysheet
tSampleLaboratorysheet
=
(
TSampleLaboratorysheet
)
obj
;
tSampleLaboratorysheet
.
setQRCode
(
transformByte
(
file
));
}
}
/**
* 二维码生成工具类
*
* @param content
*/
public
static
byte
[]
QRCodeGenerator
(
String
content
)
{
if
(
StringUtils
.
isEmpty
(
content
))
throw
new
RuntimeException
(
"二维码转化内容为空"
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
BufferedImage
bufferedImage
=
QrCodeUtil
.
generate
(
content
,
200
,
200
);
try
{
ImageIO
.
write
(
bufferedImage
,
"png"
,
stream
);
stream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
//String encode = Base64.encode(stream.toByteArray());
return
stream
.
toByteArray
();
}
}
acquisition-business/target/classes/META-INF/acquisition-business.kotlin_module
0 → 100644
View file @
e5267295
File added
acquisition-business/target/classes/application-dev.yml
0 → 100644
View file @
e5267295
server
:
port
:
7008
#-Dspring.config.location=D:\idea_workspases\tianjin-acquisition\acquisition-business\src\main\resources\application.yml
spring
:
application
:
data-acquisition
profiles
:
active
:
dev
datasource
:
# 192.168.110.85 fpsn CementMine
url
:
jdbc:sqlserver://192.168.110.85:1433;DatabaseName=fpsn
username
:
sa
password
:
admin!@#123
driverClassName
:
com.microsoft.sqlserver.jdbc.SQLServerDriver
hikari
:
minimum-idle
:
3
maximum-pool-size
:
10
max-lifetime
:
30000
#不能小于30秒,否则默认回到1800秒
connection-test-query
:
SELECT 1
redis
:
port
:
6379
host
:
192.168.110.85
database
:
2
# password: Wise_@123456
servlet
:
multipart
:
max-file-size
:
100MB
max-request-size
:
100MB
# 设置swagger用户名密码
swagger
:
basic
:
enable
:
false
username
:
admin
password
:
admin
mybatis-plus
:
# 启动时是否检查MyBatis XML文件是否存在
check-config-location
:
true
type-aliases-package
:
cn.wise.sc.acquisition.business.entity.**
mapper-locations
:
classpath:/cn/wise/sc/acquisition/business/mapper/xml/*Mapper.xml
acquisition-business/target/classes/application.yml
0 → 100644
View file @
e5267295
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TEquipmentAccountMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TEquipmentAccountMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSampleLaboratorysheetMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSampleLaboratorysheetMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSampleListMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSampleListMapper"
>
<!-- 表和实体字段对照关系, 类似RestultMap -->
<sql
id=
"TSampleListColumns"
>
a.Yh,
a.QRCode,
a.StopeName,
a.StepName,
a.BlastAreaName,
a.HolesID,
a.Start,
a.EndTo,
a.Syr,
a.Syrq,
a.Bz
</sql>
<sql
id=
"TSampleListJoins"
>
</sql>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysDeptMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysDeptMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysDictMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysDictMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysPowerMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysPowerMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysRoleMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysRoleMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysRolepowerMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysRolepowerMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysUserLoginMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysUserLoginMapper"
>
</mapper>
acquisition-business/target/classes/cn/wise/sc/acquisition/business/mapper/TSysUserMapper.xml
0 → 100644
View file @
e5267295
<?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.acquisition.business.mapper.TSysUserMapper"
>
</mapper>
acquisition-business/target/classes/fastdfs-client.properties
0 → 100644
View file @
e5267295
fastdfs.connect_timeout
=
2000
fastdfs.network_timeout
=
1501
fastdfs.charset
=
UTF-8
fastdfs.http.tracker_http_port
=
8888
fastdfs.http.anti_steal_token
=
no
fastdfs.http.secret_key
=
FastDFS1234567890
fastdfs.tracker_servers
=
localhost:22122
acquisition-business/target/classes/license.xml
0 → 100644
View file @
e5267295
<License>
<Data>
<Products>
<Product>
Aspose.Total for Java
</Product>
<Product>
Aspose.Words for Java
</Product>
</Products>
<EditionType>
Enterprise
</EditionType>
<SubscriptionExpiry>
20991231
</SubscriptionExpiry>
<LicenseExpiry>
20991231
</LicenseExpiry>
<SerialNumber>
8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7
</SerialNumber>
</Data>
<Signature>
sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=
</Signature>
</License>
\ No newline at end of file
acquisition-business/target/classes/logback-spring.xml
0 → 100644
View file @
e5267295
This diff is collapsed.
Click to expand it.
im-common/target/classes/META-INF/spring.factories
0 → 100644
View file @
e5267295
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.wise.im.common.exception.handler.UnifiedExceptionHandler,\
cn.wise.im.common.currency.i18n.UnifiedMessageSource
im-common/target/classes/application.yml
0 → 100644
View file @
e5267295
spring
:
mvc
:
throw-exception-if-no-handler-found
:
true
resources
:
add-mappings
:
false
\ No newline at end of file
mybatis-generator/src/main/java/cn/wise/sc/acquisition/mg/GeneratorApplication.java
View file @
e5267295
...
...
@@ -57,7 +57,7 @@ public class GeneratorApplication {
GlobalConfig
gc
=
new
GlobalConfig
();
String
projectPath
=
System
.
getProperty
(
"user.dir"
);
gc
.
setOutputDir
(
projectPath
+
"\\acquisition-business\\src\\main\\java"
);
gc
.
setAuthor
(
"
ztw
"
);
gc
.
setAuthor
(
"
renchao
"
);
gc
.
setOpen
(
false
);
// gc.setSwagger2(true); 实体属性 Swagger2 注解
mpg
.
setGlobalConfig
(
gc
);
...
...
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