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
18f5a84e
Commit
18f5a84e
authored
Oct 13, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出委托单示例
parent
98189e15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
0 deletions
+128
-0
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+27
-0
entrust.ftl
cement-business/src/main/resources/templates/entrust.ftl
+101
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
18f5a84e
...
@@ -3,18 +3,23 @@ package cn.wise.sc.cement.business.controller;
...
@@ -3,18 +3,23 @@ package cn.wise.sc.cement.business.controller;
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.ReportDetailVo
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.util.WordUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -26,6 +31,7 @@ import java.util.Map;
...
@@ -26,6 +31,7 @@ import java.util.Map;
* @since 2020-08-24
* @since 2020-08-24
*/
*/
@Api
(
tags
=
"委托管理"
)
@Api
(
tags
=
"委托管理"
)
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/business/entrust"
)
@RequestMapping
(
"/business/entrust"
)
public
class
EntrustController
{
public
class
EntrustController
{
...
@@ -107,6 +113,27 @@ public class EntrustController {
...
@@ -107,6 +113,27 @@ public class EntrustController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@GetMapping
(
"/export/{entrustId}"
)
@ApiOperation
(
"导出委托单"
)
public
void
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
HttpServletResponse
response
)
{
// ReportDetailVo rts = iEntrustService.getReportDetail(entrustId);
EntrustVo
entrustVo
=
entrustService
.
getDtail
(
entrustId
).
getData
();
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
7
);
beanParams
.
put
(
"clientName"
,
entrustVo
.
getClientName
());
beanParams
.
put
(
"entrustCode"
,
entrustVo
.
getEntrustCode
());
beanParams
.
put
(
"userName"
,
entrustVo
.
getUserName
());
beanParams
.
put
(
"userPhone"
,
entrustVo
.
getUserPhone
());
beanParams
.
put
(
"userFax"
,
entrustVo
.
getUserFax
());
beanParams
.
put
(
"projectName"
,
entrustVo
.
getProjectName
());
beanParams
.
put
(
"sampleNum"
,
entrustVo
.
getSampleNum
());
WordUtil
.
writeWordReport
(
entrustVo
.
getProjectName
()
+
"(委托单)"
,
"entrust.ftl"
,
beanParams
,
response
);
}
@ApiOperation
(
value
=
"获取样品表里最大的本所编号"
)
@ApiOperation
(
value
=
"获取样品表里最大的本所编号"
)
@GetMapping
(
"/getMaxCementCode"
)
@GetMapping
(
"/getMaxCementCode"
)
public
BaseResponse
getMaxCementCode
(){
public
BaseResponse
getMaxCementCode
(){
...
...
cement-business/src/main/resources/templates/entrust.ftl
0 → 100644
View file @
18f5a84e
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook
xmlns=
"urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o=
"urn:schemas-microsoft-com:office:office"
xmlns:x=
"urn:schemas-microsoft-com:office:excel"
xmlns:ss=
"urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html=
"http://www.w3.org/TR/REC-html40"
>
<DocumentProperties
xmlns=
"urn:schemas-microsoft-com:office:office"
>
<Version>
16.00
</Version>
</DocumentProperties>
<OfficeDocumentSettings
xmlns=
"urn:schemas-microsoft-com:office:office"
>
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook
xmlns=
"urn:schemas-microsoft-com:office:excel"
>
<WindowHeight>
12650
</WindowHeight>
<WindowWidth>
22260
</WindowWidth>
<WindowTopX>
32767
</WindowTopX>
<WindowTopY>
32767
</WindowTopY>
<ProtectStructure>
False
</ProtectStructure>
<ProtectWindows>
False
</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style
ss:ID=
"Default"
ss:Name=
"Normal"
>
<Alignment
ss:Vertical=
"Bottom"
/>
<Borders/>
<Font
ss:FontName=
"等线"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style
ss:ID=
"s63"
>
<Alignment
ss:Horizontal=
"Center"
ss:Vertical=
"Bottom"
/>
<Font
ss:FontName=
"等线"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
ss:Bold=
"1"
/>
</Style>
<Style
ss:ID=
"s64"
>
<Font
ss:FontName=
"等线"
x:CharSet=
"134"
ss:Size=
"11"
ss:Color=
"#000000"
/>
</Style>
</Styles>
<Worksheet
ss:Name=
"Sheet1"
>
<Table
ss:ExpandedColumnCount=
"2"
ss:ExpandedRowCount=
"8"
x:FullColumns=
"1"
x:FullRows=
"1"
ss:DefaultColumnWidth=
"52"
ss:DefaultRowHeight=
"14"
>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"116.5"
/>
<Column
ss:AutoFitWidth=
"0"
ss:Width=
"117"
/>
<Row>
<Cell
ss:MergeAcross=
"1"
ss:StyleID=
"s63"
><Data
ss:Type=
"String"
>
中国水泥发展中心物化检测所检测委托单
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
委托单位
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${clientName}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
委托编号
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${entrustCode}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
委托人
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${userName}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
电话
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${userPhone}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
传真
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${userFax}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
项目名称
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${projectName}
</Data></Cell>
</Row>
<Row>
<Cell><Data
ss:Type=
"String"
>
样品数量
</Data></Cell>
<Cell
ss:StyleID=
"s64"
><Data
ss:Type=
"String"
>
${sampleNum}
</Data></Cell>
</Row>
</Table>
<WorksheetOptions
xmlns=
"urn:schemas-microsoft-com:office:excel"
>
<PageSetup>
<Header
x:Margin=
"0.3"
/>
<Footer
x:Margin=
"0.3"
/>
<PageMargins
x:Bottom=
"0.75"
x:Left=
"0.7"
x:Right=
"0.7"
x:Top=
"0.75"
/>
</PageSetup>
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>
9
</PaperSizeIndex>
<HorizontalResolution>
600
</HorizontalResolution>
<VerticalResolution>
600
</VerticalResolution>
</Print>
<Selected/>
<Panes>
<Pane>
<Number>
3
</Number>
<ActiveRow>
9
</ActiveRow>
<ActiveCol>
4
</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>
False
</ProtectObjects>
<ProtectScenarios>
False
</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
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