Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
bfe18a88
Commit
bfe18a88
authored
Sep 29, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计划管理 后台接口完成
parent
8ab88823
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
1921 additions
and
99 deletions
+1921
-99
PlanConsumablesPurchaseController.java
...usiness/controller/PlanConsumablesPurchaseController.java
+89
-3
PlanEquipmentMaintainController.java
.../business/controller/PlanEquipmentMaintainController.java
+101
-3
PlanEquipmentPurchaseController.java
.../business/controller/PlanEquipmentPurchaseController.java
+27
-33
PlanEquipmentRepairController.java
...nt/business/controller/PlanEquipmentRepairController.java
+89
-3
PlanStandardPurchaseController.java
...t/business/controller/PlanStandardPurchaseController.java
+92
-3
SysRoleController.java
...wise/sc/cement/business/controller/SysRoleController.java
+0
-34
PlanConsumablesPurchase.java
...se/sc/cement/business/entity/PlanConsumablesPurchase.java
+3
-0
PlanEquipmentMaintain.java
...wise/sc/cement/business/entity/PlanEquipmentMaintain.java
+6
-3
PlanEquipmentPurchase.java
...wise/sc/cement/business/entity/PlanEquipmentPurchase.java
+1
-1
PlanEquipmentRepair.java
...n/wise/sc/cement/business/entity/PlanEquipmentRepair.java
+5
-2
PlanStandardPurchase.java
.../wise/sc/cement/business/entity/PlanStandardPurchase.java
+4
-0
PlanConsumablesPurchaseMapper.java
...cement/business/mapper/PlanConsumablesPurchaseMapper.java
+11
-0
PlanEquipmentMaintainMapper.java
...c/cement/business/mapper/PlanEquipmentMaintainMapper.java
+12
-0
PlanEquipmentPurchaseMapper.java
...c/cement/business/mapper/PlanEquipmentPurchaseMapper.java
+1
-0
PlanEquipmentRepairMapper.java
.../sc/cement/business/mapper/PlanEquipmentRepairMapper.java
+11
-0
PlanStandardPurchaseMapper.java
...sc/cement/business/mapper/PlanStandardPurchaseMapper.java
+11
-0
PlanConsumablesPurchaseMapper.xml
...ent/business/mapper/xml/PlanConsumablesPurchaseMapper.xml
+27
-0
PlanEquipmentMaintainMapper.xml
...ement/business/mapper/xml/PlanEquipmentMaintainMapper.xml
+27
-0
PlanEquipmentPurchaseMapper.xml
...ement/business/mapper/xml/PlanEquipmentPurchaseMapper.xml
+10
-0
PlanEquipmentRepairMapper.xml
.../cement/business/mapper/xml/PlanEquipmentRepairMapper.xml
+28
-0
PlanStandardPurchaseMapper.xml
...cement/business/mapper/xml/PlanStandardPurchaseMapper.xml
+27
-0
PlanConsumablesPurchaseQuery.java
...nt/business/model/query/PlanConsumablesPurchaseQuery.java
+52
-0
PlanEquipmentMaintainQuery.java
...ment/business/model/query/PlanEquipmentMaintainQuery.java
+57
-0
PlanEquipmentPurchaseQuery.java
...ment/business/model/query/PlanEquipmentPurchaseQuery.java
+51
-0
PlanEquipmentRepairQuery.java
...cement/business/model/query/PlanEquipmentRepairQuery.java
+47
-0
PlanStandardPurchaseQuery.java
...ement/business/model/query/PlanStandardPurchaseQuery.java
+49
-0
TeamQuery.java
...ava/cn/wise/sc/cement/business/model/query/TeamQuery.java
+2
-0
PlanConsumablesPurchaseVo.java
...c/cement/business/model/vo/PlanConsumablesPurchaseVo.java
+67
-0
PlanEquipmentMaintainVo.java
.../sc/cement/business/model/vo/PlanEquipmentMaintainVo.java
+72
-0
PlanEquipmentRepairVo.java
...se/sc/cement/business/model/vo/PlanEquipmentRepairVo.java
+63
-0
PlanStandardPurchaseVo.java
...e/sc/cement/business/model/vo/PlanStandardPurchaseVo.java
+64
-0
IPlanConsumablesPurchaseService.java
...ent/business/service/IPlanConsumablesPurchaseService.java
+18
-0
IPlanEquipmentMaintainService.java
...ement/business/service/IPlanEquipmentMaintainService.java
+20
-0
IPlanEquipmentPurchaseService.java
...ement/business/service/IPlanEquipmentPurchaseService.java
+11
-0
IPlanEquipmentRepairService.java
.../cement/business/service/IPlanEquipmentRepairService.java
+19
-0
IPlanStandardPurchaseService.java
...cement/business/service/IPlanStandardPurchaseService.java
+22
-0
ISysRoleService.java
...a/cn/wise/sc/cement/business/service/ISysRoleService.java
+1
-1
PlanConsumablesPurchaseServiceImpl.java
...ness/service/impl/PlanConsumablesPurchaseServiceImpl.java
+149
-0
PlanEquipmentMaintainServiceImpl.java
...siness/service/impl/PlanEquipmentMaintainServiceImpl.java
+153
-0
PlanEquipmentPurchaseServiceImpl.java
...siness/service/impl/PlanEquipmentPurchaseServiceImpl.java
+120
-12
PlanEquipmentRepairServiceImpl.java
...business/service/impl/PlanEquipmentRepairServiceImpl.java
+151
-0
PlanStandardPurchaseServiceImpl.java
...usiness/service/impl/PlanStandardPurchaseServiceImpl.java
+150
-0
SysRoleServiceImpl.java
...e/sc/cement/business/service/impl/SysRoleServiceImpl.java
+1
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanConsumablesPurchaseController.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanConsumablesPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanStandardPurchaseQuery
;
import
cn.wise.sc.cement.business.service.IPlanConsumablesPurchaseService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
...
...
@@ -13,9 +23,85 @@ import org.springframework.web.bind.annotation.RestController;
* @author ztw
* @since 2020-09-28
*/
@Api
(
tags
=
"计划管理-消耗品采购计划"
)
@RestController
@RequestMapping
(
"/business/plan-consumables-purchase"
)
public
class
PlanConsumablesPurchaseController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanConsumablesPurchaseController"
);
@Autowired
private
IPlanConsumablesPurchaseService
consumablesPurchaseService
;
@ApiOperation
(
value
=
"消耗品采购计划分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"产品名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
)
{
try
{
return
consumablesPurchaseService
.
getPage
(
pageQuery
,
name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"消耗品采购计划分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增消耗品采购计划"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
PlanConsumablesPurchaseQuery
query
){
try
{
return
consumablesPurchaseService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增消耗品采购计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新消耗品采购计划"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
PlanConsumablesPurchaseQuery
query
){
try
{
return
consumablesPurchaseService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新消耗品采购计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"消耗品采购计划详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getDetail
(
@PathVariable
Integer
id
){
try
{
return
consumablesPurchaseService
.
getDetail
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"消耗品采购计划详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"采购完成"
)
@PostMapping
(
"/finish"
)
public
BaseResponse
finish
(
Integer
id
){
try
{
return
consumablesPurchaseService
.
finish
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"采购完成{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
consumablesPurchaseService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanEquipmentMaintainController.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentMaintainQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentMaintainService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
...
...
@@ -13,9 +23,97 @@ import org.springframework.web.bind.annotation.RestController;
* @author ztw
* @since 2020-09-28
*/
@Api
(
tags
=
"计划管理-设备维护计划"
)
@RestController
@RequestMapping
(
"/business/plan-equipment-maintain"
)
public
class
PlanEquipmentMaintainController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanEquipmentMaintainController"
);
@Autowired
private
IPlanEquipmentMaintainService
equipmentMaintainService
;
@ApiOperation
(
value
=
"设备维护计划分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"产品名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
)
{
try
{
return
equipmentMaintainService
.
getPage
(
pageQuery
,
name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"设备维护计划分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增设设备维护计划分页列表"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
PlanEquipmentMaintainQuery
query
){
try
{
return
equipmentMaintainService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增设备维护计划分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新设备维护计划"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
PlanEquipmentMaintainQuery
query
){
try
{
return
equipmentMaintainService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新设备维护计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"设备维护计划详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getDetail
(
@PathVariable
Integer
id
){
try
{
return
equipmentMaintainService
.
getDetail
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"设备维护计划详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"维护完成"
)
@PostMapping
(
"/finish"
)
public
BaseResponse
finish
(
Integer
id
){
try
{
return
equipmentMaintainService
.
finish
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"维护完成{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
equipmentMaintainService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanEquipmentPurchaseController.java
View file @
bfe18a88
...
...
@@ -3,6 +3,7 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentPurchaseService
;
import
io.swagger.annotations.Api
;
...
...
@@ -45,68 +46,61 @@ public class PlanEquipmentPurchaseController {
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
/*
@ApiOperation(value = "新增
检测项
")
@ApiOperation
(
value
=
"新增
设备采购计划
"
)
@PostMapping
(
"/create"
)
public BaseResponse create(@RequestBody
Team
Query query){
public
BaseResponse
create
(
@RequestBody
PlanEquipmentPurchase
Query
query
){
try
{
return
team
Service.create(query);
return
equipmentPurchase
Service
.
create
(
query
);
}
catch
(
Exception
e
){
log.debug("新增
检测项
{}",e);
log
.
debug
(
"新增
设备采购计划
{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation(value = "更新
检测项
")
@ApiOperation
(
value
=
"更新
设备采购计划
"
)
@PostMapping
(
"/update"
)
public BaseResponse update(@RequestBody
Team
Query query){
public
BaseResponse
update
(
@RequestBody
PlanEquipmentPurchase
Query
query
){
try
{
return
team
Service.update(query);
return
equipmentPurchase
Service
.
update
(
query
);
}
catch
(
Exception
e
){
log.debug("更新
检测项
{}",e);
log
.
debug
(
"更新
设备采购计划
{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation(value = "
启用禁用
")
@
PostMapping("/status
")
public BaseResponse
status(Integer status,
Integer id){
@ApiOperation
(
value
=
"
设备采购计划详情
"
)
@
GetMapping
(
"/{id}
"
)
public
BaseResponse
getDetail
(
@PathVariable
Integer
id
){
try
{
return
teamService.status(status,
id);
return
equipmentPurchaseService
.
getDetail
(
id
);
}
catch
(
Exception
e
){
log.debug("
启用禁用
{}",e);
log
.
debug
(
"
设备采购计划详情
{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation(value = "
检测项详情
")
@
GetMapping("/{id}
")
public BaseResponse
getDetail(@PathVariable
Integer id){
@ApiOperation
(
value
=
"
采购完成
"
)
@
PostMapping
(
"/finish
"
)
public
BaseResponse
finish
(
Integer
id
){
try
{
return
teamService.getDetail
(id);
return
equipmentPurchaseService
.
finish
(
id
);
}
catch
(
Exception
e
){
log.debug("
检测项详情
{}",e);
log
.
debug
(
"
采购完成
{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation(value = "
检测项列表
")
@
GetMapping("/getList
")
public BaseResponse
getList()
{
@ApiOperation
(
value
=
"
删除
"
)
@
PostMapping
(
"/delete/{id}
"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
)
{
try
{
return
teamService.getList(
);
}
catch (Exception e)
{
log.debug("
检测项列表{}",
e);
return
equipmentPurchaseService
.
delete
(
id
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"
删除{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}*/
}
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanEquipmentRepairController.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentRepairQuery
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentRepairService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
...
...
@@ -13,9 +23,85 @@ import org.springframework.web.bind.annotation.RestController;
* @author ztw
* @since 2020-09-28
*/
@Api
(
tags
=
"计划管理-设备维修计划"
)
@RestController
@RequestMapping
(
"/business/plan-equipment-repair"
)
public
class
PlanEquipmentRepairController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanEquipmentRepairController"
);
@Autowired
private
IPlanEquipmentRepairService
equipmentRepairService
;
@ApiOperation
(
value
=
"设备维修计划分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"产品名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
)
{
try
{
return
equipmentRepairService
.
getPage
(
pageQuery
,
name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"设备维修计划分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增设备维修计划"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
PlanEquipmentRepairQuery
query
){
try
{
return
equipmentRepairService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增设备维修计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新设备维修计划"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
PlanEquipmentRepairQuery
query
){
try
{
return
equipmentRepairService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新设备维修计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"设备维修计划详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getDetail
(
@PathVariable
Integer
id
){
try
{
return
equipmentRepairService
.
getDetail
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"设备维修计划详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"维修完成"
)
@PostMapping
(
"/finish"
)
public
BaseResponse
finish
(
Integer
id
){
try
{
return
equipmentRepairService
.
finish
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"维修完成{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
equipmentRepairService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanStandardPurchaseController.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanStandardPurchaseQuery
;
import
cn.wise.sc.cement.business.service.IPlanStandardPurchaseService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
...
...
@@ -13,9 +23,88 @@ import org.springframework.web.bind.annotation.RestController;
* @author ztw
* @since 2020-09-28
*/
@Api
(
tags
=
"计划管理-标样采购计划"
)
@RestController
@RequestMapping
(
"/business/plan-standard-purchase"
)
public
class
PlanStandardPurchaseController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanStandardPurchaseController"
);
@Autowired
private
IPlanStandardPurchaseService
standardPurchaseService
;
@ApiOperation
(
value
=
"标样采购计划分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"产品名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
)
{
try
{
return
standardPurchaseService
.
getPage
(
pageQuery
,
name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"标样采购计划分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增标样采购计划"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
PlanStandardPurchaseQuery
query
){
try
{
return
standardPurchaseService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"新增标样采购计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"更新标样采购计划"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
PlanStandardPurchaseQuery
query
){
try
{
return
standardPurchaseService
.
update
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"更新标样采购计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"标样采购计划详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getDetail
(
@PathVariable
Integer
id
){
try
{
return
standardPurchaseService
.
getDetail
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"标样采购计划详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"采购完成"
)
@PostMapping
(
"/finish"
)
public
BaseResponse
finish
(
Integer
id
){
try
{
return
standardPurchaseService
.
finish
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"采购完成{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
standardPurchaseService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/SysRoleController.java
View file @
bfe18a88
...
...
@@ -127,39 +127,5 @@ public class SysRoleController {
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanConsumablesPurchase.java
View file @
bfe18a88
...
...
@@ -55,6 +55,9 @@ public class PlanConsumablesPurchase implements Serializable {
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"状态(0禁用,1已启用)"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanEquipmentMaintain.java
View file @
bfe18a88
...
...
@@ -41,12 +41,15 @@ public class PlanEquipmentMaintain implements Serializable {
@ApiModelProperty
(
"编号"
)
private
String
code
;
@ApiModelProperty
(
"
xx
"
)
@ApiModelProperty
(
"
维护日期
"
)
private
LocalDate
maintainDate
;
@ApiModelProperty
(
"
采购
人id"
)
@ApiModelProperty
(
"
创建
人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"设备维护人id"
)
private
Integer
maintainerId
;
@ApiModelProperty
(
"维护内容"
)
private
String
maintainContent
;
...
...
@@ -62,7 +65,7 @@ public class PlanEquipmentMaintain implements Serializable {
@ApiModelProperty
(
"附件扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"状态(0
禁用,1已启用
)"
)
@ApiModelProperty
(
"状态(0
待完成,1已完成
)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanEquipmentPurchase.java
View file @
bfe18a88
...
...
@@ -61,7 +61,7 @@ public class PlanEquipmentPurchase implements Serializable {
private
Integer
userId
;
@ApiModelProperty
(
"状态(0
禁用,1已启用
)"
)
@ApiModelProperty
(
"状态(0
待采购,1已完成
)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanEquipmentRepair.java
View file @
bfe18a88
...
...
@@ -51,10 +51,13 @@ public class PlanEquipmentRepair implements Serializable {
@ApiModelProperty
(
"维修日期"
)
private
LocalDate
repairDate
;
@ApiModelProperty
(
"
执行人
"
)
@ApiModelProperty
(
"
创建人id
"
)
private
Integer
userId
;
@ApiModelProperty
(
"状态(0禁用,1已启用)"
)
@ApiModelProperty
(
"维修人id"
)
private
Integer
repairerId
;
@ApiModelProperty
(
"状态(0待完成,1已完成)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanStandardPurchase.java
View file @
bfe18a88
...
...
@@ -48,8 +48,12 @@ public class PlanStandardPurchase implements Serializable {
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanConsumablesPurchaseMapper.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanConsumablesPurchase
;
import
cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +20,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
PlanConsumablesPurchaseMapper
extends
BaseMapper
<
PlanConsumablesPurchase
>
{
IPage
<
PlanConsumablesPurchaseVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
PlanConsumablesPurchaseVo
getDetail
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanEquipmentMaintainMapper.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentMaintain
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +20,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
PlanEquipmentMaintainMapper
extends
BaseMapper
<
PlanEquipmentMaintain
>
{
IPage
<
PlanEquipmentMaintainVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
PlanEquipmentMaintainVo
getDetail
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanEquipmentPurchaseMapper.java
View file @
bfe18a88
...
...
@@ -22,6 +22,7 @@ public interface PlanEquipmentPurchaseMapper extends BaseMapper<PlanEquipmentPur
IPage
<
PlanEquipmentPurchaseVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
PlanEquipmentPurchaseVo
getDetail
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanEquipmentRepairMapper.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentRepair
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +20,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
PlanEquipmentRepairMapper
extends
BaseMapper
<
PlanEquipmentRepair
>
{
IPage
<
PlanEquipmentRepairVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
PlanEquipmentRepairVo
getDetail
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanStandardPurchaseMapper.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanStandardPurchase
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -13,4 +20,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
PlanStandardPurchaseMapper
extends
BaseMapper
<
PlanStandardPurchase
>
{
IPage
<
PlanStandardPurchaseVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
PlanStandardPurchaseVo
getDetail
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanConsumablesPurchaseMapper.xml
View file @
bfe18a88
...
...
@@ -2,4 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanConsumablesPurchaseMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null"
>
and t.status = #{params.status}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo"
>
SELECT t.*, su.name as purchaserName
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo"
>
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_consumables_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanEquipmentMaintainMapper.xml
View file @
bfe18a88
...
...
@@ -2,4 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanEquipmentMaintainMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null"
>
and t.status = #{params.status}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo"
>
SELECT t.*, su.name as maintainerName
FROM plan_equipment_maintain t
left join sys_user su on su.id = t.maintainer_id
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo"
>
SELECT t.*, su.name as maintainerName, su2.name as userName
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.maintainer_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanEquipmentPurchaseMapper.xml
View file @
bfe18a88
...
...
@@ -21,6 +21,16 @@
ORDER BY t.id DESC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo"
>
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_equipment_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanEquipmentRepairMapper.xml
View file @
bfe18a88
...
...
@@ -2,4 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanEquipmentRepairMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null"
>
and t.status = #{params.status}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo"
>
SELECT t.*, su.name as repairerName
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo"
>
SELECT t.*, su.name as repairerName, su2.name as userName
FROM plan_equipment_repair t
left join sys_user su on su.id = t.repairer_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanStandardPurchaseMapper.xml
View file @
bfe18a88
...
...
@@ -2,4 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanStandardPurchaseMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.status != null"
>
and t.status = #{params.status}
</if>
<if
test=
"params.name != null and params.name != ''"
>
and t.name like concat('%', #{params.name}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo"
>
SELECT t.*, su.name as purchaserName
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
<include
refid=
"where"
/>
ORDER BY t.id DESC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo"
>
SELECT t.*, su.name as purchaserName, su2.name as userName
FROM plan_standard_purchase t
left join sys_user su on su.id = t.purchaser_id
left join sys_user su2 on su2.id = t.user_id
WHERE t.id = #{id}
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanConsumablesPurchaseQuery.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: qh
* @create: 2020-09-29
**/
@Data
@ApiModel
(
"消耗品采购计划请求"
)
public
class
PlanConsumablesPurchaseQuery
{
@ApiModelProperty
(
"消耗品采购计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"技术指标"
)
private
String
technicalIndex
;
@ApiModelProperty
(
"单价(万元)"
)
private
BigDecimal
unitPrice
;
@ApiModelProperty
(
"生产单位"
)
private
String
productionUnit
;
@ApiModelProperty
(
"采购数量"
)
private
Integer
purchaseNum
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanEquipmentMaintainQuery.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: qh
* @create: 2020-09-29
**/
@Data
@ApiModel
(
"设备维护计划请求"
)
public
class
PlanEquipmentMaintainQuery
{
@ApiModelProperty
(
"设备维护计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"编号"
)
private
String
code
;
@ApiModelProperty
(
"维护日期"
)
private
LocalDate
maintainDate
;
@ApiModelProperty
(
"设备维护人id"
)
private
Integer
maintainerId
;
@ApiModelProperty
(
"维护内容"
)
private
String
maintainContent
;
@ApiModelProperty
(
"维护结果"
)
private
String
maintainResult
;
@ApiModelProperty
(
"设备维护计划附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"附件名"
)
private
String
alias
;
@ApiModelProperty
(
"附件扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanEquipmentPurchaseQuery.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: qh
* @create: 2020-09-29
**/
@Data
@ApiModel
(
"设备采购计划请求"
)
public
class
PlanEquipmentPurchaseQuery
{
@ApiModelProperty
(
"设备采购计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"技术指标"
)
private
String
technicalIndex
;
@ApiModelProperty
(
"单价(万元)"
)
private
BigDecimal
unitPrice
;
@ApiModelProperty
(
"生产单位"
)
private
String
productionUnit
;
@ApiModelProperty
(
"采购数量"
)
private
Integer
purchaseNum
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanEquipmentRepairQuery.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: qh
* @create: 2020-09-29
**/
@Data
@ApiModel
(
"设备维修计划请求"
)
public
class
PlanEquipmentRepairQuery
{
@ApiModelProperty
(
"设备维修计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"技术指标"
)
private
String
technicalIndex
;
@ApiModelProperty
(
"单价(万元)"
)
private
BigDecimal
unitPrice
;
@ApiModelProperty
(
"生产单位"
)
private
String
productionUnit
;
@ApiModelProperty
(
"维修日期"
)
private
LocalDate
repairDate
;
@ApiModelProperty
(
"维修人id"
)
private
Integer
repairerId
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanStandardPurchaseQuery.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: qh
* @create: 2020-09-29
**/
@Data
@ApiModel
(
"标样采购计划请求"
)
public
class
PlanStandardPurchaseQuery
{
@ApiModelProperty
(
"标样采购计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"标物名称"
)
private
String
name
;
@ApiModelProperty
(
"标物编号"
)
private
String
code
;
@ApiModelProperty
(
"经销单位"
)
private
String
distributionUnit
;
@ApiModelProperty
(
"采购数量"
)
private
Integer
purchaseNum
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/TeamQuery.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -11,6 +12,7 @@ import java.math.BigDecimal;
* @create: 2020-08-07 15:42
**/
@Data
@ApiModel
(
"检测项请求"
)
public
class
TeamQuery
{
@ApiModelProperty
(
"检测项表id"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanConsumablesPurchaseVo.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 15:09
**/
@Data
@ApiModel
(
"消耗品采购计划Vo"
)
public
class
PlanConsumablesPurchaseVo
{
@ApiModelProperty
(
"消耗品采购计划表id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"技术指标"
)
private
String
technicalIndex
;
@ApiModelProperty
(
"单价(万元)"
)
private
BigDecimal
unitPrice
;
@ApiModelProperty
(
"生产单位"
)
private
String
productionUnit
;
@ApiModelProperty
(
"采购数量"
)
private
Integer
purchaseNum
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"采购人姓名"
)
private
String
purchaserName
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"创建人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"状态(0禁用,1已启用)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanEquipmentMaintainVo.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 15:09
**/
@Data
@ApiModel
(
"设备维护计划Vo"
)
public
class
PlanEquipmentMaintainVo
{
@ApiModelProperty
(
"设备维护计划表id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"编号"
)
private
String
code
;
@ApiModelProperty
(
"维护日期"
)
private
LocalDate
maintainDate
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"创建人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"设备维护人id"
)
private
Integer
maintainerId
;
@ApiModelProperty
(
"设备维护人姓名"
)
private
String
maintainerName
;
@ApiModelProperty
(
"维护内容"
)
private
String
maintainContent
;
@ApiModelProperty
(
"维护结果"
)
private
String
maintainResult
;
@ApiModelProperty
(
"设备维护计划附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"附件名"
)
private
String
alias
;
@ApiModelProperty
(
"附件扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"状态(0待完成,1已完成)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanEquipmentRepairVo.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 15:09
**/
@Data
@ApiModel
(
"设备维修计划Vo"
)
public
class
PlanEquipmentRepairVo
{
@ApiModelProperty
(
"设备维修计划Id"
)
private
Integer
id
;
@ApiModelProperty
(
"产品名称"
)
private
String
name
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"技术指标"
)
private
String
technicalIndex
;
@ApiModelProperty
(
"单价(万元)"
)
private
BigDecimal
unitPrice
;
@ApiModelProperty
(
"生产单位"
)
private
String
productionUnit
;
@ApiModelProperty
(
"维修日期"
)
private
LocalDate
repairDate
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"创建人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"维修人id"
)
private
Integer
repairerId
;
@ApiModelProperty
(
"设备维修人姓名"
)
private
String
repairerName
;
@ApiModelProperty
(
"状态(0待完成,1已完成)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanStandardPurchaseVo.java
0 → 100644
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 15:09
**/
@Data
@ApiModel
(
"标样采购计划Vo"
)
public
class
PlanStandardPurchaseVo
{
@ApiModelProperty
(
"标样采购计划表id"
)
private
Integer
id
;
@ApiModelProperty
(
"标物名称"
)
private
String
name
;
@ApiModelProperty
(
"标物编号"
)
private
String
code
;
@ApiModelProperty
(
"经销单位"
)
private
String
distributionUnit
;
@ApiModelProperty
(
"采购数量"
)
private
Integer
purchaseNum
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"采购人id"
)
private
Integer
purchaserId
;
@ApiModelProperty
(
"采购人姓名"
)
private
String
purchaserName
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"创建人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"规格型号"
)
private
String
model
;
@ApiModelProperty
(
"状态(0禁用,1已启用)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanConsumablesPurchaseService.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.PlanConsumablesPurchase
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanConsumablesPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -13,4 +18,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
IPlanConsumablesPurchaseService
extends
IService
<
PlanConsumablesPurchase
>
{
BaseResponse
<
IPage
<
PlanConsumablesPurchaseVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
);
BaseResponse
<
PlanConsumablesPurchase
>
create
(
PlanConsumablesPurchaseQuery
query
);
BaseResponse
<
PlanConsumablesPurchase
>
update
(
PlanConsumablesPurchaseQuery
query
);
BaseResponse
<
PlanConsumablesPurchaseVo
>
getDetail
(
Integer
id
);
BaseResponse
<
String
>
finish
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanEquipmentMaintainService.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentMaintain
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentMaintainQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -13,4 +18,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
IPlanEquipmentMaintainService
extends
IService
<
PlanEquipmentMaintain
>
{
BaseResponse
<
IPage
<
PlanEquipmentMaintainVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
);
BaseResponse
<
PlanEquipmentMaintain
>
create
(
PlanEquipmentMaintainQuery
query
);
BaseResponse
<
PlanEquipmentMaintain
>
update
(
PlanEquipmentMaintainQuery
query
);
BaseResponse
<
PlanEquipmentMaintainVo
>
getDetail
(
Integer
id
);
BaseResponse
<
String
>
finish
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanEquipmentPurchaseService.java
View file @
bfe18a88
...
...
@@ -3,6 +3,7 @@ package cn.wise.sc.cement.business.service;
import
cn.wise.sc.cement.business.entity.PlanEquipmentPurchase
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
...
...
@@ -19,6 +20,16 @@ public interface IPlanEquipmentPurchaseService extends IService<PlanEquipmentPur
BaseResponse
<
IPage
<
PlanEquipmentPurchaseVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
);
BaseResponse
<
PlanEquipmentPurchase
>
create
(
PlanEquipmentPurchaseQuery
query
);
BaseResponse
<
PlanEquipmentPurchase
>
update
(
PlanEquipmentPurchaseQuery
query
);
BaseResponse
<
PlanEquipmentPurchaseVo
>
getDetail
(
Integer
id
);
BaseResponse
<
String
>
finish
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanEquipmentRepairService.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentRepair
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentRepairQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.annotation.Resource
;
/**
* <p>
* 服务类
...
...
@@ -13,4 +20,16 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
IPlanEquipmentRepairService
extends
IService
<
PlanEquipmentRepair
>
{
BaseResponse
<
IPage
<
PlanEquipmentRepairVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
);
BaseResponse
<
PlanEquipmentRepair
>
create
(
PlanEquipmentRepairQuery
query
);
BaseResponse
<
PlanEquipmentRepair
>
update
(
PlanEquipmentRepairQuery
query
);
BaseResponse
<
PlanEquipmentRepairVo
>
getDetail
(
Integer
id
);
BaseResponse
<
String
>
finish
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanStandardPurchaseService.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.PlanStandardPurchase
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanStandardPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
...
...
@@ -13,4 +18,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
IPlanStandardPurchaseService
extends
IService
<
PlanStandardPurchase
>
{
BaseResponse
<
IPage
<
PlanStandardPurchaseVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
);
BaseResponse
<
PlanStandardPurchase
>
create
(
PlanStandardPurchaseQuery
query
);
BaseResponse
<
PlanStandardPurchase
>
update
(
PlanStandardPurchaseQuery
query
);
BaseResponse
<
PlanStandardPurchaseVo
>
getDetail
(
Integer
id
);
BaseResponse
<
String
>
finish
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISysRoleService.java
View file @
bfe18a88
...
...
@@ -25,7 +25,7 @@ public interface ISysRoleService extends IService<SysRole> {
BaseResponse
<
SysRole
>
byUserId
(
Integer
userId
);
BaseResponse
delete
(
Integer
id
);
BaseResponse
<
String
>
delete
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanConsumablesPurchaseServiceImpl.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.PlanConsumablesPurchase
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentPurchase
;
import
cn.wise.sc.cement.business.mapper.PlanConsumablesPurchaseMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanConsumablesPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.service.IPlanConsumablesPurchaseService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
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.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -17,4 +38,132 @@ import org.springframework.stereotype.Service;
@Service
public
class
PlanConsumablesPurchaseServiceImpl
extends
ServiceImpl
<
PlanConsumablesPurchaseMapper
,
PlanConsumablesPurchase
>
implements
IPlanConsumablesPurchaseService
{
@Resource
private
PlanConsumablesPurchaseMapper
consumablesPurchaseMapper
;
@Autowired
private
ISysUserService
userService
;
/**
* 分页查询
* @param pageQuery
* @param name
* @return
*/
@Override
public
BaseResponse
<
IPage
<
PlanConsumablesPurchaseVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"name"
,
name
);
Page
<
PlanConsumablesPurchaseVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanConsumablesPurchaseVo
>
pages
=
consumablesPurchaseMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 创建
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanConsumablesPurchase
>
create
(
PlanConsumablesPurchaseQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanConsumablesPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
consumablesPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanConsumablesPurchase
pep
=
new
PlanConsumablesPurchase
();
BeanUtils
.
copyProperties
(
query
,
pep
);
pep
.
setUserId
(
loginUser
.
getId
())
.
setStatus
(
0
)
.
setCreateTime
(
LocalDateTime
.
now
());
consumablesPurchaseMapper
.
insert
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 修改
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanConsumablesPurchase
>
update
(
PlanConsumablesPurchaseQuery
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanConsumablesPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
consumablesPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanConsumablesPurchase
pep
=
consumablesPurchaseMapper
.
selectById
(
query
.
getId
());
BeanUtils
.
copyProperties
(
query
,
pep
);
consumablesPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 获取详情
* @param id
* @return
*/
@Override
public
BaseResponse
<
PlanConsumablesPurchaseVo
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanConsumablesPurchase
pep
=
consumablesPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
PlanConsumablesPurchaseVo
planEquipmentPurchaseVo
=
consumablesPurchaseMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
planEquipmentPurchaseVo
);
}
/**
* 采购完成
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finish
(
Integer
id
)
{
if
(
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanConsumablesPurchase
pep
=
consumablesPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
pep
.
setStatus
(
1
);
//采购完成
consumablesPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
"采购完成"
);
}
/**
* 删除
* @param id
* @return
*/
@Override
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
PlanConsumablesPurchase
pep
=
consumablesPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
consumablesPurchaseMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanEquipmentMaintainServiceImpl.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentMaintain
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentPurchase
;
import
cn.wise.sc.cement.business.mapper.PlanEquipmentMaintainMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentMaintainQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentMaintainVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentMaintainService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
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.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -17,4 +38,136 @@ import org.springframework.stereotype.Service;
@Service
public
class
PlanEquipmentMaintainServiceImpl
extends
ServiceImpl
<
PlanEquipmentMaintainMapper
,
PlanEquipmentMaintain
>
implements
IPlanEquipmentMaintainService
{
@Resource
private
PlanEquipmentMaintainMapper
equipmentMaintainMapper
;
@Autowired
private
ISysUserService
userService
;
/**
* 分页查询
* @param pageQuery
* @param name
* @return
*/
@Override
public
BaseResponse
<
IPage
<
PlanEquipmentMaintainVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"name"
,
name
);
Page
<
PlanEquipmentMaintainVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanEquipmentMaintainVo
>
pages
=
equipmentMaintainMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 创建
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentMaintain
>
create
(
PlanEquipmentMaintainQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentMaintain
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
equipmentMaintainMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentMaintain
pep
=
new
PlanEquipmentMaintain
();
BeanUtils
.
copyProperties
(
query
,
pep
);
pep
.
setUserId
(
loginUser
.
getId
())
.
setStatus
(
0
)
.
setCreateTime
(
LocalDateTime
.
now
());
equipmentMaintainMapper
.
insert
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 修改
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentMaintain
>
update
(
PlanEquipmentMaintainQuery
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentMaintain
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
equipmentMaintainMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentMaintain
pep
=
equipmentMaintainMapper
.
selectById
(
query
.
getId
());
BeanUtils
.
copyProperties
(
query
,
pep
);
equipmentMaintainMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 获取详情
* @param id
* @return
*/
@Override
public
BaseResponse
<
PlanEquipmentMaintainVo
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentMaintain
pep
=
equipmentMaintainMapper
.
selectById
(
id
);
if
(
pep
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
PlanEquipmentMaintainVo
planEquipmentMaintainVo
=
equipmentMaintainMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
planEquipmentMaintainVo
);
}
/**
* 维护完成
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finish
(
Integer
id
)
{
if
(
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentMaintain
pep
=
equipmentMaintainMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
pep
.
setStatus
(
1
);
//维护完成
equipmentMaintainMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
"维护完成"
);
}
/**
* 删除
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
PlanEquipmentMaintain
pep
=
equipmentMaintainMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
equipmentMaintainMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanEquipmentPurchaseServiceImpl.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentPurchase
;
import
cn.wise.sc.cement.business.entity.SysRole
;
import
cn.wise.sc.cement.business.entity.Team
;
import
cn.wise.sc.cement.business.mapper.PlanEquipmentPurchaseMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.RoleQuery
;
import
cn.wise.sc.cement.business.model.query.TeamQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.TeamListVo
;
import
cn.wise.sc.cement.business.model.vo.TeamVo
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentPurchaseService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -29,6 +45,8 @@ public class PlanEquipmentPurchaseServiceImpl extends ServiceImpl<PlanEquipmentP
@Resource
private
PlanEquipmentPurchaseMapper
equipmentPurchaseMapper
;
@Autowired
private
ISysUserService
userService
;
/**
* 分页查询
...
...
@@ -45,22 +63,112 @@ public class PlanEquipmentPurchaseServiceImpl extends ServiceImpl<PlanEquipmentP
return
BaseResponse
.
okData
(
pages
);
}
/**
* 创建
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentPurchase
>
create
(
PlanEquipmentPurchaseQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
equipmentPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentPurchase
pep
=
new
PlanEquipmentPurchase
();
BeanUtils
.
copyProperties
(
query
,
pep
);
pep
.
setUserId
(
loginUser
.
getId
())
.
setStatus
(
0
)
.
setCreateTime
(
LocalDateTime
.
now
());
equipmentPurchaseMapper
.
insert
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 修改
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentPurchase
>
update
(
PlanEquipmentPurchaseQuery
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
equipmentPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentPurchase
pep
=
equipmentPurchaseMapper
.
selectById
(
query
.
getId
());
BeanUtils
.
copyProperties
(
query
,
pep
);
equipmentPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 获取详情
* @param id
* @return
*/
@Override
public
BaseResponse
<
PlanEquipmentPurchaseVo
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentPurchase
pep
=
equipmentPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
PlanEquipmentPurchaseVo
planEquipmentPurchaseVo
=
equipmentPurchaseMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
planEquipmentPurchaseVo
);
}
/**
* 采购完成
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finish
(
Integer
id
)
{
if
(
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentPurchase
pep
=
equipmentPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
pep
.
setStatus
(
1
);
//采购完成
equipmentPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
"采购完成"
);
}
/**
* 删除
* @param id
* @return
*/
@Override
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
PlanEquipmentPurchase
pep
=
equipmentPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
equipmentPurchaseMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanEquipmentRepairServiceImpl.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentPurchase
;
import
cn.wise.sc.cement.business.entity.PlanEquipmentRepair
;
import
cn.wise.sc.cement.business.mapper.PlanEquipmentRepairMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanEquipmentRepairQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanEquipmentRepairVo
;
import
cn.wise.sc.cement.business.service.IPlanEquipmentRepairService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
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.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -17,4 +38,134 @@ import org.springframework.stereotype.Service;
@Service
public
class
PlanEquipmentRepairServiceImpl
extends
ServiceImpl
<
PlanEquipmentRepairMapper
,
PlanEquipmentRepair
>
implements
IPlanEquipmentRepairService
{
@Resource
private
PlanEquipmentRepairMapper
equipmentRepairMapper
;
@Autowired
private
ISysUserService
userService
;
/**
* 分页查询
* @param pageQuery
* @param name
* @return
*/
@Override
public
BaseResponse
<
IPage
<
PlanEquipmentRepairVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"name"
,
name
);
Page
<
PlanEquipmentRepairVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanEquipmentRepairVo
>
pages
=
equipmentRepairMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 创建
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentRepair
>
create
(
PlanEquipmentRepairQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentRepair
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
equipmentRepairMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentRepair
pep
=
new
PlanEquipmentRepair
();
BeanUtils
.
copyProperties
(
query
,
pep
);
pep
.
setUserId
(
loginUser
.
getId
())
.
setStatus
(
0
)
.
setCreateTime
(
LocalDateTime
.
now
());
equipmentRepairMapper
.
insert
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 修改
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanEquipmentRepair
>
update
(
PlanEquipmentRepairQuery
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanEquipmentRepair
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
equipmentRepairMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanEquipmentRepair
pep
=
equipmentRepairMapper
.
selectById
(
query
.
getId
());
BeanUtils
.
copyProperties
(
query
,
pep
);
equipmentRepairMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 获取详情
* @param id
* @return
*/
@Override
public
BaseResponse
<
PlanEquipmentRepairVo
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentRepair
pep
=
equipmentRepairMapper
.
selectById
(
id
);
if
(
pep
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
PlanEquipmentRepairVo
planEquipmentPurchaseVo
=
equipmentRepairMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
planEquipmentPurchaseVo
);
}
/**
* 维修完成
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finish
(
Integer
id
)
{
if
(
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanEquipmentRepair
pep
=
equipmentRepairMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
pep
.
setStatus
(
1
);
//维修完成
equipmentRepairMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
"维修完成"
);
}
/**
* 删除
* @param id
* @return
*/
@Override
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
PlanEquipmentRepair
pep
=
equipmentRepairMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
equipmentRepairMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanStandardPurchaseServiceImpl.java
View file @
bfe18a88
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.PlanConsumablesPurchase
;
import
cn.wise.sc.cement.business.entity.PlanStandardPurchase
;
import
cn.wise.sc.cement.business.mapper.PlanStandardPurchaseMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanConsumablesPurchaseQuery
;
import
cn.wise.sc.cement.business.model.query.PlanStandardPurchaseQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanConsumablesPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo
;
import
cn.wise.sc.cement.business.service.IPlanStandardPurchaseService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
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.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -17,4 +38,133 @@ import org.springframework.stereotype.Service;
@Service
public
class
PlanStandardPurchaseServiceImpl
extends
ServiceImpl
<
PlanStandardPurchaseMapper
,
PlanStandardPurchase
>
implements
IPlanStandardPurchaseService
{
@Resource
private
PlanStandardPurchaseMapper
standardPurchaseMapper
;
@Autowired
private
ISysUserService
userService
;
/**
* 分页查询
* @param pageQuery
* @param name
* @return
*/
@Override
public
BaseResponse
<
IPage
<
PlanStandardPurchaseVo
>>
getPage
(
PageQuery
pageQuery
,
String
name
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"name"
,
name
);
Page
<
PlanStandardPurchaseVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanStandardPurchaseVo
>
pages
=
standardPurchaseMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 创建
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanStandardPurchase
>
create
(
PlanStandardPurchaseQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanStandardPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
standardPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanStandardPurchase
pep
=
new
PlanStandardPurchase
();
BeanUtils
.
copyProperties
(
query
,
pep
);
pep
.
setUserId
(
loginUser
.
getId
())
.
setStatus
(
0
)
.
setCreateTime
(
LocalDateTime
.
now
());
standardPurchaseMapper
.
insert
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 修改
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
PlanStandardPurchase
>
update
(
PlanStandardPurchaseQuery
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"产品名称不能为空!"
);
}
QueryWrapper
<
PlanStandardPurchase
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
standardPurchaseMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
PlanStandardPurchase
pep
=
standardPurchaseMapper
.
selectById
(
query
.
getId
());
BeanUtils
.
copyProperties
(
query
,
pep
);
standardPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
pep
);
}
/**
* 获取详情
* @param id
* @return
*/
@Override
public
BaseResponse
<
PlanStandardPurchaseVo
>
getDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanStandardPurchase
pep
=
standardPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
PlanStandardPurchaseVo
planEquipmentPurchaseVo
=
standardPurchaseMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
planEquipmentPurchaseVo
);
}
/**
* 采购完成
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finish
(
Integer
id
)
{
if
(
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanStandardPurchase
pep
=
standardPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
pep
.
setStatus
(
1
);
//采购完成
standardPurchaseMapper
.
updateById
(
pep
);
return
BaseResponse
.
okData
(
"采购完成"
);
}
/**
* 删除
* @param id
* @return
*/
@Override
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
PlanStandardPurchase
pep
=
standardPurchaseMapper
.
selectById
(
id
);
if
(
pep
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
standardPurchaseMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SysRoleServiceImpl.java
View file @
bfe18a88
...
...
@@ -133,7 +133,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
*/
@Override
@Transactional
public
BaseResponse
delete
(
Integer
id
)
{
public
BaseResponse
<
String
>
delete
(
Integer
id
)
{
SysRole
role
=
roleMapper
.
selectById
(
id
);
if
(
role
==
null
){
return
BaseResponse
.
errorMsg
(
"角色不存在!"
);
...
...
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