Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-soil
Overview
Overview
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
wangweidong
patzn-cloud-service-soil
Commits
51dc5098
Commit
51dc5098
authored
Dec 29, 2020
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
11fd0bcf
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
371 additions
and
65 deletions
+371
-65
POIUtil.java
...ain/java/com/patzn/cloud/service/lims/common/POIUtil.java
+117
-24
LmsMsgService.java
...cloud/service/lims/common/service/impl/LmsMsgService.java
+22
-26
RabbitMQConfig.java
...a/com/patzn/cloud/service/lims/config/RabbitMQConfig.java
+7
-7
SoilAloneSampleController.java
...rvice/lims/soil/controller/SoilAloneSampleController.java
+84
-3
SoilExperimentController.java
...ervice/lims/soil/controller/SoilExperimentController.java
+16
-0
SoilAloneSampleMapper.java
...cloud/service/lims/soil/mapper/SoilAloneSampleMapper.java
+7
-0
SoilExperimentMapper.java
.../cloud/service/lims/soil/mapper/SoilExperimentMapper.java
+2
-0
ISoilAloneSampleService.java
...ud/service/lims/soil/service/ISoilAloneSampleService.java
+6
-1
ISoilExperimentService.java
...oud/service/lims/soil/service/ISoilExperimentService.java
+1
-0
SoilAloneSampleServiceImpl.java
...ce/lims/soil/service/impl/SoilAloneSampleServiceImpl.java
+24
-2
SoilExperimentServiceImpl.java
...ice/lims/soil/service/impl/SoilExperimentServiceImpl.java
+12
-0
application-dev.yml
src/main/resources/application-dev.yml
+2
-2
SoilAloneSampleMapper.xml
src/main/resources/mapper/soil/SoilAloneSampleMapper.xml
+19
-0
SoilExperimentMapper.xml
src/main/resources/mapper/soil/SoilExperimentMapper.xml
+52
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/common/POIUtil.java
View file @
51dc5098
...
...
@@ -2,16 +2,15 @@ package com.patzn.cloud.service.lims.common;
import
com.google.common.collect.Lists
;
import
org.apache.poi.ooxml.POIXMLDocumentPart
;
import
org.apache.poi.ss.usermodel.CellType
;
import
org.apache.poi.ss.usermodel.PictureData
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.poi.xssf.usermodel.*
;
import
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker
;
import
java.io.*
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
public
class
POIUtil
{
public
static
void
copyCellStyle
(
XSSFCellStyle
fromStyle
,
XSSFCellStyle
toStyle
)
{
...
...
@@ -40,6 +39,8 @@ public class POIUtil {
CellType
cellType
=
fromCell
.
getCellType
();
toCell
.
setCellType
(
cellType
);
if
(
fromCell
==
null
||
fromCell
.
equals
(
null
)
||
fromCell
.
getCellType
()
==
CellType
.
BLANK
)
{
toCell
.
setCellValue
(
""
);
}
else
{
...
...
@@ -94,27 +95,27 @@ public class POIUtil {
File
file1
=
new
File
(
"D://excel//封面.xlsx"
);
File
file2
=
new
File
(
"D://excel//检测报告(力学试验)三轴.xlsx"
);
File
file3
=
new
File
(
"D://excel//检测报告(力学试验)手动十字板.xlsx"
);
File
file4
=
new
File
(
"D://excel//检测报告(力学试验)休止角.xlsx"
);
File
file5
=
new
File
(
"D://excel//检测报告(力学试验)袖珍贯入仪.xlsx"
);
File
file6
=
new
File
(
"D://excel//检测报告(力学试验)直剪.xlsx"
);
//
File file3 = new File("D://excel//检测报告(力学试验)手动十字板.xlsx");
//
File file4 = new File("D://excel//检测报告(力学试验)休止角.xlsx");
//
File file5 = new File("D://excel//检测报告(力学试验)袖珍贯入仪.xlsx");
//
File file6 = new File("D://excel//检测报告(力学试验)直剪.xlsx");
try
{
XSSFWorkbook
workbook1
=
new
XSSFWorkbook
(
file1
);
XSSFWorkbook
workbook2
=
new
XSSFWorkbook
(
file2
);
XSSFWorkbook
workbook3
=
new
XSSFWorkbook
(
file3
);
XSSFWorkbook
workbook4
=
new
XSSFWorkbook
(
file4
);
XSSFWorkbook
workbook5
=
new
XSSFWorkbook
(
file5
);
XSSFWorkbook
workbook6
=
new
XSSFWorkbook
(
file6
);
//
XSSFWorkbook workbook3 = new XSSFWorkbook(file3);
//
XSSFWorkbook workbook4 = new XSSFWorkbook(file4);
//
XSSFWorkbook workbook5 = new XSSFWorkbook(file5);
//
XSSFWorkbook workbook6 = new XSSFWorkbook(file6);
workbooks
.
add
(
workbook1
);
workbooks
.
add
(
workbook2
);
workbooks
.
add
(
workbook3
);
workbooks
.
add
(
workbook4
);
workbooks
.
add
(
workbook5
);
workbooks
.
add
(
workbook6
);
//
workbooks.add(workbook3);
//
workbooks.add(workbook4);
//
workbooks.add(workbook5);
//
workbooks.add(workbook6);
...
...
@@ -135,6 +136,8 @@ public class POIUtil {
if
(!
fromExcel
.
isSheetHidden
(
i
)){
XSSFSheet
oldSheet
=
fromExcel
.
getSheetAt
(
i
);
XSSFSheet
newSheet
=
newExcelCreat
.
createSheet
(
oldSheet
.
getSheetName
());
copyPicture
(
newExcelCreat
,
oldSheet
,
newSheet
);
copySheet
(
newExcelCreat
,
oldSheet
,
newSheet
);
}
...
...
@@ -146,11 +149,11 @@ public class POIUtil {
int
sheetNs
=
newExcelCreat
.
getNumberOfSheets
();
for
(
int
i
=
0
;
i
<
sheetNs
;
i
++)
{
if
(!
newExcelCreat
.
isSheetHidden
(
i
)){
HSSFWorkbookUtil
.
insertImageByRowColFile
(
newExcelCreat
,
newExcelCreat
.
getSheetAt
(
i
),
0
,
0
,
new
File
(
"D://excel//图片1.png"
));
}
}
//
for (int i = 0; i < sheetNs; i++) {
//
if (!newExcelCreat.isSheetHidden(i)){
//
HSSFWorkbookUtil.insertImageByRowColFile(newExcelCreat,newExcelCreat.getSheetAt(i),0,0, new File("D://excel//图片1.png"));
//
}
//
}
String
allFileName
=
"d:/excel/0.xlsx"
;
fileOut
=
new
FileOutputStream
(
allFileName
);
...
...
@@ -180,9 +183,98 @@ public class POIUtil {
return
null
;
}
public
static
void
main
(
String
[]
args
)
{
hc
(
Lists
.
newArrayList
(),
"1212"
);
public
static
Map
<
String
,
PictureData
>
getSheetPictrues07
(
int
sheetNum
,
XSSFSheet
sheet
,
XSSFWorkbook
workbook
)
{
Map
<
String
,
PictureData
>
sheetIndexPicMap
=
new
HashMap
<>();
for
(
POIXMLDocumentPart
dr
:
sheet
.
getRelations
())
{
if
(
dr
instanceof
XSSFDrawing
)
{
XSSFDrawing
drawing
=
(
XSSFDrawing
)
dr
;
List
<
XSSFShape
>
shapes
=
drawing
.
getShapes
();
for
(
XSSFShape
shape
:
shapes
)
{
XSSFPicture
pic
=
(
XSSFPicture
)
shape
;
XSSFClientAnchor
anchor
=
pic
.
getPreferredSize
();
CTMarker
ctMarker
=
anchor
.
getFrom
();
String
picIndex
=
String
.
valueOf
(
sheetNum
)
+
"_"
+
ctMarker
.
getRow
()
+
"_"
+
ctMarker
.
getCol
();
sheetIndexPicMap
.
put
(
picIndex
,
pic
.
getPictureData
());
}
}
}
return
sheetIndexPicMap
;
}
public
static
void
printImg
(
List
<
Map
<
String
,
PictureData
>>
sheetList
)
throws
IOException
{
for
(
Map
<
String
,
PictureData
>
map
:
sheetList
)
{
Object
key
[]
=
map
.
keySet
().
toArray
();
for
(
int
i
=
0
;
i
<
map
.
size
();
i
++)
{
// 获取图片流
PictureData
pic
=
map
.
get
(
key
[
i
]);
// 获取图片索引
String
picName
=
key
[
i
].
toString
();
// 获取图片格式
String
ext
=
pic
.
suggestFileExtension
();
byte
[]
data
=
pic
.
getData
();
FileOutputStream
out
=
new
FileOutputStream
(
"D:\\excel\\"
+
picName
+
"."
+
ext
);
out
.
write
(
data
);
out
.
close
();
}
}
}
// public static void main(String[] args) {
// hc(Lists.newArrayList(),"1212");
//// File file2 = new File("D://excel//检测报告(力学试验)三轴.xlsx");
//// try {
//// XSSFWorkbook workbook = new XSSFWorkbook(file2);
//// Map<String, Object> map = getPicturesFromXSSFSheet(workbook.getSheetAt(0));
//// System.out.println(map);
//// }catch (Exception e){
////
//// }
//
//
// }
/**
* 获取图片和位置 (xlsx)
*/
public
static
Map
<
String
,
Object
>
getPicturesFromXSSFSheet
(
XSSFSheet
sheet
)
throws
IOException
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
List
<
POIXMLDocumentPart
>
list
=
sheet
.
getRelations
();
for
(
POIXMLDocumentPart
part
:
list
)
{
if
(
part
instanceof
XSSFDrawing
)
{
XSSFDrawing
drawing
=
(
XSSFDrawing
)
part
;
List
<
XSSFShape
>
shapes
=
drawing
.
getShapes
();
for
(
XSSFShape
shape
:
shapes
)
{
XSSFPicture
picture
=
(
XSSFPicture
)
shape
;
XSSFClientAnchor
anchor
=
picture
.
getPreferredSize
();
map
.
put
(
"pictureAnchor"
,
anchor
);
map
.
put
(
"pictureByteArray"
,
picture
.
getPictureData
().
getData
());
map
.
put
(
"pictureType"
,
picture
.
getPictureData
().
getPictureType
());
}
}
}
return
map
;
}
public
static
void
copyPicture
(
XSSFWorkbook
workbook
,
XSSFSheet
sourceSheet
,
XSSFSheet
targetSheet
)
throws
IOException
{
XSSFDrawing
drawing
=
targetSheet
.
createDrawingPatriarch
();
Map
<
String
,
Object
>
sourceSheetPicture
=
getPicturesFromXSSFSheet
(
sourceSheet
);
drawing
.
createPicture
((
XSSFClientAnchor
)
sourceSheetPicture
.
get
(
"pictureAnchor"
),
workbook
.
addPicture
((
byte
[])
sourceSheetPicture
.
get
(
"pictureByteArray"
),
Integer
.
parseInt
(
sourceSheetPicture
.
get
(
"pictureType"
).
toString
())));
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/common/service/impl/LmsMsgService.java
View file @
51dc5098
...
...
@@ -3,6 +3,7 @@ import com.patzn.cloud.commons.controller.Account;
import
com.patzn.cloud.mq.MqMsg
;
import
com.patzn.cloud.mq.MqProperties
;
import
com.patzn.cloud.service.lims.common.service.ILmsMsgService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.AmqpException
;
...
...
@@ -53,32 +54,27 @@ public class LmsMsgService implements ILmsMsgService {
private
MqMsg
getMqMsg
(
String
uri
,
String
msgType
,
String
content
,
String
title
,
Account
account
,
List
<
Long
>
toUserId
,
int
businessType
,
String
groupAlias
)
{
MqMsg
mqMsg
=
new
MqMsg
();
// mqMsg.setUid(account.getUserId());
// // 消息类型
// mqMsg.setMsgType(msgType);
// if (StringUtils.isNotEmpty(msgType) && StringUtils.isEmpty(uri)) {
// // 不是空的并且路由是空的,需要根据 msgType 查询标签的路由
// mqMsg.setUri(EnvMessageTypeEnum.getByValue(msgType));
// } else {
// // 路由
// mqMsg.setUri(uri);
// }
// // 企业ID
// mqMsg.setCompanyId(account.getCompanyId());
// // 发送人
// mqMsg.setSender(account.getUserName());
// // 标题
// mqMsg.setTitle(title);
// // 内容
// mqMsg.setContent(content);
// // 类型
// mqMsg.setType(1);
// // 服务名称
// mqMsg.setService(service);
// // 接收人集合
// mqMsg.setReceiverIds(toUserId);
// mqMsg.setBusinessType(businessType);
// mqMsg.setBusiness(groupAlias);
mqMsg
.
setUid
(
account
.
getUserId
());
// 消息类型
mqMsg
.
setMsgType
(
msgType
);
// 路由
mqMsg
.
setUri
(
uri
);
// 企业ID
mqMsg
.
setCompanyId
(
account
.
getCompanyId
());
// 发送人
mqMsg
.
setSender
(
account
.
getUserName
());
// 标题
mqMsg
.
setTitle
(
title
);
// 内容
mqMsg
.
setContent
(
content
);
// 类型
mqMsg
.
setType
(
1
);
// 服务名称
mqMsg
.
setService
(
service
);
// 接收人集合
mqMsg
.
setReceiverIds
(
toUserId
);
mqMsg
.
setBusinessType
(
businessType
);
mqMsg
.
setBusiness
(
groupAlias
);
return
mqMsg
;
}
...
...
src/main/java/com/patzn/cloud/service/lims/config/RabbitMQConfig.java
View file @
51dc5098
...
...
@@ -52,11 +52,11 @@ public class RabbitMQConfig extends MqAutoConfiguration {
return
new
Queue
(
mqProperties
.
getTopic
().
getEquipCheckMsg
());
}
//
/**
//
* 初始化计量队列
//
*/
//
@Bean
// public Queue meter
Queue() {
// return new Queue(mqProperties.getTopic().getMeter
WorkMsg());
//
}
/**
* 初始化计量队列
*/
@Bean
public
Queue
soil
Queue
()
{
return
new
Queue
(
mqProperties
.
getTopic
().
getSoil
WorkMsg
());
}
}
src/main/java/com/patzn/cloud/service/lims/soil/controller/SoilAloneSampleController.java
View file @
51dc5098
...
...
@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.soil.controller;
import
com.patzn.cloud.service.soil.entity.SoilAloneInOutStock
;
import
com.patzn.cloud.service.soil.entity.SoilAloneSample
;
import
com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum
;
import
com.patzn.cloud.service.soil.vo.SoilAloneSampleVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -24,6 +25,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -48,13 +50,33 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPage
(
SoilAloneSample
soilAloneSample
)
{
public
RestResult
<
Page
<
SoilAloneSample
>>
getPage
(
SoilAloneSample
VO
soilAloneSample
)
{
soilAloneSample
.
setStatus
(
SoilAloneStatusEnum
.
DRAFT
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"登记历史分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_register_his"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageRegisterHis
(
SoilAloneSampleVO
soilAloneSample
)
{
List
<
SoilAloneStatusEnum
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
SoilAloneStatusEnum
.
WAIT_STORAGE
);
statusList
.
add
(
SoilAloneStatusEnum
.
WAIT_DELIVERY
);
statusList
.
add
(
SoilAloneStatusEnum
.
DELIVERY_OK
);
soilAloneSample
.
setStatusList
(
statusList
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"待入库分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -63,12 +85,31 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_wait_storage"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitStorage
(
SoilAloneSample
soilAloneSample
)
{
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitStorage
(
SoilAloneSample
VO
soilAloneSample
)
{
soilAloneSample
.
setStatus
(
SoilAloneStatusEnum
.
WAIT_STORAGE
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"入库历史分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_wait_storage_his"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitStorageHis
(
SoilAloneSampleVO
soilAloneSample
)
{
List
<
SoilAloneStatusEnum
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
SoilAloneStatusEnum
.
WAIT_DELIVERY
);
statusList
.
add
(
SoilAloneStatusEnum
.
DELIVERY_OK
);
soilAloneSample
.
setStatusList
(
statusList
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"待出库分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -77,12 +118,43 @@ public class SoilAloneSampleController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_wait_delivery"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitDelivery
(
SoilAloneSample
soilAloneSample
)
{
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitDelivery
(
SoilAloneSample
VO
soilAloneSample
)
{
soilAloneSample
.
setStatus
(
SoilAloneStatusEnum
.
WAIT_DELIVERY
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"出库历史分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_wait_delivery_his"
)
public
RestResult
<
Page
<
SoilAloneSample
>>
getPageWaitDeliveryHis
(
SoilAloneSampleVO
soilAloneSample
)
{
soilAloneSample
.
setStatus
(
SoilAloneStatusEnum
.
DELIVERY_OK
);
return
success
(
soilAloneSampleService
.
page
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"库房样品管理分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_storehouse_sample"
)
public
RestResult
<
Page
<
SoilAloneSampleVO
>>
getPageStorehouseSample
(
SoilAloneSampleVO
soilAloneSample
)
{
return
success
(
soilAloneSampleService
.
pageVO
(
getPage
(),
soilAloneSample
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
...
...
@@ -129,6 +201,15 @@ public class SoilAloneSampleController extends ServiceController {
@ApiOperation
(
"批量修改存放架位"
)
@PostMapping
(
"/bath_change_storehouse"
)
public
RestResult
<
Boolean
>
bathChangeStorehouse
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
SoilAloneInOutStock
aloneInOutStock
)
{
return
success
(
soilAloneSampleService
.
bathChangeStorehouse
(
ids
,
aloneInOutStock
,
getAccount
()));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
...
...
src/main/java/com/patzn/cloud/service/lims/soil/controller/SoilExperimentController.java
View file @
51dc5098
...
...
@@ -608,4 +608,20 @@ public class SoilExperimentController extends ServiceController {
return
success
(
soilExperimentService
.
saveExcelExpReport
(
expName
,
entrustId
,
ids
,
templateId
,
getAccount
()));
}
@ApiOperation
(
value
=
"试验项目查询分页列表"
,
notes
=
"试验项目查询分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataType
=
"String"
),
})
@PostMapping
(
"/list_experiment_progress"
)
public
RestResult
<
Page
<
SoilExperimentVO
>>
listExperimentProgress
(
SoilExperimentVO
vo
)
{
return
success
(
soilExperimentService
.
listExperimentProgress
(
getPage
(),
vo
));
}
}
src/main/java/com/patzn/cloud/service/lims/soil/mapper/SoilAloneSampleMapper.java
View file @
51dc5098
package
com
.
patzn
.
cloud
.
service
.
lims
.
soil
.
mapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.soil.entity.SoilAloneSample
;
import
com.patzn.cloud.service.soil.vo.SoilAloneSampleVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
java.util.List
;
/**
* <p>
...
...
@@ -13,4 +19,5 @@ import com.patzn.cloud.service.soil.entity.SoilAloneSample;
*/
public
interface
SoilAloneSampleMapper
extends
BatchMapper
<
SoilAloneSample
>
{
List
<
SoilAloneSampleVO
>
selectVOList
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
SoilAloneSampleVO
soilAloneSample
);
}
src/main/java/com/patzn/cloud/service/lims/soil/mapper/SoilExperimentMapper.java
View file @
51dc5098
...
...
@@ -38,4 +38,6 @@ public interface SoilExperimentMapper extends BaseMapper<SoilExperiment> {
List
<
SoilExperimentVO
>
selectListVOByIds
(
@Param
(
"ids"
)
Long
[]
expIds
);
List
<
SoilEntrustItemNumVO
>
listEntrustItemNum
(
@Param
(
"sampleIds"
)
List
<
Long
>
sampleIds
,
@Param
(
"vo"
)
SoilExperimentVO
vo
);
List
<
SoilExperimentVO
>
listExperimentProgress
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
SoilExperimentVO
vo
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilAloneSampleService.java
View file @
51dc5098
...
...
@@ -5,6 +5,7 @@ import com.patzn.cloud.commons.controller.Account;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.soil.entity.SoilAloneInOutStock
;
import
com.patzn.cloud.service.soil.entity.SoilAloneSample
;
import
com.patzn.cloud.service.soil.vo.SoilAloneSampleVO
;
import
java.util.List
;
...
...
@@ -16,7 +17,7 @@ import java.util.List;
*/
public
interface
ISoilAloneSampleService
extends
IBaseService
<
SoilAloneSample
>
{
Page
<
SoilAloneSample
>
page
(
Page
<
SoilAloneSample
>
page
,
SoilAloneSample
soilAloneSample
);
Page
<
SoilAloneSample
>
page
(
Page
<
SoilAloneSample
>
page
,
SoilAloneSample
VO
soilAloneSample
);
boolean
removeByIds
(
List
<
Long
>
ids
);
...
...
@@ -25,4 +26,8 @@ public interface ISoilAloneSampleService extends IBaseService<SoilAloneSample> {
boolean
inStorageSubmit
(
Long
[]
ids
,
SoilAloneInOutStock
aloneInOutStock
,
Account
account
);
boolean
outStorageSubmit
(
Long
[]
ids
,
SoilAloneInOutStock
aloneInOutStock
,
Account
account
);
Page
<
SoilAloneSampleVO
>
pageVO
(
Page
<
SoilAloneSampleVO
>
page
,
SoilAloneSampleVO
soilAloneSample
);
boolean
bathChangeStorehouse
(
Long
[]
ids
,
SoilAloneInOutStock
aloneInOutStock
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/ISoilExperimentService.java
View file @
51dc5098
...
...
@@ -87,4 +87,5 @@ public interface ISoilExperimentService extends IBaseService<SoilExperiment> {
Page
<
LmsUserRelGroupVO
>
pageGroupUser
(
Page
<
LmsUserRelGroupVO
>
page
,
LmsUserRelGroup
soilExperiment
);
Page
<
SoilExperimentVO
>
listExperimentProgress
(
Page
<
SoilExperimentVO
>
page
,
SoilExperimentVO
vo
);
}
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilAloneSampleServiceImpl.java
View file @
51dc5098
package
com
.
patzn
.
cloud
.
service
.
lims
.
soil
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper
;
...
...
@@ -10,6 +11,7 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
import
com.patzn.cloud.service.soil.entity.SoilAloneInOutStock
;
import
com.patzn.cloud.service.soil.entity.SoilAloneSample
;
import
com.patzn.cloud.service.soil.enums.SoilAloneStatusEnum
;
import
com.patzn.cloud.service.soil.vo.SoilAloneSampleVO
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -37,9 +39,13 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM
@Override
public
Page
<
SoilAloneSample
>
page
(
Page
<
SoilAloneSample
>
page
,
SoilAloneSample
soilAloneSample
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
soilAloneSample
);
public
Page
<
SoilAloneSample
>
page
(
Page
<
SoilAloneSample
>
page
,
SoilAloneSample
VO
soilAloneSample
)
{
SoilAloneSample
sample
=
soilAloneSample
.
convert
(
SoilAloneSample
.
class
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
sample
);
if
(
CollectionUtils
.
isNotEmpty
(
soilAloneSample
.
getStatusList
())){
wrapper
.
in
(
"status"
,
soilAloneSample
.
getStatusList
());
}
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -119,4 +125,20 @@ public class SoilAloneSampleServiceImpl extends BaseServiceImpl<SoilAloneSampleM
}
return
false
;
}
@Override
public
Page
<
SoilAloneSampleVO
>
pageVO
(
Page
<
SoilAloneSampleVO
>
page
,
SoilAloneSampleVO
soilAloneSample
)
{
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
soilAloneSample
));
}
@Override
public
boolean
bathChangeStorehouse
(
Long
[]
ids
,
SoilAloneInOutStock
aloneInOutStock
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要修改存放架位的样品"
);
if
(
null
==
aloneInOutStock
)
{
RestAssert
.
fail
(
"请填写存放架位信息!"
);
}
RestAssert
.
fail
(
StringUtils
.
isBlank
(
aloneInOutStock
.
getStorehouse
()),
"请填写库房号"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
aloneInOutStock
.
getShelfCode
()),
"请填写货架号"
);
return
soilAloneInOutStockService
.
update
(
aloneInOutStock
,
Condition
.
create
().
in
(
"alone_sample_id"
,
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/soil/service/impl/SoilExperimentServiceImpl.java
View file @
51dc5098
...
...
@@ -27,6 +27,7 @@ import com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO;
import
com.patzn.cloud.service.lims.collect.core.CollectDataType
;
import
com.patzn.cloud.service.lims.common.*
;
import
com.patzn.cloud.service.lims.common.service.IExportService
;
import
com.patzn.cloud.service.lims.common.service.ILmsMsgService
;
import
com.patzn.cloud.service.lims.soil.service.*
;
import
com.patzn.cloud.service.meter.entity.MeterEntrust
;
import
com.patzn.cloud.service.soil.entity.*
;
...
...
@@ -128,6 +129,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Autowired
private
ISoilDataGdsDetailService
soilDataGdsDetailService
;
@Autowired
private
ILmsMsgService
lmsMsgService
;
@Autowired
private
ISoilDataGdsService
soilDataGdsService
;
...
...
@@ -189,6 +192,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if
(
update
(
experiment
,
Condition
.
create
().
in
(
"id"
,
ids
))){
soilExperimentOperationService
.
recordAllotInfo
(
ids
,
account
);
soilExperimentRecordService
.
record
(
ids
,
SoilExpStatusEnum
.
ALLOT
,
SoilExpStatusEnum
.
TEST
,
0
,
account
,
"试验项目分配给:"
+
user
);
lmsMsgService
.
sendMsg
(
"/soil/test/do_test"
,
"试验项目已分配请及时进行检测"
,
"新的试验检测工作"
,
account
,
Lists
.
newArrayList
(
userId
));
}
return
true
;
}
...
...
@@ -980,6 +985,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
@Override
public
Page
<
SoilExperimentVO
>
listExperimentProgress
(
Page
<
SoilExperimentVO
>
page
,
SoilExperimentVO
vo
)
{
return
page
.
setRecords
(
baseMapper
.
listExperimentProgress
(
page
,
vo
));
}
@Override
public
Page
<
SoilExperimentVO
>
pageBySampleIds
(
Page
<
SoilExperimentVO
>
page
,
Long
[]
sampleIds
,
SoilExperimentVO
vo
)
{
return
page
.
setRecords
(
initOriginalRecord
(
baseMapper
.
selectListBySampleIds
(
page
,
sampleIds
,
vo
)));
}
...
...
src/main/resources/application-dev.yml
View file @
51dc5098
...
...
@@ -25,11 +25,10 @@ spring:
health-check-interval
:
5s
# host: localhost
rabbitmq
:
host
:
12
1.36.130.208
host
:
12
4.70.150.247
port
:
5672
username
:
mqbase
password
:
mqb123#@$5
publisher-confirms
:
true
virtual-host
:
/
topic
:
push-msg
:
dev.topic.push.msg
...
...
@@ -39,6 +38,7 @@ spring:
report-make-msg
:
dev.topic.report.make.msg
soil-work-msg
:
dev.topic.soil.work.msg
### jobs
jobs
:
admin-address
:
http://api.dev.patzn.com:7000/print
...
...
src/main/resources/mapper/soil/SoilAloneSampleMapper.xml
View file @
51dc5098
...
...
@@ -2,4 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.soil.mapper.SoilAloneSampleMapper"
>
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.soil.vo.SoilAloneSampleVO"
>
SELECT
s.id,s.receiver,s.receive_time,s.project_name,s.project_leader,s.borehole_name,s.cases_num,s.registrant,s.regist_time,
o.storehouse,o.shelf_code,o.instock_time,o.keep_limit_time
FROM
soil_alone_sample s
JOIN soil_alone_in_out_stock o ON s.ID = o.alone_sample_id
WHERE s.deleted = 0
<if
test=
"vo.boreholeName"
>
AND s.borehole_name LIKE CONCAT('%',#{vo.boreholeName},'%')
</if>
<if
test=
"vo.storehouse"
>
AND o.storehouse LIKE CONCAT('%',#{vo.storehouse},'%')
</if>
</select>
</mapper>
src/main/resources/mapper/soil/SoilExperimentMapper.xml
View file @
51dc5098
...
...
@@ -93,6 +93,10 @@
GROUP BY t.short_name
</select>
<select
id=
"selectTestByExp"
resultType=
"com.patzn.cloud.service.soil.vo.SoilExperimentVO"
>
SELECT t.name FROM soil_experiment t
JOIN soil_sample s ON t.sample_id = s.id
...
...
@@ -180,6 +184,54 @@
</select>
<select
id=
"listExperimentProgress"
resultType=
"com.patzn.cloud.service.soil.vo.SoilExperimentVO"
>
SELECT
t.id,
t.NAME,
e.borehole_name,
s.sample_code,
s.sample_depth,
s.site_no ,
t.ctime,
t.uid,
o.alloter,
o.allot_time,
o.test_ender,
o.test_end_time,
o.checker,
o.check_time,
o.auditor,
o.audit_time
FROM
soil_experiment t
JOIN soil_sample s ON t.sample_id = s.id
JOIN soil_entrust e ON s.entrust_id = e.id
JOIN soil_experiment_operation o ON t.id = o.experiment_id
WHERE
t.deleted = 0
AND s.deleted = 0
AND e.deleted = 0
<if
test=
"null!=vo.sampleCode"
>
AND s.sample_code LIKE CONCAT('%',#{vo.sampleCode},'%')
</if>
<if
test=
"null!=vo.siteNo"
>
AND s.site_no LIKE CONCAT('%',#{vo.siteNo},'%')
</if>
<if
test=
"null!=vo.name"
>
AND t.name LIKE CONCAT('%',#{vo.name},'%')
</if>
<if
test=
"null!=vo.boreholeName"
>
AND e.borehole_name LIKE CONCAT('%',#{vo.boreholeName},'%')
</if>
</select>
<select
id=
"selectOriginalExpList"
resultType=
"com.patzn.cloud.service.soil.vo.SoilExperimentVO"
>
WITH o AS (
...
...
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