Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
35dd4398
提交
35dd4398
authored
11月 02, 2021
作者:
ljj234
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(核查模块):修复核查模块修改单位名称后的显示问题
上级
77669f3d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
69 行增加
和
4 行删除
+69
-4
CheckInit.java
...va/com/tykj/dev/device/confirmcheck/common/CheckInit.java
+54
-0
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+0
-0
DeviceCheckDetail.java
.../device/confirmcheck/entity/domain/DeviceCheckDetail.java
+9
-2
ConfirmCheckServiceImpl.java
...ce/confirmcheck/service/impl/ConfirmCheckServiceImpl.java
+2
-0
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+1
-2
UnitsDao.java
...n/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
+3
-0
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CheckInit.java
0 → 100644
浏览文件 @
35dd4398
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
common
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @author Ozoz.L cnljj1995@gmail.com
* on 10/29/21
*/
@Slf4j
@Component
public
class
CheckInit
implements
CommandLineRunner
{
@Autowired
private
UnitsDao
unitsDao
;
@Autowired
private
DeviceCheckDetailDao
deviceCheckDetailDao
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
log
.
info
(
"[核查] 核查模块初进行初始化……"
);
initCheckDetailUnitName
();
}
private
void
initCheckDetailUnitName
()
{
// 对现有的数据补充unitId信息
deviceCheckDetailDao
.
findAll
().
forEach
(
this
::
saveModifyDetail
);
}
private
void
saveModifyDetail
(
DeviceCheckDetail
deviceCheckDetail
)
{
String
checkUnit
=
deviceCheckDetail
.
getCheckUnit
();
Integer
unitId
=
getUnitId
(
checkUnit
);
if
(
unitId
!=
-
1
)
{
deviceCheckDetail
.
setCheckUnitId
(
unitId
);
log
.
info
(
"[核查] 修正detail历史数据,修正的单位:{},单位id:{}"
,
checkUnit
,
unitId
);
deviceCheckDetailDao
.
save
(
deviceCheckDetail
);
}
}
private
Integer
getUnitId
(
String
unitName
)
{
List
<
Units
>
units
=
unitsDao
.
findAllByName
(
unitName
).
orElse
(
Collections
.
emptyList
());
return
units
.
size
()
==
1
?
units
.
get
(
0
).
getUnitId
()
:
-
1
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
35dd4398
差异被折叠。
点击展开。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckDetail.java
浏览文件 @
35dd4398
...
...
@@ -94,16 +94,19 @@ public class DeviceCheckDetail extends BaseEntity {
@ApiModelProperty
(
value
=
"核查单位"
)
private
String
checkUnit
;
@ApiModelProperty
(
value
=
"核查单位id"
)
private
Integer
checkUnitId
;
/**
* 应查数量
*/
@ApiModelProperty
(
value
=
"应查数量"
)
private
Integer
checkingCount
;
/**
* 实查数量
*/
@ApiModelProperty
(
value
=
"实查数量"
)
private
Integer
checkedCount
;
/**
...
...
@@ -183,6 +186,7 @@ public class DeviceCheckDetail extends BaseEntity {
Integer
userBId
,
Date
checkTime
,
String
checkUnit
,
Integer
checkUnitId
,
Integer
checkingCount
,
Integer
checkedCount
,
String
checkResult
,
...
...
@@ -197,6 +201,7 @@ public class DeviceCheckDetail extends BaseEntity {
this
.
userBId
=
userBId
;
this
.
checkTime
=
checkTime
;
this
.
checkUnit
=
checkUnit
;
this
.
checkUnitId
=
checkUnitId
;
this
.
checkingCount
=
checkingCount
;
this
.
checkedCount
=
checkedCount
;
this
.
checkResult
=
checkResult
;
...
...
@@ -219,6 +224,7 @@ public class DeviceCheckDetail extends BaseEntity {
Integer
userAId
,
Integer
userBId
,
String
checkUnit
,
Integer
checkUnitId
,
List
<
DeviceLibrary
>
devInLib
,
List
<
DeviceLibrary
>
devNotInLib
)
{
//构造checkDetail 分当前在库与不在库的 赋予不同状态
...
...
@@ -249,6 +255,7 @@ public class DeviceCheckDetail extends BaseEntity {
userBId
,
TimestampUtil
.
getNowDate
(),
checkUnit
,
checkUnitId
,
devInLib
.
size
(),
0
,
""
,
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/impl/ConfirmCheckServiceImpl.java
浏览文件 @
35dd4398
...
...
@@ -204,6 +204,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
baseTitle
,
0
,
0
,
0
,
0
,
cityUnit
.
getName
(),
cityUnit
.
getUnitId
(),
devInLib
.
getOrDefault
(
cityUnit
.
getName
(),
new
ArrayList
<>()),
devNotInLib
.
getOrDefault
(
cityUnit
.
getName
(),
new
ArrayList
<>()));
DeviceCheckDetail
cityDetail
=
detailRepo
.
save
(
cityDetailDo
);
...
...
@@ -230,6 +231,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
baseTitle
,
0
,
0
,
0
,
0
,
countyUnit
.
getName
(),
countyUnit
.
getUnitId
(),
devInLib
.
getOrDefault
(
countyUnit
.
getName
(),
new
ArrayList
<>()),
devNotInLib
.
getOrDefault
(
countyUnit
.
getName
(),
new
ArrayList
<>()));
DeviceCheckDetail
countyDetail
=
detailRepo
.
save
(
countyDetailDo
);
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
35dd4398
...
...
@@ -360,8 +360,7 @@ public class ObjTransUtil {
detailVo
.
setDevInLibrary
(
inLibVoList
);
detailVo
.
setDevNotInLibrary
(
notInLibVoList
);
String
unitName
=
detailDo
.
getCheckUnit
();
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitName
,
unitName
).
getName
();
String
areaName
=
auService
.
findOne
(
AuExample
.
UnitId
,
detailDo
.
getCheckUnitId
()).
getName
();
detailVo
.
setCheckArea
(
areaName
);
detailVo
.
setRemark
(
detailDo
.
getRemark
());
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UnitsDao.java
浏览文件 @
35dd4398
...
...
@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Optional
;
@Repository
public
interface
UnitsDao
extends
JpaRepository
<
Units
,
Integer
>,
JpaSpecificationExecutor
<
Units
>
{
...
...
@@ -14,6 +15,8 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
List
<
Units
>
findAllByAreaId
(
Integer
areaId
);
Optional
<
List
<
Units
>>
findAllByName
(
String
unitName
);
Units
findByName
(
String
unitName
);
List
<
Units
>
findAllByLevelGreaterThanEqual
(
Integer
level
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论