Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-acquisition
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
竹天卫
data-acquisition
Commits
634bc7c8
Commit
634bc7c8
authored
May 18, 2021
by
renchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产工序业务修改
parent
7e08c1ae
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
249 additions
and
208 deletions
+249
-208
TEquipmentRunServiceImpl.java
...ition/business/service/impl/TEquipmentRunServiceImpl.java
+79
-64
TMineWorkemployeesServiceImpl.java
.../business/service/impl/TMineWorkemployeesServiceImpl.java
+30
-3
TProcessesDiggingServiceImpl.java
...n/business/service/impl/TProcessesDiggingServiceImpl.java
+121
-107
TProcessesTruckServiceImpl.java
...ion/business/service/impl/TProcessesTruckServiceImpl.java
+17
-1
TSysDictServiceImpl.java
...cquisition/business/service/impl/TSysDictServiceImpl.java
+2
-2
DateUtil.java
...n/java/cn/wise/sc/acquisition/business/util/DateUtil.java
+0
-31
No files found.
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TEquipmentRunServiceImpl.java
View file @
634bc7c8
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
.
impl
;
import
cn.wise.im.common.http.R
;
import
cn.wise.im.common.http.ResponseEnum
;
import
cn.wise.sc.acquisition.business.constant.Rcode
;
import
cn.wise.sc.acquisition.business.entity.TEquipmentAccount
;
import
cn.wise.sc.acquisition.business.entity.TEquipmentCheck
;
...
...
@@ -13,12 +14,14 @@ import cn.wise.sc.acquisition.business.model.query.TEquipmentRunQuery;
import
cn.wise.sc.acquisition.business.model.vo.TEquipmentCheckVo
;
import
cn.wise.sc.acquisition.business.model.vo.TEquipmentRunVo
;
import
cn.wise.sc.acquisition.business.service.ITEquipmentRunService
;
import
cn.wise.sc.acquisition.business.service.ITSysDictService
;
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
;
...
...
@@ -29,7 +32,7 @@ import java.util.Map;
/**
* <p>
*
服务实现类
* 服务实现类
* </p>
*
* @author ztw
...
...
@@ -39,73 +42,85 @@ import java.util.Map;
@Transactional
public
class
TEquipmentRunServiceImpl
extends
ServiceImpl
<
TEquipmentRunMapper
,
TEquipmentRun
>
implements
ITEquipmentRunService
{
@Resource
private
TEquipmentRunMapper
equipmentRunMapper
;
@Resource
private
TEquipmentAccountMapper
equipmentAccountMapper
;
@Resource
private
TEquipmentRunMapper
equipmentRunMapper
;
@Resource
private
TEquipmentAccountMapper
equipmentAccountMapper
;
/**
* 设备运行分页
* @param pageQuery
* @param EquipmentName
* @return
*/
@Override
public
R
<
IPage
<
TEquipmentRunVo
>>
getPage
(
PageQuery
pageQuery
,
String
EquipmentName
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"EquipmentName"
,
EquipmentName
);
Page
<
TEquipmentRunVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
TEquipmentRunVo
>
pages
=
equipmentRunMapper
.
getPage
(
page
,
params
);
return
R
.
ok
(
pages
);
}
/**
* 设备运行详情
* @param EquipmentID
* @return
*/
@Override
public
R
<
TEquipmentRun
>
getDetail
(
String
EquipmentID
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
EquipmentID
);
TEquipmentAccount
account
=
equipmentAccountMapper
.
selectById
(
EquipmentID
);
Rcode
.
NOT_FOUND
.
assertNotNull
(
account
);
QueryWrapper
<
TEquipmentRun
>
checkWrapper
=
new
QueryWrapper
<>();
checkWrapper
.
eq
(
"EquipmentID"
,
account
.
getEquipmentID
());
List
<
TEquipmentRun
>
runList
=
equipmentRunMapper
.
selectList
(
checkWrapper
);
TEquipmentRun
run
=
null
;
if
(
runList
!=
null
&&
runList
.
size
()>
0
){
//已经点检过的
run
=
runList
.
get
(
0
);
}
else
{
run
=
new
TEquipmentRun
();
run
.
setEquipmentID
(
account
.
getEquipmentID
()).
setEquipmentName
(
account
.
getEquipmentName
());
}
Rcode
.
NOT_FOUND
.
assertNotNull
(
run
);
return
R
.
ok
(
run
);
}
/**
* 保存设备运行结果
* @param query
* @return
*/
@Override
public
R
running
(
TEquipmentRunQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getEquipmentID
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getEquipmentName
());
TEquipmentRun
run
=
new
TEquipmentRun
();
BeanUtils
.
copyProperties
(
query
,
run
);
//Uid=null新增,Uid!=null 修改
if
(
StringUtils
.
isNoneBlank
(
run
.
getUid
())){
equipmentRunMapper
.
updateById
(
run
);
}
else
{
equipmentRunMapper
.
insert
(
run
);
}
return
R
.
ok
();
}
@Autowired
private
ITSysDictService
itSysDictService
;
/**
* 设备运行分页
*
* @param pageQuery
* @param EquipmentName
* @return
*/
@Override
public
R
<
IPage
<
TEquipmentRunVo
>>
getPage
(
PageQuery
pageQuery
,
String
EquipmentName
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"EquipmentName"
,
EquipmentName
);
Page
<
TEquipmentRunVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
TEquipmentRunVo
>
pages
=
equipmentRunMapper
.
getPage
(
page
,
params
);
return
R
.
ok
(
pages
);
}
/**
* 设备运行详情
*
* @param EquipmentID
* @return
*/
@Override
public
R
<
TEquipmentRun
>
getDetail
(
String
EquipmentID
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
EquipmentID
);
TEquipmentAccount
account
=
equipmentAccountMapper
.
selectById
(
EquipmentID
);
Rcode
.
NOT_FOUND
.
assertNotNull
(
account
);
QueryWrapper
<
TEquipmentRun
>
checkWrapper
=
new
QueryWrapper
<>();
checkWrapper
.
eq
(
"EquipmentID"
,
account
.
getEquipmentID
());
List
<
TEquipmentRun
>
runList
=
equipmentRunMapper
.
selectList
(
checkWrapper
);
TEquipmentRun
run
=
null
;
if
(
runList
!=
null
&&
runList
.
size
()
>
0
)
{
//已经点检过的
run
=
runList
.
get
(
0
);
}
else
{
run
=
new
TEquipmentRun
();
run
.
setEquipmentID
(
account
.
getEquipmentID
()).
setEquipmentName
(
account
.
getEquipmentName
());
}
Rcode
.
NOT_FOUND
.
assertNotNull
(
run
);
return
R
.
ok
(
run
);
}
/**
* 保存设备运行结果
*
* @param query
* @return
*/
@Override
public
R
running
(
TEquipmentRunQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getEquipmentID
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getEquipmentName
());
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
()))
{
return
R
.
fail
(
ResponseEnum
.
FAIL
,
"设备运行中,tag不能修改或者添加"
);
}
TEquipmentRun
run
=
new
TEquipmentRun
();
BeanUtils
.
copyProperties
(
query
,
run
);
//Uid=null新增,Uid!=null 修改
if
(
StringUtils
.
isNoneBlank
(
run
.
getUid
()))
{
equipmentRunMapper
.
updateById
(
run
);
}
else
{
//设置tag
com
.
baomidou
.
mybatisplus
.
extension
.
api
.
R
r
=
itSysDictService
.
getTagDate
(
null
);
if
(
r
.
getCode
()
!=
0
)
{
return
R
.
fail
(
ResponseEnum
.
FAIL
,
r
.
getMsg
());
}
run
.
setTag
((
String
)
r
.
getData
());
equipmentRunMapper
.
insert
(
run
);
}
return
R
.
ok
();
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TMineWorkemployeesServiceImpl.java
View file @
634bc7c8
...
...
@@ -6,6 +6,7 @@ import cn.wise.sc.acquisition.business.enumation.ProjectEnum;
import
cn.wise.sc.acquisition.business.mapper.TMineWorkemployeesMapper
;
import
cn.wise.sc.acquisition.business.model.query.TMineWorkemployeesQuery
;
import
cn.wise.sc.acquisition.business.service.ITMineWorkemployeesService
;
import
cn.wise.sc.acquisition.business.service.ITSysDictService
;
import
cn.wise.sc.acquisition.business.util.BeanUtilsNewCopy
;
import
cn.wise.sc.acquisition.business.util.DateUtil
;
import
cn.wise.sc.acquisition.business.wrapper.page.Query
;
...
...
@@ -15,6 +16,8 @@ import com.baomidou.mybatisplus.extension.api.R;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
...
...
@@ -29,6 +32,9 @@ import org.springframework.stereotype.Service;
@Slf4j
public
class
TMineWorkemployeesServiceImpl
extends
ServiceImpl
<
TMineWorkemployeesMapper
,
TMineWorkemployees
>
implements
ITMineWorkemployeesService
{
@Autowired
private
ITSysDictService
itSysDictService
;
@Override
public
R
getPage
(
TMineWorkemployeesQuery
tMineWorkemployeesQuery
,
Query
query
)
{
log
.
info
(
JSON
.
toJSONString
(
tMineWorkemployeesQuery
));
...
...
@@ -57,9 +63,13 @@ public class TMineWorkemployeesServiceImpl extends ServiceImpl<TMineWorkemployee
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
//封装
QueryWrapper
<
TMineWorkemployees
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
query
.
getGzsj
()
!=
null
,
ProjectEnum
.
TMineWorkemployees
.
GZSJ
.
getLabel
(),
query
.
getGzsj
());
if
(
query
.
getGzsj
()
!=
null
)
{
queryWrapper
.
ge
(
ProjectEnum
.
TMineWorkemployees
.
GZSJ
.
getLabel
(),
DateUtil
.
getBeginTime
(
query
.
getGzsj
()))
.
le
(
ProjectEnum
.
TMineWorkemployees
.
GZSJ
.
getLabel
(),
DateUtil
.
getEndTime
(
query
.
getGzsj
()));
}
//查询并且返回
return
null
;
return
R
.
ok
(
baseMapper
.
selectOne
(
queryWrapper
))
;
}
@Override
...
...
@@ -71,13 +81,26 @@ public class TMineWorkemployeesServiceImpl extends ServiceImpl<TMineWorkemployee
if
(
query
.
getUid
()
!=
null
)
{
return
R
.
failed
(
"员工上班统计中->uid自动生成 不能手动设置"
);
}
//tag不能添加
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
()))
{
return
R
.
failed
(
"员工上班统计中->tag自动生成不能添加"
);
}
//上班日期不能重复
if
(
query
.
getGzsj
()
!=
null
)
{
R
r1
=
getByQuery
(
query
);
if
(
r1
.
getData
()
!=
null
)
return
R
.
failed
(
"员工上班统计中->上班日期已存在"
);
if
(
r1
.
getData
()
!=
null
)
{
return
R
.
failed
(
"员工上班统计中->上班日期已存在"
);
}
}
//封装
TMineWorkemployees
tMineWorkemployees
=
new
TMineWorkemployees
();
BeanUtilsNewCopy
.
copyPropertiesIgnoreNull
(
query
,
tMineWorkemployees
);
//设置tag
R
r1
=
itSysDictService
.
getTagDate
(
null
);
if
(
r1
.
getCode
()
!=
0
)
{
return
R
.
failed
(
r1
.
getMsg
());
}
tMineWorkemployees
.
setTag
((
String
)
r1
.
getData
());
//保存
int
insert
=
baseMapper
.
insert
(
tMineWorkemployees
);
if
(
insert
>
0
)
{
...
...
@@ -98,6 +121,10 @@ public class TMineWorkemployeesServiceImpl extends ServiceImpl<TMineWorkemployee
R
r1
=
getByQuery
(
query
);
if
(
r1
.
getData
()
!=
null
)
return
R
.
failed
(
"员工上班统计中->上班日期已存在,不能修改"
);
}
//tag不能添加
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
()))
{
return
R
.
failed
(
"员工上班统计中->tag自动生成不能修改"
);
}
//封装
TMineWorkemployees
tMineWorkemployees
=
new
TMineWorkemployees
();
BeanUtilsNewCopy
.
copyPropertiesIgnoreNull
(
query
,
tMineWorkemployees
);
...
...
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TProcessesDiggingServiceImpl.java
View file @
634bc7c8
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
.
impl
;
import
cn.wise.im.common.http.R
;
import
cn.wise.im.common.http.ResponseEnum
;
import
cn.wise.sc.acquisition.business.constant.Rcode
;
import
cn.wise.sc.acquisition.business.entity.TEquipmentAccount
;
import
cn.wise.sc.acquisition.business.entity.TProcessesDigging
;
...
...
@@ -9,6 +10,7 @@ import cn.wise.sc.acquisition.business.model.PageQuery;
import
cn.wise.sc.acquisition.business.model.query.TEquipmentAccountQuery
;
import
cn.wise.sc.acquisition.business.model.query.TProcessesDiggingQuery
;
import
cn.wise.sc.acquisition.business.service.ITProcessesDiggingService
;
import
cn.wise.sc.acquisition.business.service.ITSysDictService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -16,6 +18,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
io.swagger.annotations.ApiModelProperty
;
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
;
...
...
@@ -29,7 +32,7 @@ import java.util.Map;
/**
* <p>
*
服务实现类
* 服务实现类
* </p>
*
* @author ztw
...
...
@@ -39,112 +42,123 @@ import java.util.Map;
@Transactional
public
class
TProcessesDiggingServiceImpl
extends
ServiceImpl
<
TProcessesDiggingMapper
,
TProcessesDigging
>
implements
ITProcessesDiggingService
{
@Resource
private
TProcessesDiggingMapper
processesDiggingMapper
;
/**
* 今日数量统计
* @param digDate
* @return
*/
@Override
public
R
getTodayData
(
String
digDate
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
QueryWrapper
<
TProcessesDigging
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
digDate
)){
qw
.
apply
(
"DATE(DigDate) = digDate"
);
}
else
{
qw
.
apply
(
"DATE(DigDate) = DATE(now())"
);
}
List
<
TProcessesDigging
>
list
=
processesDiggingMapper
.
selectList
(
qw
);
Float
workTimes
=
list
.
stream
().
map
(
p
->
p
.
getWorkTime
()).
reduce
(
Float:
:
sum
).
get
();
Double
workLoads
=
list
.
stream
().
mapToDouble
(
TProcessesDigging:
:
getWorkload
).
sum
();
map
.
put
(
"workTimes"
,
workTimes
);
map
.
put
(
"workLoads"
,
workLoads
);
return
R
.
ok
(
map
);
}
/**
* 分页列表
* @param pageQuery
* @param digDate
* @return
*/
@Override
public
R
<
IPage
<
TProcessesDigging
>>
getPage
(
PageQuery
pageQuery
,
String
digDate
)
{
QueryWrapper
<
TProcessesDigging
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
digDate
))
{
try
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
startDate
=
digDate
+
" 00:00:00"
;
String
endDate
=
digDate
+
" 23:59:59"
;
qw
.
between
(
"DigDate"
,
formatter
.
parse
(
startDate
),
formatter
.
parse
(
endDate
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
qw
.
orderByDesc
(
"DigDate"
);
IPage
<
TProcessesDigging
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
page
=
processesDiggingMapper
.
selectPage
(
page
,
qw
);
return
R
.
ok
(
page
);
}
/**
* 新增
* @param query
* @return
*/
@Override
public
R
save
(
TProcessesDiggingQuery
query
){
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStopeName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStepName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getBlastAreaName
());
TProcessesDigging
digging
=
new
TProcessesDigging
();
BeanUtils
.
copyProperties
(
query
,
digging
);
processesDiggingMapper
.
insert
(
digging
);
return
R
.
ok
();
}
/**
* 修改
* @param query
* @return
*/
@Override
public
R
update
(
TProcessesDiggingQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getUid
());
TProcessesDigging
digging
=
processesDiggingMapper
.
selectById
(
query
.
getUid
());
Rcode
.
NOT_FOUND
.
assertNotNull
(
digging
);
BeanUtils
.
copyProperties
(
query
,
digging
);
processesDiggingMapper
.
updateById
(
digging
);
return
R
.
ok
();
}
/**
* 详情
* @param Uid
* @return
*/
@Override
public
R
<
TProcessesDigging
>
getDetail
(
String
Uid
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
Uid
);
TProcessesDigging
digging
=
processesDiggingMapper
.
selectById
(
Uid
);
Rcode
.
NOT_FOUND
.
assertNotNull
(
digging
);
return
R
.
ok
(
digging
);
}
@Resource
private
TProcessesDiggingMapper
processesDiggingMapper
;
@Autowired
private
ITSysDictService
itSysDictService
;
/**
* 今日数量统计
*
* @param digDate
* @return
*/
@Override
public
R
getTodayData
(
String
digDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
QueryWrapper
<
TProcessesDigging
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
digDate
))
{
qw
.
apply
(
"DATE(DigDate) = digDate"
);
}
else
{
qw
.
apply
(
"DATE(DigDate) = DATE(now())"
);
}
List
<
TProcessesDigging
>
list
=
processesDiggingMapper
.
selectList
(
qw
);
Float
workTimes
=
list
.
stream
().
map
(
p
->
p
.
getWorkTime
()).
reduce
(
Float:
:
sum
).
get
();
Double
workLoads
=
list
.
stream
().
mapToDouble
(
TProcessesDigging:
:
getWorkload
).
sum
();
map
.
put
(
"workTimes"
,
workTimes
);
map
.
put
(
"workLoads"
,
workLoads
);
return
R
.
ok
(
map
);
}
/**
* 分页列表
*
* @param pageQuery
* @param digDate
* @return
*/
@Override
public
R
<
IPage
<
TProcessesDigging
>>
getPage
(
PageQuery
pageQuery
,
String
digDate
)
{
QueryWrapper
<
TProcessesDigging
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
digDate
))
{
try
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
startDate
=
digDate
+
" 00:00:00"
;
String
endDate
=
digDate
+
" 23:59:59"
;
qw
.
between
(
"DigDate"
,
formatter
.
parse
(
startDate
),
formatter
.
parse
(
endDate
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
qw
.
orderByDesc
(
"DigDate"
);
IPage
<
TProcessesDigging
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
page
=
processesDiggingMapper
.
selectPage
(
page
,
qw
);
return
R
.
ok
(
page
);
}
/**
* 新增
*
* @param query
* @return
*/
@Override
public
R
save
(
TProcessesDiggingQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStopeName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStepName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getBlastAreaName
());
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
()))
{
return
R
.
fail
(
ResponseEnum
.
FAIL
,
"装车工序中->tag不能添加"
);
}
TProcessesDigging
digging
=
new
TProcessesDigging
();
BeanUtils
.
copyProperties
(
query
,
digging
);
//设置tag
com
.
baomidou
.
mybatisplus
.
extension
.
api
.
R
r
=
itSysDictService
.
getTagDate
(
null
);
if
(
r
.
getCode
()
!=
0
)
{
return
R
.
fail
(
ResponseEnum
.
FAIL
,
r
.
getMsg
());
}
digging
.
setTag
((
String
)
r
.
getData
());
processesDiggingMapper
.
insert
(
digging
);
return
R
.
ok
();
}
/**
* 修改
*
* @param query
* @return
*/
@Override
public
R
update
(
TProcessesDiggingQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getUid
());
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
()))
{
return
R
.
fail
(
ResponseEnum
.
FAIL
,
"装车工序中->tag不能修改"
);
}
TProcessesDigging
digging
=
processesDiggingMapper
.
selectById
(
query
.
getUid
());
Rcode
.
NOT_FOUND
.
assertNotNull
(
digging
);
BeanUtils
.
copyProperties
(
query
,
digging
);
processesDiggingMapper
.
updateById
(
digging
);
return
R
.
ok
();
}
/**
* 详情
*
* @param Uid
* @return
*/
@Override
public
R
<
TProcessesDigging
>
getDetail
(
String
Uid
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
Uid
);
TProcessesDigging
digging
=
processesDiggingMapper
.
selectById
(
Uid
);
Rcode
.
NOT_FOUND
.
assertNotNull
(
digging
);
return
R
.
ok
(
digging
);
}
}
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TProcessesTruckServiceImpl.java
View file @
634bc7c8
package
cn
.
wise
.
sc
.
acquisition
.
business
.
service
.
impl
;
import
cn.wise.im.common.http.R
;
import
cn.wise.im.common.http.ResponseEnum
;
import
cn.wise.sc.acquisition.business.constant.Rcode
;
import
cn.wise.sc.acquisition.business.entity.TProcessesTruck
;
import
cn.wise.sc.acquisition.business.entity.TProcessesTruck
;
...
...
@@ -8,12 +9,14 @@ import cn.wise.sc.acquisition.business.mapper.TProcessesTruckMapper;
import
cn.wise.sc.acquisition.business.model.PageQuery
;
import
cn.wise.sc.acquisition.business.model.query.TProcessesTruckQuery
;
import
cn.wise.sc.acquisition.business.service.ITProcessesTruckService
;
import
cn.wise.sc.acquisition.business.service.ITSysDictService
;
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
javax.annotation.Resource
;
...
...
@@ -37,7 +40,8 @@ public class TProcessesTruckServiceImpl extends ServiceImpl<TProcessesTruckMappe
@Resource
private
TProcessesTruckMapper
processesTruckMapper
;
@Autowired
private
ITSysDictService
itSysDictService
;
/**
* 今日数量统计
* @param deliveryDate
...
...
@@ -102,8 +106,16 @@ public class TProcessesTruckServiceImpl extends ServiceImpl<TProcessesTruckMappe
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStopeName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getStepName
());
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getBlastAreaName
());
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
())){
return
R
.
fail
(
ResponseEnum
.
FAIL
,
"运输工序中->tag不能添加"
);
}
TProcessesTruck
truck
=
new
TProcessesTruck
();
BeanUtils
.
copyProperties
(
query
,
truck
);
com
.
baomidou
.
mybatisplus
.
extension
.
api
.
R
r
=
itSysDictService
.
getTagDate
(
null
);
if
(
r
.
getCode
()!=
0
){
return
R
.
fail
(
ResponseEnum
.
FAIL
,
r
.
getMsg
());
}
truck
.
setTag
((
String
)
r
.
getData
());
processesTruckMapper
.
insert
(
truck
);
return
R
.
ok
();
}
...
...
@@ -117,9 +129,13 @@ public class TProcessesTruckServiceImpl extends ServiceImpl<TProcessesTruckMappe
public
R
update
(
TProcessesTruckQuery
query
)
{
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
);
Rcode
.
NOT_PARAM
.
assertNotNull
(
query
.
getUid
());
if
(
StringUtils
.
isNotBlank
(
query
.
getTag
())){
return
R
.
fail
(
ResponseEnum
.
FAIL
,
"运输工序中->tag不能修改"
);
}
TProcessesTruck
digging
=
processesTruckMapper
.
selectById
(
query
.
getUid
());
Rcode
.
NOT_FOUND
.
assertNotNull
(
digging
);
BeanUtils
.
copyProperties
(
query
,
digging
);
processesTruckMapper
.
updateById
(
digging
);
return
R
.
ok
();
}
...
...
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/service/impl/TSysDictServiceImpl.java
View file @
634bc7c8
...
...
@@ -56,10 +56,10 @@ public class TSysDictServiceImpl extends ServiceImpl<TSysDictMapper, TSysDict> i
if
(
dayOfMonth
>=
tagDate
)
{
//下一个月
now
.
plusMonths
(
1
);
return
R
.
ok
(
DateUtil
.
formatDat
eToStr
(
now
,
format
));
return
R
.
ok
(
DateUtil
.
tim
eToStr
(
now
,
format
));
}
else
{
//本月
return
R
.
ok
(
DateUtil
.
formatDat
eToStr
(
now
,
format
));
return
R
.
ok
(
DateUtil
.
tim
eToStr
(
now
,
format
));
}
}
...
...
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/util/DateUtil.java
View file @
634bc7c8
...
...
@@ -72,15 +72,6 @@ public class DateUtil {
}
/**
* 获取今天 返回String 例如参数为 2021-04-05 17:37:33 返回 2021-04-05 00.00.00
*
* @param localDateTime
* @return
*/
public
static
String
getTodayStr
(
LocalDateTime
localDateTime
,
String
format
)
{
return
formatDateToStr
(
localDateTime
,
format
);
}
/**
* 获取下一天 例如参数为 2021-04-05 17:37:33 返回 2021-04-06 00.00.00
...
...
@@ -93,15 +84,6 @@ public class DateUtil {
}
/**
* 获取下一天 返回String 例如参数为 2021-04-05 17:37:33 返回 2021-04-06 00.00.00
*
* @param localDateTime
* @return
*/
public
static
String
getTomorrowStr
(
LocalDateTime
localDateTime
,
String
format
)
{
return
formatDateToStr
(
localDateTime
.
plusDays
(
ONE
),
format
);
}
/**
...
...
@@ -120,19 +102,6 @@ public class DateUtil {
}
/**
* 按照参数格式化时间
*
* @param localDateTime
* @return
*/
public
static
String
formatDateToStr
(
LocalDateTime
localDateTime
,
String
format
)
{
if
(
localDateTime
==
null
)
throw
new
RuntimeException
(
"formatDate method:LocalDateTime localDateTime is null"
);
if
(
StringUtils
.
isBlank
(
format
))
throw
new
RuntimeException
(
"formatDate method:String format is null"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
format
);
return
sdf
.
format
(
localDateTime
);
}
/**
* 获取今天的最后一刻
...
...
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