Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
竹天卫
tianjin-cement
Commits
0c9af13e
Commit
0c9af13e
authored
Sep 04, 2020
by
zhutianwei@hyzcservice.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源管理-消耗品管理 后台接口完成
parent
90f21ac0
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
881 additions
and
6 deletions
+881
-6
ConsumablesController.java
.../sc/cement/business/controller/ConsumablesController.java
+184
-0
Consumables.java
...n/java/cn/wise/sc/cement/business/entity/Consumables.java
+73
-0
ConsumablesEnter.java
...a/cn/wise/sc/cement/business/entity/ConsumablesEnter.java
+50
-0
ConsumablesOut.java
...ava/cn/wise/sc/cement/business/entity/ConsumablesOut.java
+51
-0
ConsumablesEnterMapper.java
...ise/sc/cement/business/mapper/ConsumablesEnterMapper.java
+16
-0
ConsumablesMapper.java
.../cn/wise/sc/cement/business/mapper/ConsumablesMapper.java
+16
-0
ConsumablesOutMapper.java
.../wise/sc/cement/business/mapper/ConsumablesOutMapper.java
+16
-0
ConsumablesEnterMapper.xml
.../sc/cement/business/mapper/xml/ConsumablesEnterMapper.xml
+5
-0
ConsumablesMapper.xml
.../wise/sc/cement/business/mapper/xml/ConsumablesMapper.xml
+5
-0
ConsumablesOutMapper.xml
...se/sc/cement/business/mapper/xml/ConsumablesOutMapper.xml
+5
-0
ChangeStockQuery.java
...wise/sc/cement/business/model/query/ChangeStockQuery.java
+34
-0
ChangeValidDateQuery.java
.../sc/cement/business/model/query/ChangeValidDateQuery.java
+28
-0
DistributionQuery.java
...ise/sc/cement/business/model/query/DistributionQuery.java
+20
-1
SampleDistributionQuery.java
.../cement/business/model/query/SampleDistributionQuery.java
+16
-1
SampleDistributionTeamQuery.java
...ent/business/model/query/SampleDistributionTeamQuery.java
+18
-3
SampleDistributionTeamVo.java
...sc/cement/business/model/vo/SampleDistributionTeamVo.java
+1
-1
IConsumablesEnterService.java
.../sc/cement/business/service/IConsumablesEnterService.java
+16
-0
IConsumablesOutService.java
...se/sc/cement/business/service/IConsumablesOutService.java
+16
-0
IConsumablesService.java
.../wise/sc/cement/business/service/IConsumablesService.java
+40
-0
ConsumablesEnterServiceImpl.java
...nt/business/service/impl/ConsumablesEnterServiceImpl.java
+20
-0
ConsumablesOutServiceImpl.java
...ment/business/service/impl/ConsumablesOutServiceImpl.java
+20
-0
ConsumablesServiceImpl.java
.../cement/business/service/impl/ConsumablesServiceImpl.java
+231
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ConsumablesController.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.Consumables
;
import
cn.wise.sc.cement.business.entity.Equipment
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.EquipmentQuery
;
import
cn.wise.sc.cement.business.service.IConsumablesService
;
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.*
;
import
java.util.List
;
/**
* <p>
* 前端控制器
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Api
(
tags
=
"资源管理-消耗品管理"
)
@RestController
@RequestMapping
(
"/business/consumables"
)
public
class
ConsumablesController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"ConsumablesController"
);
@Autowired
private
IConsumablesService
consumablesService
;
@ApiOperation
(
value
=
"消耗品分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"易耗品名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"supplierName"
,
value
=
"购买厂商名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
)
{
try
{
return
consumablesService
.
getPage
(
pageQuery
,
name
,
supplierName
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"消耗品分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增消耗品"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
Consumables
query
)
{
try
{
return
consumablesService
.
create
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"新增消耗品{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"修改消耗品"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
Consumables
query
)
{
try
{
return
consumablesService
.
update
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"修改消耗品{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"消耗品详情"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
Consumables
consumables
=
consumablesService
.
getById
(
id
);
return
BaseResponse
.
okData
(
consumables
);
}
catch
(
Exception
e
){
log
.
debug
(
"消耗品详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"消耗品列表"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
(){
try
{
List
<
Consumables
>
list
=
consumablesService
.
list
();
return
BaseResponse
.
okData
(
list
);
}
catch
(
Exception
e
){
log
.
debug
(
"消耗品列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"删除消耗品"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
consumablesService
.
removeById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除消耗品{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"新增入库"
)
@PostMapping
(
"/enter"
)
public
BaseResponse
enter
(
@RequestBody
ChangeStockQuery
query
)
{
try
{
return
consumablesService
.
enter
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"新增入库{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"领用出库"
)
@PostMapping
(
"/out"
)
public
BaseResponse
out
(
@RequestBody
ChangeStockQuery
query
)
{
try
{
return
consumablesService
.
out
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"领用出库{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"变更有效期"
)
@PostMapping
(
"/changeValidDate"
)
public
BaseResponse
changeValidDate
(
@RequestBody
ChangeValidDateQuery
query
)
{
try
{
return
consumablesService
.
changeValidDate
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"变更有效期{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"过期处置"
)
@PostMapping
(
"/overdue"
)
public
BaseResponse
overdue
(
Integer
id
)
{
try
{
return
consumablesService
.
overdue
(
id
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"过期处置{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/Consumables.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
java.time.LocalDate
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
Consumables
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"易耗品名称"
)
private
String
name
;
@ApiModelProperty
(
"易耗品代号"
)
private
String
code
;
@ApiModelProperty
(
"供应商表id"
)
private
Integer
supplierId
;
@ApiModelProperty
(
"购买厂商名称"
)
private
String
supplierName
;
@ApiModelProperty
(
"位置"
)
private
String
position
;
@ApiModelProperty
(
"采购日期(购买日期)"
)
private
LocalDate
purchaseDate
;
@ApiModelProperty
(
"库存数量"
)
private
BigDecimal
stockNum
;
@ApiModelProperty
(
"库存提醒数量(少于多少进行提醒)"
)
private
BigDecimal
leastNum
;
@ApiModelProperty
(
"有效日期"
)
private
LocalDate
validDate
;
@ApiModelProperty
(
"状态(0已作废,1启用中)"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/ConsumablesEnter.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
ConsumablesEnter
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"消耗品表id"
)
private
Integer
consumablesId
;
@ApiModelProperty
(
"操作人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"新增数量"
)
private
BigDecimal
enterNum
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/ConsumablesOut.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
java.math.BigDecimal
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
ConsumablesOut
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"消耗品表id"
)
private
Integer
consumablesId
;
@ApiModelProperty
(
"领用人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"领用量"
)
private
BigDecimal
collectNum
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ConsumablesEnterMapper.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.ConsumablesEnter
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
ConsumablesEnterMapper
extends
BaseMapper
<
ConsumablesEnter
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ConsumablesMapper.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Consumables
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
ConsumablesMapper
extends
BaseMapper
<
Consumables
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/ConsumablesOutMapper.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.ConsumablesOut
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
ConsumablesOutMapper
extends
BaseMapper
<
ConsumablesOut
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ConsumablesEnterMapper.xml
0 → 100644
View file @
0c9af13e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.ConsumablesEnterMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ConsumablesMapper.xml
0 → 100644
View file @
0c9af13e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.ConsumablesMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/ConsumablesOutMapper.xml
0 → 100644
View file @
0c9af13e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.ConsumablesOutMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/ChangeStockQuery.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"新增入库请求"
)
public
class
ChangeStockQuery
{
@ApiModelProperty
(
"表id"
)
private
Integer
id
;
/**
* 新增数量 / 领用数量
*/
@ApiModelProperty
(
"改变数量"
)
private
BigDecimal
changeNum
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/ChangeValidDateQuery.java
0 → 100644
View file @
0c9af13e
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
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"变更有效期请求"
)
public
class
ChangeValidDateQuery
{
@ApiModelProperty
(
"表id"
)
private
Integer
id
;
@ApiModelProperty
(
"有效日期"
)
private
LocalDate
validDate
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/DistributionQuery.java
View file @
0c9af13e
...
@@ -11,7 +11,7 @@ import java.util.List;
...
@@ -11,7 +11,7 @@ import java.util.List;
* @author: ztw
* @author: ztw
* @create: 2020-08-07 14:58
* @create: 2020-08-07 14:58
**/
**/
@Data
//
@Data
@ApiModel
(
"委托-派发请求"
)
@ApiModel
(
"委托-派发请求"
)
public
class
DistributionQuery
{
public
class
DistributionQuery
{
...
@@ -26,8 +26,27 @@ public class DistributionQuery {
...
@@ -26,8 +26,27 @@ public class DistributionQuery {
@ApiModelProperty
(
"样品信息列表"
)
@ApiModelProperty
(
"样品信息列表"
)
private
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
;
private
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
List
<
SampleDistributionQuery
>
getSampleDistributionQueryList
()
{
return
sampleDistributionQueryList
;
}
public
void
setSampleDistributionQueryList
(
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
)
{
this
.
sampleDistributionQueryList
=
sampleDistributionQueryList
;
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleDistributionQuery.java
View file @
0c9af13e
...
@@ -12,7 +12,7 @@ import java.util.List;
...
@@ -12,7 +12,7 @@ import java.util.List;
* @author: ztw
* @author: ztw
* @create: 2020-08-07 14:58
* @create: 2020-08-07 14:58
**/
**/
@Data
//
@Data
@ApiModel
(
"委托-样品派发请求"
)
@ApiModel
(
"委托-样品派发请求"
)
public
class
SampleDistributionQuery
{
public
class
SampleDistributionQuery
{
...
@@ -28,4 +28,19 @@ public class SampleDistributionQuery {
...
@@ -28,4 +28,19 @@ public class SampleDistributionQuery {
@ApiModelProperty
(
"检测项目信息列表"
)
@ApiModelProperty
(
"检测项目信息列表"
)
public
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
;
public
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
;
public
Integer
getSampleId
()
{
return
sampleId
;
}
public
void
setSampleId
(
Integer
sampleId
)
{
this
.
sampleId
=
sampleId
;
}
public
List
<
SampleDistributionTeamQuery
>
getSampleDistributionTeamQueryList
()
{
return
sampleDistributionTeamQueryList
;
}
public
void
setSampleDistributionTeamQueryList
(
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
)
{
this
.
sampleDistributionTeamQueryList
=
sampleDistributionTeamQueryList
;
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleDistributionTeamQuery.java
View file @
0c9af13e
...
@@ -9,14 +9,29 @@ import lombok.Data;
...
@@ -9,14 +9,29 @@ import lombok.Data;
* @author: ztw
* @author: ztw
* @create: 2020-08-07 14:58
* @create: 2020-08-07 14:58
**/
**/
@Data
//
@Data
@ApiModel
(
"委托-样品派发请求"
)
@ApiModel
(
"委托-样品
检测项
派发请求"
)
public
class
SampleDistributionTeamQuery
{
public
class
SampleDistributionTeamQuery
{
@ApiModelProperty
(
"检测项id"
)
@ApiModelProperty
(
"检测项id"
)
private
Integer
T
eamId
;
private
Integer
t
eamId
;
@ApiModelProperty
(
"检测人员id"
)
@ApiModelProperty
(
"检测人员id"
)
private
Integer
userId
;
private
Integer
userId
;
public
Integer
getTeamId
()
{
return
teamId
;
}
public
void
setTeamId
(
Integer
teamId
)
{
this
.
teamId
=
teamId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleDistributionTeamVo.java
View file @
0c9af13e
...
@@ -30,6 +30,6 @@ public class SampleDistributionTeamVo {
...
@@ -30,6 +30,6 @@ public class SampleDistributionTeamVo {
private
Integer
userId
;
private
Integer
userId
;
@ApiModelProperty
(
"检测人员姓名"
)
@ApiModelProperty
(
"检测人员姓名"
)
private
Integer
userName
;
private
String
userName
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IConsumablesEnterService.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.ConsumablesEnter
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
IConsumablesEnterService
extends
IService
<
ConsumablesEnter
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IConsumablesOutService.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.ConsumablesOut
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
IConsumablesOutService
extends
IService
<
ConsumablesOut
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IConsumablesService.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Consumables
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
public
interface
IConsumablesService
extends
IService
<
Consumables
>
{
BaseResponse
<
IPage
<
Consumables
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
);
BaseResponse
<
Consumables
>
create
(
Consumables
query
);
BaseResponse
<
Consumables
>
update
(
Consumables
query
);
BaseResponse
<
String
>
enter
(
ChangeStockQuery
query
);
BaseResponse
<
String
>
out
(
ChangeStockQuery
query
);
BaseResponse
<
String
>
changeValidDate
(
ChangeValidDateQuery
query
);
BaseResponse
<
String
>
overdue
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/ConsumablesEnterServiceImpl.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.ConsumablesEnter
;
import
cn.wise.sc.cement.business.mapper.ConsumablesEnterMapper
;
import
cn.wise.sc.cement.business.service.IConsumablesEnterService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Service
public
class
ConsumablesEnterServiceImpl
extends
ServiceImpl
<
ConsumablesEnterMapper
,
ConsumablesEnter
>
implements
IConsumablesEnterService
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/ConsumablesOutServiceImpl.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.ConsumablesOut
;
import
cn.wise.sc.cement.business.mapper.ConsumablesOutMapper
;
import
cn.wise.sc.cement.business.service.IConsumablesOutService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Service
public
class
ConsumablesOutServiceImpl
extends
ServiceImpl
<
ConsumablesOutMapper
,
ConsumablesOut
>
implements
IConsumablesOutService
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/ConsumablesServiceImpl.java
0 → 100644
View file @
0c9af13e
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.ConsumablesEnterMapper
;
import
cn.wise.sc.cement.business.mapper.ConsumablesMapper
;
import
cn.wise.sc.cement.business.mapper.ConsumablesOutMapper
;
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.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.service.IConsumablesService
;
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
lombok.Builder
;
import
org.apache.commons.lang3.StringUtils
;
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
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-09-03
*/
@Service
public
class
ConsumablesServiceImpl
extends
ServiceImpl
<
ConsumablesMapper
,
Consumables
>
implements
IConsumablesService
{
@Resource
private
ConsumablesMapper
consumablesMapper
;
@Autowired
private
ISysUserService
userService
;
@Resource
private
ConsumablesEnterMapper
consumablesEnterMapper
;
@Resource
private
ConsumablesOutMapper
consumablesOutMapper
;
/**
* 分页查询
* @param pageQuery
* @param name
* @param supplierName
* @return
*/
@Override
public
BaseResponse
<
IPage
<
Consumables
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
)
{
QueryWrapper
<
Consumables
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotEmpty
(
name
)){
qw
.
like
(
"name"
,
name
);
}
if
(
StringUtils
.
isNotEmpty
(
supplierName
)){
qw
.
like
(
"supplier_name"
,
supplierName
);
}
qw
.
orderByDesc
(
"create_time"
);
IPage
<
Consumables
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
page
=
consumablesMapper
.
selectPage
(
page
,
qw
);
return
BaseResponse
.
okData
(
page
);
}
/**
* 新增消耗品
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
Consumables
>
create
(
Consumables
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"消耗品名称不能为空!"
);
}
QueryWrapper
<
Consumables
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
int
count
=
consumablesMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
query
.
setCreateTime
(
LocalDateTime
.
now
())
.
setStatus
(
1
);
consumablesMapper
.
insert
(
query
);
//消耗品入库记录添加
LoginUser
loginUser
=
userService
.
getLoginUser
();
ConsumablesEnter
enter
=
new
ConsumablesEnter
();
enter
.
setConsumablesId
(
query
.
getId
())
.
setUserId
(
loginUser
.
getId
())
.
setEnterNum
(
query
.
getStockNum
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
"新增消耗品"
);
consumablesEnterMapper
.
insert
(
enter
);
return
BaseResponse
.
okData
(
query
);
}
/**
* 修改消耗品
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
Consumables
>
update
(
Consumables
query
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"消耗品名称不能为空!"
);
}
QueryWrapper
<
Consumables
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"name"
,
query
.
getName
());
qw
.
ne
(
"id"
,
query
.
getId
());
int
count
=
consumablesMapper
.
selectCount
(
qw
);
if
(
count
>
0
)
{
return
BaseResponse
.
errorMsg
(
query
.
getName
()
+
"已存在"
);
}
consumablesMapper
.
updateById
(
query
);
return
BaseResponse
.
okData
(
query
);
}
/**
*新增入库
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
enter
(
ChangeStockQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
Consumables
consumables
=
consumablesMapper
.
selectById
(
query
.
getId
());
if
(
consumables
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
ConsumablesEnter
enter
=
new
ConsumablesEnter
();
enter
.
setConsumablesId
(
consumables
.
getId
())
.
setUserId
(
userService
.
getLoginUser
().
getId
())
.
setEnterNum
(
query
.
getChangeNum
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
query
.
getRemark
());
consumablesEnterMapper
.
insert
(
enter
);
consumables
.
setStockNum
(
consumables
.
getStockNum
().
add
(
enter
.
getEnterNum
()));
consumablesMapper
.
updateById
(
consumables
);
return
BaseResponse
.
okData
(
"新增入库完成"
);
}
/**
* 领用出库
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
out
(
ChangeStockQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
Consumables
consumables
=
consumablesMapper
.
selectById
(
query
.
getId
());
if
(
consumables
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
ConsumablesOut
out
=
new
ConsumablesOut
();
out
.
setConsumablesId
(
consumables
.
getId
())
.
setUserId
(
userService
.
getLoginUser
().
getId
())
.
setCollectNum
(
query
.
getChangeNum
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
query
.
getRemark
());
consumablesOutMapper
.
insert
(
out
);
consumables
.
setStockNum
(
consumables
.
getStockNum
().
subtract
(
out
.
getCollectNum
()));
consumablesMapper
.
updateById
(
consumables
);
return
BaseResponse
.
okData
(
"领用出库完成"
);
}
/**
* 变更有效期
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
changeValidDate
(
ChangeValidDateQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
Consumables
consumables
=
consumablesMapper
.
selectById
(
query
.
getId
());
if
(
consumables
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
consumables
.
setValidDate
(
query
.
getValidDate
());
consumablesMapper
.
updateById
(
consumables
);
return
BaseResponse
.
okData
(
"变更有效期完成"
);
}
/**
* 过期处置
* @param id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
overdue
(
Integer
id
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
Consumables
consumables
=
consumablesMapper
.
selectById
(
id
);
if
(
consumables
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
consumables
.
setStatus
(
0
);
consumablesMapper
.
updateById
(
consumables
);
return
BaseResponse
.
okData
(
"过期处置完成"
);
}
}
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