Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
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-hmhj
Commits
198a61ec
Commit
198a61ec
authored
Feb 08, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
土工平台修改
parent
26bebfcf
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
941 additions
and
9 deletions
+941
-9
CodeRuleCategoryController.java
...vice/lims/hmhj/controller/CodeRuleCategoryController.java
+86
-0
CodeRuleController.java
...loud/service/lims/hmhj/controller/CodeRuleController.java
+99
-0
CodeRuleRecordController.java
...ervice/lims/hmhj/controller/CodeRuleRecordController.java
+86
-0
ContractSampleAnnexController.java
...e/lims/hmhj/controller/ContractSampleAnnexController.java
+34
-0
ContractSampleController.java
...ervice/lims/hmhj/controller/ContractSampleController.java
+80
-6
QualificationController.java
...service/lims/hmhj/controller/QualificationController.java
+2
-2
CodeRuleCategoryMapper.java
...loud/service/lims/hmhj/mapper/CodeRuleCategoryMapper.java
+16
-0
CodeRuleMapper.java
.../patzn/cloud/service/lims/hmhj/mapper/CodeRuleMapper.java
+16
-0
CodeRuleRecordMapper.java
.../cloud/service/lims/hmhj/mapper/CodeRuleRecordMapper.java
+16
-0
ContractSampleMapper.java
.../cloud/service/lims/hmhj/mapper/ContractSampleMapper.java
+2
-1
ICodeRuleCategoryService.java
...d/service/lims/hmhj/service/ICodeRuleCategoryService.java
+20
-0
ICodeRuleRecordService.java
...oud/service/lims/hmhj/service/ICodeRuleRecordService.java
+23
-0
ICodeRuleService.java
...tzn/cloud/service/lims/hmhj/service/ICodeRuleService.java
+26
-0
IContractSampleAnnexService.java
...ervice/lims/hmhj/service/IContractSampleAnnexService.java
+13
-0
IContractSampleService.java
...oud/service/lims/hmhj/service/IContractSampleService.java
+2
-0
CodeRuleCategoryServiceImpl.java
...e/lims/hmhj/service/impl/CodeRuleCategoryServiceImpl.java
+35
-0
CodeRuleRecordServiceImpl.java
...ice/lims/hmhj/service/impl/CodeRuleRecordServiceImpl.java
+116
-0
CodeRuleServiceImpl.java
...d/service/lims/hmhj/service/impl/CodeRuleServiceImpl.java
+168
-0
ContractSampleAnnexServiceImpl.java
...ims/hmhj/service/impl/ContractSampleAnnexServiceImpl.java
+72
-0
ContractSampleServiceImpl.java
...ice/lims/hmhj/service/impl/ContractSampleServiceImpl.java
+14
-0
CodeRuleCategoryMapper.xml
src/main/resources/mapper/hmhj/CodeRuleCategoryMapper.xml
+5
-0
CodeRuleMapper.xml
src/main/resources/mapper/hmhj/CodeRuleMapper.xml
+5
-0
CodeRuleRecordMapper.xml
src/main/resources/mapper/hmhj/CodeRuleRecordMapper.xml
+5
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/CodeRuleCategoryController.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleCategory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleCategoryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* 编号规则分类表 前端控制器
*
* @author wwd
* @since 2021-02-08
*/
@Api
(
tags
=
"编号规则分类表"
)
@RestController
@RequestMapping
(
"/v1/rule_category"
)
public
class
CodeRuleCategoryController
extends
ServiceController
{
@Autowired
private
ICodeRuleCategoryService
codeRuleCategoryService
;
@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"
)
public
RestResult
<
Page
<
CodeRuleCategory
>>
getPage
(
CodeRuleCategory
codeRuleCategory
)
{
return
success
(
codeRuleCategoryService
.
page
(
getPage
(),
codeRuleCategory
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
CodeRuleCategory
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
codeRuleCategoryService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
CodeRuleCategory
codeRuleCategory
)
{
codeRuleCategory
.
setId
(
id
);
return
success
(
codeRuleCategoryService
.
updateById
(
codeRuleCategory
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
CodeRuleCategory
codeRuleCategory
)
{
return
success
(
codeRuleCategoryService
.
save
(
codeRuleCategory
));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
codeRuleCategoryService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/CodeRuleController.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.kisso.annotation.Action
;
import
com.baomidou.kisso.annotation.Login
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
import
com.patzn.cloud.service.lims.base.dto.CodeTypeDTO
;
import
com.patzn.cloud.service.lims.base.enums.CodeTypeEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* 编号规则 前端控制器
*
* @author wwd
* @since 2021-02-08
*/
@Api
(
tags
=
"编号规则"
)
@RestController
@RequestMapping
(
"/v1/rule"
)
public
class
CodeRuleController
extends
ServiceController
{
@Autowired
private
ICodeRuleService
codeRuleService
;
@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"
)
public
RestResult
<
Page
<
CodeRule
>>
getPage
(
CodeRule
codeRule
)
{
return
success
(
codeRuleService
.
page
(
getPage
(),
codeRule
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
CodeRule
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
codeRuleService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
CodeRule
codeRule
)
{
codeRule
.
setId
(
id
);
return
success
(
codeRuleService
.
updateById
(
codeRule
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
CodeRule
codeRule
)
{
return
success
(
codeRuleService
.
save
(
codeRule
));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
codeRuleService
.
removeByIds
(
ids
));
}
@ApiOperation
(
"正常的获取编号的方法"
)
@PostMapping
(
"/get_key"
)
@Login
(
action
=
Action
.
Skip
)
public
RestResult
<
String
>
getCodeKey
(
@RequestBody
CodeTypeDTO
dto
)
{
return
success
(
codeRuleService
.
getCodeKey
(
dto
));
}
@PostMapping
(
"/getKey"
)
public
RestResult
<
String
>
getKey
(
@RequestBody
CodeTypeDTO
dto
)
{
CodeTypeEnum
codeTypeEnum
=
dto
.
getCodeTypeEnum
();
return
success
(
codeRuleService
.
getKey
((
Integer
)
codeTypeEnum
.
getValue
(),
codeTypeEnum
.
getDisplay
(),
dto
.
getBaseEntity
()));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/CodeRuleRecordController.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleRecord
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleRecordService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.List
;
/**
* 编号规则记录 前端控制器
*
* @author wwd
* @since 2021-02-08
*/
@Api
(
tags
=
"编号规则记录"
)
@RestController
@RequestMapping
(
"/v1/rule_record"
)
public
class
CodeRuleRecordController
extends
ServiceController
{
@Autowired
private
ICodeRuleRecordService
codeRuleRecordService
;
@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"
)
public
RestResult
<
Page
<
CodeRuleRecord
>>
getPage
(
CodeRuleRecord
codeRuleRecord
)
{
return
success
(
codeRuleRecordService
.
page
(
getPage
(),
codeRuleRecord
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
CodeRuleRecord
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
codeRuleRecordService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
CodeRuleRecord
codeRuleRecord
)
{
codeRuleRecord
.
setId
(
id
);
return
success
(
codeRuleRecordService
.
updateById
(
codeRuleRecord
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
CodeRuleRecord
codeRuleRecord
)
{
return
success
(
codeRuleRecordService
.
save
(
codeRuleRecord
));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
codeRuleRecordService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/ContractSampleAnnexController.java
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.kisso.annotation.Action
;
import
com.baomidou.kisso.annotation.Login
;
import
com.patzn.cloud.service.hmhj.entity.ContractSampleAnnex
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
@@ -21,6 +23,8 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
java.util.List
;
...
...
@@ -83,4 +87,34 @@ public class ContractSampleAnnexController extends ServiceController {
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
contractSampleAnnexService
.
removeByIds
(
ids
));
}
@ApiOperation
(
value
=
"附件上传"
,
notes
=
"附件上传"
)
@PostMapping
(
"/upload/{contractSampleId}"
)
public
RestResult
<
Boolean
>
upload
(
@PathVariable
(
"contractSampleId"
)
Long
contractSampleId
,
MultipartFile
file
)
{
return
success
(
contractSampleAnnexService
.
upload
(
file
,
contractSampleId
));
}
@ApiOperation
(
value
=
"附件批量上传"
,
notes
=
"附件批量上传"
)
@PostMapping
(
"/upload_bath/{contractSampleId}"
)
public
RestResult
<
Boolean
>
uploadBath
(
@PathVariable
(
"contractSampleId"
)
Long
contractSampleId
,
MultipartHttpServletRequest
httpServletRequest
)
{
return
success
(
contractSampleAnnexService
.
uploadBath
(
httpServletRequest
,
contractSampleId
,
getAccount
()));
}
@ApiOperation
(
value
=
"下载附件"
,
notes
=
"下载指定附件"
)
@GetMapping
(
"/download/{id}"
)
public
void
downloadFile
(
@PathVariable
(
"id"
)
Long
id
)
{
contractSampleAnnexService
.
downloadFile
(
id
,
response
);
}
@ApiOperation
(
value
=
"预览图片"
,
notes
=
"预览图片"
)
@Login
(
action
=
Action
.
Skip
)
@GetMapping
(
"/view"
)
public
void
view
(
String
objectKey
)
{
contractSampleAnnexService
.
view
(
response
,
objectKey
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/ContractSampleController.java
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.patzn.cloud.service.hmhj.entity.ContractSample
;
import
com.patzn.cloud.service.hmhj.enums.ContractSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.vo.ContractSampleVO
;
...
...
@@ -12,21 +11,17 @@ import org.springframework.web.bind.annotation.PutMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 合同物资 前端控制器
*
...
...
@@ -41,6 +36,7 @@ public class ContractSampleController extends ServiceController {
@Autowired
private
IContractSampleService
contractSampleService
;
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -93,7 +89,29 @@ public class ContractSampleController extends ServiceController {
}
@ApiOperation
(
"储运登记分页列表"
)
@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_store_transport_his"
)
public
RestResult
<
Page
<
ContractSampleVO
>>
getPageStoreTransportHis
(
ContractSampleVO
contractSample
)
{
List
<
ContractSampleStatusEnum
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
ContractSampleStatusEnum
.
PRO_TEC_CHECK
);
statusList
.
add
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
statusList
.
add
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_ORg
);
contractSample
.
setStatusList
(
statusList
);
return
success
(
contractSampleService
.
pageVO
(
getPage
(),
contractSample
));
}
@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
),
...
...
@@ -107,6 +125,24 @@ public class ContractSampleController extends ServiceController {
}
@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_pro_tech_check_his"
)
public
RestResult
<
Page
<
ContractSampleVO
>>
getPageProTechHis
(
ContractSampleVO
contractSample
)
{
List
<
ContractSampleStatusEnum
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
statusList
.
add
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_ORg
);
contractSample
.
setStatusList
(
statusList
);
return
success
(
contractSampleService
.
pageVO
(
getPage
(),
contractSample
));
}
@ApiOperation
(
"验收任务登记登记分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -121,6 +157,22 @@ public class ContractSampleController extends ServiceController {
}
@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_check_accept_reg_his"
)
public
RestResult
<
Page
<
ContractSampleVO
>>
getPageCheckAcceptRegHis
(
ContractSampleVO
contractSample
)
{
List
<
ContractSampleStatusEnum
>
statusList
=
new
ArrayList
<>();
statusList
.
add
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_ORg
);
contractSample
.
setStatusList
(
statusList
);
return
success
(
contractSampleService
.
pageVO
(
getPage
(),
contractSample
));
}
@ApiOperation
(
"验收组织分页列表"
)
@ApiImplicitParams
({
...
...
@@ -137,6 +189,21 @@ public class ContractSampleController extends ServiceController {
@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_expert_review"
)
public
RestResult
<
Page
<
ContractSample
>>
getPageExpertReview
(
ContractSample
contractSample
)
{
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
EXPERT_REVIEW
);
return
success
(
contractSampleService
.
page
(
getPage
(),
contractSample
));
}
@ApiOperation
(
"根据ID查询列表分页列表"
)
@ApiImplicitParams
({
...
...
@@ -203,6 +270,13 @@ public class ContractSampleController extends ServiceController {
}
@ApiOperation
(
"验收组织提交至专家会审"
)
@PostMapping
(
"/submit_to_expert_review"
)
public
RestResult
<
Boolean
>
submitToExpertReviewFromOrg
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
contractSampleService
.
submitToExpertReviewFromOrg
(
ids
,
getAccount
()));
}
@ApiOperation
(
"提交至生技部审核"
)
@PostMapping
(
"/submit_to_pro_tech_check"
)
public
RestResult
<
Boolean
>
submitToProTechCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/QualificationController.java
View file @
198a61ec
...
...
@@ -25,12 +25,12 @@ import io.swagger.annotations.ApiOperation;
import
java.util.List
;
/**
*
${table.comment}
前端控制器
*
资质项目表
前端控制器
*
* @author wwd
* @since 2021-02-03
*/
@Api
(
tags
=
"
${table.comment}
"
)
@Api
(
tags
=
"
资质项目表
"
)
@RestController
@RequestMapping
(
"/v1/qualification"
)
public
class
QualificationController
extends
ServiceController
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/CodeRuleCategoryMapper.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleCategory
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
/**
* <p>
* 编号规则分类表 Mapper 接口
* </p>
*
* @author wwd
* @since 2021-02-08
*/
public
interface
CodeRuleCategoryMapper
extends
BatchMapper
<
CodeRuleCategory
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/CodeRuleMapper.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
/**
* <p>
* 编号规则 Mapper 接口
* </p>
*
* @author wwd
* @since 2021-02-08
*/
public
interface
CodeRuleMapper
extends
BatchMapper
<
CodeRule
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/CodeRuleRecordMapper.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleRecord
;
/**
* <p>
* 编号规则记录 Mapper 接口
* </p>
*
* @author wwd
* @since 2021-02-08
*/
public
interface
CodeRuleRecordMapper
extends
BatchMapper
<
CodeRuleRecord
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/ContractSampleMapper.java
View file @
198a61ec
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.plugins.Page;
import
com.patzn.cloud.service.hmhj.entity.ContractSample
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.vo.ContractSampleVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
java.util.List
;
...
...
@@ -18,5 +19,5 @@ import java.util.List;
*/
public
interface
ContractSampleMapper
extends
BatchMapper
<
ContractSample
>
{
List
<
ContractSampleVO
>
selectVOList
(
RowBounds
rowBounds
,
ContractSampleVO
contractSample
);
List
<
ContractSampleVO
>
selectVOList
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
ContractSampleVO
contractSample
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ICodeRuleCategoryService.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleCategory
;
import
java.util.List
;
/**
* 编号规则分类表 服务类
*
* @author wwd
* @since 2021-02-08
*/
public
interface
ICodeRuleCategoryService
extends
IBaseService
<
CodeRuleCategory
>
{
Page
<
CodeRuleCategory
>
page
(
Page
<
CodeRuleCategory
>
page
,
CodeRuleCategory
codeRuleCategory
);
boolean
removeByIds
(
List
<
Long
>
ids
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ICodeRuleRecordService.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleRecord
;
import
java.util.List
;
/**
* 编号规则记录 服务类
*
* @author wwd
* @since 2021-02-08
*/
public
interface
ICodeRuleRecordService
extends
IBaseService
<
CodeRuleRecord
>
{
Page
<
CodeRuleRecord
>
page
(
Page
<
CodeRuleRecord
>
page
,
CodeRuleRecord
codeRuleRecord
);
boolean
removeByIds
(
List
<
Long
>
ids
);
int
getNextSn
(
CodeRule
codeRule
,
String
vary
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ICodeRuleService.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.BaseEntity
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
import
com.patzn.cloud.service.lims.base.dto.CodeTypeDTO
;
import
java.util.List
;
/**
* 编号规则 服务类
*
* @author wwd
* @since 2021-02-08
*/
public
interface
ICodeRuleService
extends
IBaseService
<
CodeRule
>
{
Page
<
CodeRule
>
page
(
Page
<
CodeRule
>
page
,
CodeRule
codeRule
);
boolean
removeByIds
(
List
<
Long
>
ids
);
String
getCodeKey
(
CodeTypeDTO
dto
);
String
getKey
(
Integer
codeType
,
String
codeName
,
BaseEntity
entity
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IContractSampleAnnexService.java
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.ContractSampleAnnex
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -17,4 +21,13 @@ public interface IContractSampleAnnexService extends IBaseService<ContractSample
Page
<
ContractSampleAnnex
>
page
(
Page
<
ContractSampleAnnex
>
page
,
ContractSampleAnnex
contractSampleAnnex
);
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
upload
(
MultipartFile
file
,
Long
contractSampleId
);
void
downloadFile
(
Long
id
,
HttpServletResponse
response
);
void
view
(
HttpServletResponse
response
,
String
objectKey
);
boolean
uploadBath
(
MultipartHttpServletRequest
httpServletRequest
,
Long
contractSampleId
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IContractSampleService.java
View file @
198a61ec
...
...
@@ -32,5 +32,7 @@ public interface IContractSampleService extends IBaseService<ContractSample> {
boolean
submitToCheckAcceptOrg
(
Long
[]
ids
,
Account
account
);
boolean
submitToExpertReviewFromOrg
(
Long
[]
ids
,
Account
account
);
Page
<
ContractSampleVO
>
pageVO
(
Page
<
ContractSampleVO
>
page
,
ContractSampleVO
contractSample
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/CodeRuleCategoryServiceImpl.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleCategory
;
import
com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleCategoryMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleCategoryService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
java.util.List
;
/**
* 编号规则分类表 服务实现类
*
* @author wwd
* @since 2021-02-08
*/
@Service
public
class
CodeRuleCategoryServiceImpl
extends
BaseServiceImpl
<
CodeRuleCategoryMapper
,
CodeRuleCategory
>
implements
ICodeRuleCategoryService
{
@Override
public
Page
<
CodeRuleCategory
>
page
(
Page
<
CodeRuleCategory
>
page
,
CodeRuleCategory
codeRuleCategory
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
codeRuleCategory
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/CodeRuleRecordServiceImpl.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
import
com.patzn.cloud.service.hmhj.entity.CodeRuleRecord
;
import
com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleRecordMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleRecordService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
java.util.List
;
/**
* 编号规则记录 服务实现类
*
* @author wwd
* @since 2021-02-08
*/
@Service
public
class
CodeRuleRecordServiceImpl
extends
BaseServiceImpl
<
CodeRuleRecordMapper
,
CodeRuleRecord
>
implements
ICodeRuleRecordService
{
@Override
public
Page
<
CodeRuleRecord
>
page
(
Page
<
CodeRuleRecord
>
page
,
CodeRuleRecord
codeRuleRecord
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
codeRuleRecord
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
int
getNextSn
(
CodeRule
codeRule
,
String
vary
)
{
Long
codeRuleId
=
codeRule
.
getId
();
CodeRuleRecord
codeRuleRecord
=
null
;
if
(
StringUtils
.
isBlank
(
codeRule
.
getIgnoreNum
()))
{
//codeRuleRecord = baseMapper.selectOne(new LmsCodeRuleRecord().setCodeRuleId(codeRuleId).setVary(vary));
codeRuleRecord
=
getOne
(
Condition
.
create
().
eq
(
"code_rule_id"
,
codeRuleId
).
eq
(
"vary"
,
vary
).
last
(
"limit 1"
));
}
else
{
try
{
String
ignoreNum
=
codeRule
.
getIgnoreNum
();
String
[]
ignores
=
ignoreNum
.
split
(
","
);
for
(
String
i
:
ignores
)
{
vary
=
deleteIndexChar
(
vary
,
Integer
.
parseInt
(
i
));
}
//codeRuleRecord = baseMapper.selectOne(new LmsCodeRuleRecord().setCodeRuleId(codeRuleId).setVary(vary));
codeRuleRecord
=
getOne
(
Condition
.
create
().
eq
(
"code_rule_id"
,
codeRuleId
).
eq
(
"vary"
,
vary
).
last
(
"limit 1"
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"生成编号失败:原因"
+
e
.
getMessage
(),
e
);
RestAssert
.
fail
(
"编号生成失败,请联系管理员"
);
}
}
if
(
null
==
codeRuleRecord
)
{
CodeRuleRecord
crr
=
new
CodeRuleRecord
();
crr
.
setCodeRuleId
(
codeRuleId
);
crr
.
setSn
(
1
);
crr
.
setVary
(
vary
);
if
(
super
.
save
(
crr
))
{
return
1
;
}
}
// 获取下一个序列号
return
this
.
nextSn
(
codeRuleRecord
.
getId
(),
codeRuleRecord
.
getSn
());
}
/**
* <p>
* 下一个 SN
* </p>
*
* @param id 主键 ID
* @param sn 序列号
* @return
*/
private
int
nextSn
(
long
id
,
int
sn
)
{
int
next
=
sn
+
1
;
CodeRuleRecord
crr
=
new
CodeRuleRecord
();
crr
.
setSn
(
next
);
if
(!
super
.
update
(
crr
,
Condition
.
create
().
eq
(
"id"
,
id
).
eq
(
"sn"
,
sn
)))
{
// 重复递归寻找可用序列
next
=
this
.
nextSn
(
id
,
next
);
}
return
next
;
}
public
static
String
deleteIndexChar
(
String
str
,
int
index
)
{
if
(
StringUtils
.
isBlank
(
str
))
{
return
str
;
}
StringBuilder
sb
=
new
StringBuilder
();
int
length
=
str
.
length
();
for
(
int
j
=
0
;
j
<
length
;
j
++)
{
if
(
j
!=
index
)
{
sb
.
append
(
str
.
charAt
(
j
));
}
}
return
sb
.
toString
();
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/CodeRuleServiceImpl.java
0 → 100644
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.constant.CommonConstants
;
import
com.patzn.cloud.commons.toolkit.CodeKeyUtils
;
import
com.patzn.cloud.commons.toolkit.FreemarkerUtils
;
import
com.patzn.cloud.commons.toolkit.JacksonUtils
;
import
com.patzn.cloud.feign.lims.base.client.LmsBaseDictClient
;
import
com.patzn.cloud.service.BaseEntity
;
import
com.patzn.cloud.service.CodeRuleHelper
;
import
com.patzn.cloud.service.hmhj.entity.CodeRule
;
import
com.patzn.cloud.service.lims.base.dto.CodeTypeDTO
;
import
com.patzn.cloud.service.lims.base.entity.LmsBaseDict
;
import
com.patzn.cloud.service.lims.base.entity.LmsCodeRule
;
import
com.patzn.cloud.service.lims.common.StringHandleUtils
;
import
com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleRecordService
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
org.joda.time.DateTime
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 编号规则 服务实现类
*
* @author wwd
* @since 2021-02-08
*/
@Service
public
class
CodeRuleServiceImpl
extends
BaseServiceImpl
<
CodeRuleMapper
,
CodeRule
>
implements
ICodeRuleService
{
@Autowired
private
LmsBaseDictClient
lmsBaseDictClient
;
@Autowired
private
ICodeRuleRecordService
codeRuleRecordService
;
@Override
public
Page
<
CodeRule
>
page
(
Page
<
CodeRule
>
page
,
CodeRule
codeRule
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
codeRule
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
String
getCodeKey
(
CodeTypeDTO
dto
)
{
return
CodeRuleHelper
.
getKey
(
dto
.
getCodeTypeEnum
(),
dto
.
getBaseEntity
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
String
getKey
(
Integer
codeType
,
String
codeName
,
BaseEntity
entity
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"codeType:{} , codeName:{} , entity:{}"
,
codeType
,
codeName
,
JacksonUtils
.
toJSONString
(
entity
));
}
CodeRule
codeRule
=
super
.
getOne
(
Condition
.
create
().
eq
(
"type"
,
codeType
).
last
(
"LIMIT 1"
));
if
(
null
==
codeRule
)
{
RestAssert
.
fail
(
codeName
+
"不存在请配置规则"
);
}
StringBuilder
key
=
new
StringBuilder
();
// 前缀规则
if
(
null
!=
codeRule
.
getPre
())
{
key
.
append
(
codeRule
.
getPre
());
}
String
[]
rules
=
codeRule
.
getRule
().
split
(
"&"
);
Map
<
String
,
Object
>
model
=
new
HashMap
<>(
2
);
model
.
put
(
"et"
,
entity
);
model
.
put
(
"kt"
,
new
CodeKeyUtils
());
for
(
String
rule
:
rules
)
{
// 日期规则
if
(
rule
.
contains
(
"@"
))
{
if
(
"@YY"
.
equalsIgnoreCase
(
rule
))
{
key
.
append
(
new
DateTime
().
toString
(
"YYYY"
).
substring
(
2
));
}
else
{
key
.
append
(
new
DateTime
().
toString
(
rule
.
substring
(
1
)));
}
}
else
if
(
rule
.
contains
(
"%"
))
{
String
value
;
String
myRules
=
rule
.
replace
(
"%"
,
""
).
replace
(
"{"
,
""
).
replace
(
"}"
,
""
);
String
[]
dictArr
=
myRules
.
split
(
"\\."
);
if
(
null
!=
dictArr
[
1
])
{
value
=
StringHandleUtils
.
getFieldValueByFieldName
(
dictArr
[
1
],
model
.
get
(
"et"
));
key
.
append
(
value
);
}
}
// 字典规则【 分类?属性 】 监测类别?${et.testType}
else
if
(
rule
.
contains
(
"?"
))
{
try
{
String
[]
dictArr
=
rule
.
split
(
"\\?"
);
String
value
=
""
;
if
(
null
!=
dictArr
[
1
]
&&
dictArr
[
1
].
contains
(
"$"
))
{
String
attributes
=
StringHandleUtils
.
getAttributesFromCodeRules
(
dictArr
[
1
]);
value
=
StringHandleUtils
.
getFieldValueByFieldName
(
attributes
,
model
.
get
(
"et"
));
}
if
(!
""
.
equalsIgnoreCase
(
value
))
{
LmsBaseDict
baseDict
=
new
LmsBaseDict
();
baseDict
.
setType
(
dictArr
[
0
]);
baseDict
.
setName
(
FreemarkerUtils
.
process
(
dictArr
[
1
],
model
));
LmsBaseDict
dict
=
lmsBaseDictClient
.
getDictByNameType
(
baseDict
).
serviceData
();
if
(
null
!=
dict
){
key
.
append
(
dict
.
getCode
());
}
}
}
catch
(
Exception
e
)
{
RestAssert
.
fail
(
"编号生成异常,请联系管理员"
);
}
}
// 属性规则
else
if
(
rule
.
contains
(
"$"
))
{
try
{
key
.
append
(
FreemarkerUtils
.
process
(
rule
,
model
));
}
catch
(
Exception
e
)
{
RestAssert
.
fail
(
"编号生成异常,请联系管理员"
);
}
}
// SN 序列号
else
if
(
"SN"
.
equals
(
rule
))
{
key
.
append
(
CommonConstants
.
SN
);
}
// 原样输出
else
{
key
.
append
(
rule
);
}
}
// SN 规则
String
sn
=
""
;
if
(
null
==
codeRule
.
getContinueSn
()
||
0
==
codeRule
.
getContinueSn
())
{
sn
=
CodeKeyUtils
.
getSn
(
codeRuleRecordService
.
getNextSn
(
codeRule
,
key
.
toString
()),
codeRule
.
getLength
());
}
else
{
sn
=
CodeKeyUtils
.
getSn
(
codeRule
.
getSn
()
+
1
,
codeRule
.
getLength
());
}
// 更新规则序列号
nextSn
(
codeRule
.
getId
(),
codeRule
.
getSn
());
return
key
.
toString
().
replaceAll
(
CommonConstants
.
SN
,
sn
);
}
private
int
nextSn
(
long
id
,
int
sn
)
{
int
next
=
sn
+
1
;
CodeRule
cr
=
new
CodeRule
();
cr
.
setSn
(
next
);
if
(!
super
.
update
(
cr
,
Condition
.
create
().
eq
(
"id"
,
id
).
eq
(
"sn"
,
sn
)))
{
// 重复递归寻找可用序列
next
=
nextSn
(
id
,
next
);
}
return
next
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleAnnexServiceImpl.java
View file @
198a61ec
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.hmhj.entity.ContractSampleAnnex
;
import
com.patzn.cloud.service.lims.hmhj.mapper.ContractSampleAnnexMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleAnnexService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleService
;
import
com.patzn.cloud.service.soil.entity.SoilAloneSampleAnnex
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
/**
...
...
@@ -21,6 +35,12 @@ import java.util.List;
@Service
public
class
ContractSampleAnnexServiceImpl
extends
BaseServiceImpl
<
ContractSampleAnnexMapper
,
ContractSampleAnnex
>
implements
IContractSampleAnnexService
{
@Autowired
private
OssClient
ossClient
;
@Autowired
private
IContractSampleService
contractSampleService
;
@Override
public
Page
<
ContractSampleAnnex
>
page
(
Page
<
ContractSampleAnnex
>
page
,
ContractSampleAnnex
contractSampleAnnex
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
contractSampleAnnex
);
...
...
@@ -32,4 +52,56 @@ public class ContractSampleAnnexServiceImpl extends BaseServiceImpl<ContractSamp
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
upload
(
MultipartFile
file
,
Long
contractSampleId
)
{
RestAssert
.
fail
(
null
==
contractSampleId
,
"请选择样品"
);
String
fileName
=
file
.
getOriginalFilename
();
RestAssert
.
fail
(
StringUtils
.
isBlank
(
fileName
),
"请上传文件"
);
if
(
null
==
contractSampleService
.
getById
(
contractSampleId
)){
RestAssert
.
fail
(
"样品不存在"
);
}
OssFileResult
result
=
ossClient
.
upload
(
file
);
if
(
null
==
result
)
{
return
false
;
}
ContractSampleAnnex
sampleAnnex
=
new
ContractSampleAnnex
();
sampleAnnex
.
setType
(
result
.
getType
());
sampleAnnex
.
setFileName
(
result
.
getName
());
sampleAnnex
.
setObjectKey
(
result
.
getObjectKey
());
sampleAnnex
.
setContractSampleId
(
contractSampleId
);
return
save
(
sampleAnnex
);
}
@Override
public
void
downloadFile
(
Long
id
,
HttpServletResponse
response
)
{
ContractSampleAnnex
attachment
=
super
.
getById
(
id
);
if
(
null
==
attachment
)
{
RestAssert
.
fail
(
"抱歉!该照片不存在"
);
}
ossClient
.
download
(
attachment
.
getObjectKey
(),
attachment
.
getFileName
()
+
"."
+
attachment
.
getType
(),
response
);
}
@Override
public
void
view
(
HttpServletResponse
response
,
String
objectKey
)
{
ossClient
.
download
(
objectKey
,
response
);
}
@Override
public
boolean
uploadBath
(
MultipartHttpServletRequest
multipartHttpServletRequest
,
Long
contractSampleId
,
Account
account
)
{
// 先拿到文件名称的迭代器
Iterator
<
String
>
fileNamesIt
=
multipartHttpServletRequest
.
getFileNames
();
List
<
String
>
failedNameList
=
new
ArrayList
<>();
while
(
fileNamesIt
.
hasNext
())
{
String
fileName
=
fileNamesIt
.
next
();
// 获取文件
MultipartFile
multipartFile
=
multipartHttpServletRequest
.
getFile
(
fileName
);
upload
(
multipartFile
,
contractSampleId
);
failedNameList
.
add
(
fileName
);
}
return
true
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleServiceImpl.java
View file @
198a61ec
...
...
@@ -122,6 +122,20 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
submitToExpertReviewFromOrg
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
ContractSample
contractSample
=
new
ContractSample
();
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
EXPERT_REVIEW
);
contractSample
.
setProgress
(
ContractSampleStatusEnum
.
EXPERT_REVIEW
);
contractSampleRecordService
.
record
(
ids
,
ContractSampleStatusEnum
.
CHECK_ACCEPT_ORg
,
ContractSampleStatusEnum
.
EXPERT_REVIEW
,
0
,
"验收组织提交至专家会审"
,
account
);
lmsMsgService
.
sendMsg
(
"/hmhj/accept_manage/expert_audit"
,
"验收组织提交至专家会审,请及时处理"
,
"新的专家会审任务!"
,
account
,
null
);
return
super
.
update
(
contractSample
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
@Override
public
Page
<
ContractSampleVO
>
pageVO
(
Page
<
ContractSampleVO
>
page
,
ContractSampleVO
contractSample
)
{
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
contractSample
));
...
...
src/main/resources/mapper/hmhj/CodeRuleCategoryMapper.xml
0 → 100644
View file @
198a61ec
<?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=
"com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleCategoryMapper"
>
</mapper>
src/main/resources/mapper/hmhj/CodeRuleMapper.xml
0 → 100644
View file @
198a61ec
<?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=
"com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleMapper"
>
</mapper>
src/main/resources/mapper/hmhj/CodeRuleRecordMapper.xml
0 → 100644
View file @
198a61ec
<?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=
"com.patzn.cloud.service.lims.hmhj.mapper.CodeRuleRecordMapper"
>
</mapper>
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