Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
7fcae706
Commit
7fcae706
authored
Nov 23, 2022
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
abf8023f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
240 additions
and
316 deletions
+240
-316
CheckEnum.java
.../com/yeejoin/amos/boot/module/ugp/api/Enum/CheckEnum.java
+22
-0
StageEnum.java
.../com/yeejoin/amos/boot/module/ugp/api/Enum/StageEnum.java
+2
-3
OpenDto.java
...ava/com/yeejoin/amos/boot/module/ugp/api/dto/OpenDto.java
+1
-1
SmartListDto.java
...om/yeejoin/amos/boot/module/ugp/api/dto/SmartListDto.java
+1
-1
VerifyMapper.xml
...module-ugp-api/src/main/resources/mapper/VerifyMapper.xml
+9
-2
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+2
-0
VerifyController.java
...amos/boot/module/ugp/biz/controller/VerifyController.java
+12
-2
InstallationQualityImpl.java
.../module/ugp/biz/service/impl/InstallationQualityImpl.java
+4
-11
VerifyServiceImpl.java
...s/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
+187
-296
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/CheckEnum.java
0 → 100644
View file @
7fcae706
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
CheckEnum
{
符合
(
"accord"
,
"符合"
),
不符合
(
"accord"
,
"不符合"
),
有效
(
"valid"
,
"有效"
),
已过期
(
"valid"
,
"已过期"
),
合格期内
(
"peopleStatus"
,
"合格期内"
),
超期未检
(
"peopleStatus"
,
"超期未检"
);
String
key
;
String
name
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/StageEnum.java
View file @
7fcae706
...
@@ -15,9 +15,9 @@ import java.util.Map;
...
@@ -15,9 +15,9 @@ import java.util.Map;
@AllArgsConstructor
@AllArgsConstructor
public
enum
StageEnum
{
public
enum
StageEnum
{
焊前人员
(
""
,
"STAFF"
,
"人员"
),
焊前人员
(
"
焊前确定
"
,
"STAFF"
,
"人员"
),
焊前设备
(
"焊前确定"
,
"EQUIPMENT"
,
"设备"
),
焊前设备
(
"焊前确定"
,
"EQUIPMENT"
,
"设备"
),
焊前管材质量
(
""
,
"BEFORE-WELDING"
,
"管材"
),
焊前管材质量
(
"
焊前确定
"
,
"BEFORE-WELDING"
,
"管材"
),
焊接工艺
(
"工艺确定"
,
"CRAFT"
,
"工艺"
),
焊接工艺
(
"工艺确定"
,
"CRAFT"
,
"工艺"
),
管道耐压
(
"耐压确定"
,
"VOLTAGE"
,
"耐压"
),
管道耐压
(
"耐压确定"
,
"VOLTAGE"
,
"耐压"
),
敷设质量
(
"敷设确定"
,
"LAY"
,
"敷设"
),
敷设质量
(
"敷设确定"
,
"LAY"
,
"敷设"
),
...
@@ -26,7 +26,6 @@ public enum StageEnum {
...
@@ -26,7 +26,6 @@ public enum StageEnum {
private
String
name
;
private
String
name
;
private
String
stage
;
private
String
stage
;
private
String
verifyName
;
private
String
verifyName
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/OpenDto.java
View file @
7fcae706
...
@@ -15,6 +15,6 @@ public class OpenDto {
...
@@ -15,6 +15,6 @@ public class OpenDto {
private
String
accord
;
//符合性
private
String
accord
;
//符合性
private
String
valid
;
//有效性
private
String
valid
;
//有效性
private
String
result
;
//结果
private
String
result
;
//结果
private
Long
detailId
;
//跳转id
private
String
detailId
;
//跳转id 或者管材编码
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/SmartListDto.java
View file @
7fcae706
...
@@ -112,5 +112,5 @@ public class SmartListDto extends BaseDto {
...
@@ -112,5 +112,5 @@ public class SmartListDto extends BaseDto {
private
Long
welderId
;
private
Long
welderId
;
private
Long
weldingId
;
private
Long
weldingId
;
private
Long
materialId
;
private
String
materialCode
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/VerifyMapper.xml
View file @
7fcae706
...
@@ -77,9 +77,15 @@
...
@@ -77,9 +77,15 @@
<select
id=
"selectByWelder"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.entity.Verify"
>
<select
id=
"selectByWelder"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.entity.Verify"
>
SELECT * FROM tz_ugp_verify where
SELECT * FROM tz_ugp_verify
<where>
<if
test=
"projectId !=null and projectId !=''"
>
project_id =#{projectId}
project_id =#{projectId}
and target_info -> "$.welderId" = #{welderId}
</if>
<if
test=
"welderId !=null and welderId !=''"
>
and
target_info -> "$.welderId" = #{welderId}
</if>
<if
test=
"code !=null and code !=''"
>
<if
test=
"code !=null and code !=''"
>
and
and
target_info -> "$.code" =#{code}
target_info -> "$.code" =#{code}
...
@@ -91,6 +97,7 @@
...
@@ -91,6 +97,7 @@
and
and
target_info -> "$.random" =#{random}
target_info -> "$.random" =#{random}
</if>
</if>
</where>
</select>
</select>
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
7fcae706
...
@@ -230,4 +230,6 @@ public class MaterialController extends BaseController {
...
@@ -230,4 +230,6 @@ public class MaterialController extends BaseController {
attachmentMapper
.
deleteBySourceId
(
sequenceNbr
);
attachmentMapper
.
deleteBySourceId
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
removeById
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
removeById
(
sequenceNbr
));
}
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/VerifyController.java
View file @
7fcae706
...
@@ -295,8 +295,18 @@ public class VerifyController extends BaseController {
...
@@ -295,8 +295,18 @@ public class VerifyController extends BaseController {
page
.
setRecords
(
verifyServiceImpl
.
selectById
(
sequenceNbr
));
page
.
setRecords
(
verifyServiceImpl
.
selectById
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
page
);
return
ResponseHelper
.
buildResponse
(
page
);
}
}
/**
* cpp
* 耐压所属焊口查看
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/lookWeld"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"耐压所属焊口查看"
,
notes
=
"耐压所属焊口查看"
)
public
ResponseModel
<
JSONObject
>
lookWeld
(
@RequestParam
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
verifyServiceImpl
.
getWeldLook
(
sequenceNbr
));
}
}
}
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/InstallationQualityImpl.java
View file @
7fcae706
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PercentOfPassDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
...
@@ -27,6 +28,7 @@ import java.util.HashSet;
...
@@ -27,6 +28,7 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* @Author cpp
* @Author cpp
...
@@ -100,7 +102,6 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
...
@@ -100,7 +102,6 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
for
(
PercentOfPassDto
pr
:
list
)
{
for
(
PercentOfPassDto
pr
:
list
)
{
//获取项目id
//获取项目id
Long
projectId
=
pr
.
getProjectId
(
);
Long
projectId
=
pr
.
getProjectId
(
);
//通过项目id查询焊口数据
//通过项目id查询焊口数据
List
<
WeldDto
>
weldDtoList
=
weldService
.
getProjectId
(
projectId
);
List
<
WeldDto
>
weldDtoList
=
weldService
.
getProjectId
(
projectId
);
...
@@ -108,24 +109,16 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
...
@@ -108,24 +109,16 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
//获取焊口信息总条数
//获取焊口信息总条数
int
sum
=
weldDtoList
.
size
(
);
int
sum
=
weldDtoList
.
size
(
);
//焊口合格数
//焊口合格数
int
qualifiedData
=
0
;
List
<
WeldDto
>
collect
=
weldDtoList
.
stream
(
).
filter
(
weld
->
StageEnum
.
焊接工艺
.
getName
(
).
equals
(
weld
.
getSuperInspecStatus
(
))).
collect
(
Collectors
.
toList
(
));
for
(
WeldDto
weldDto
:
weldDtoList
)
{
int
qualifiedData
=
collect
.
size
();
String
superInspecStatus
=
weldDto
.
getSuperInspecStatus
(
);
if
(
superInspecStatus
.
equals
(
"合格"
))
{
qualifiedData
++;
}
}
//合格率
//合格率
BigDecimal
sums
=
new
BigDecimal
(
sum
);
BigDecimal
sums
=
new
BigDecimal
(
sum
);
BigDecimal
qualifiedDatas
=
new
BigDecimal
(
qualifiedData
);
BigDecimal
qualifiedDatas
=
new
BigDecimal
(
qualifiedData
);
Double
pass
=
qualifiedDatas
.
divide
(
sums
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100
)).
doubleValue
(
);
Double
pass
=
qualifiedDatas
.
divide
(
sums
,
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100
)).
doubleValue
(
);
//转换成百分比,生成合格率
//转换成百分比,生成合格率
String
fpy
=
pass
.
toString
(
)
+
"%"
;
String
fpy
=
pass
.
toString
(
)
+
"%"
;
//将合格率赋值给数据集合
//将合格率赋值给数据集合
pr
.
setPercentOfPass
(
fpy
);
pr
.
setPercentOfPass
(
fpy
);
//将数据添加到新集合里面
//将数据添加到新集合里面
newsData
.
add
(
pr
);
newsData
.
add
(
pr
);
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/VerifyServiceImpl.java
View file @
7fcae706
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.*
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ImageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService
;
...
@@ -32,6 +17,7 @@ import org.apache.commons.lang.StringUtils;
...
@@ -32,6 +17,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.ValidationUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -50,8 +36,10 @@ import java.text.SimpleDateFormat;
...
@@ -50,8 +36,10 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.*
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
org
.
springframework
.
data
.
elasticsearch
.
annotations
.
DateFormat
.
year
;
/**
/**
...
@@ -129,10 +117,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -129,10 +117,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* stage 阶段
* stage 阶段
* page 分页
* page 分页
*/
*/
private
static
final
String
HEGE
=
"合格期内"
;
private
static
final
String
NOTHEGE
=
"超期未检"
;
public
Page
<
SmartListDto
>
commonality
(
String
stage
,
Page
<
SmartListDto
>
page
,
SmartListDto
smartListDto
){
public
Page
<
SmartListDto
>
commonality
(
String
stage
,
Page
<
SmartListDto
>
page
,
SmartListDto
smartListDto
){
//新加获取项目列表
//新加获取项目列表
List
<
Project
>
projectList
=
projectResourceService
.
getProjectList
(
);
List
<
Project
>
projectList
=
projectResourceService
.
getProjectList
(
);
List
<
Long
>
listId
=
new
ArrayList
<>(
);
List
<
Long
>
listId
=
new
ArrayList
<>(
);
...
@@ -143,7 +130,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -143,7 +130,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
listId
!=
null
&&
listId
.
size
()>
0
)
{
if
(
listId
!=
null
&&
listId
.
size
()>
0
)
{
verifyList
=
verifyMapper
.
commonality
(
stage
,
smartListDto
,
listId
);
verifyList
=
verifyMapper
.
commonality
(
stage
,
smartListDto
,
listId
);
}
}
List
<
SmartListDto
>
dtoList
=
new
ArrayList
<>();
List
<
SmartListDto
>
dtoList
=
new
ArrayList
<>();
//进入焊前
//进入焊前
if
(
verifyList
!=
null
&&
verifyList
.
size
()
!=
0
){
if
(
verifyList
!=
null
&&
verifyList
.
size
()
!=
0
){
...
@@ -153,17 +139,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -153,17 +139,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
dto
.
setProjectId
(
verify
.
getProjectId
());
//项目id
dto
.
setProjectId
(
verify
.
getProjectId
());
//项目id
dto
.
setName
(
verify
.
getProject
().
getName
());
//项目名称
dto
.
setName
(
verify
.
getProject
().
getName
());
//项目名称
dto
.
setProjectCode
(
verify
.
getProject
().
getCode
());
//项目编号
dto
.
setProjectCode
(
verify
.
getProject
().
getCode
());
//项目编号
//检验检测单位id 检验负责人id 监检员id(后续需修改)
Long
verifyUnitId
=
verify
.
getVerifyUnitId
(
);
Long
chargerPersonId
=
verify
.
getChargerPersonId
(
);
Long
inspectorId
=
verify
.
getInspectorId
(
);
if
(
inspectorId
!=
null
&&
chargerPersonId
!=
null
&&
verifyUnitId
!=
null
)
{
dto
.
setCompanyName
(
"检测单位"
);
dto
.
setUsrName
(
"检验负责人"
);
dto
.
setInspector
(
"监检员"
);
}
//检验状态
//检验状态
String
status
=
verify
.
getStatus
(
);
String
status
=
verify
.
getStatus
(
);
if
(
status
.
equals
(
VerifyEnum
.
已通过
.
getStatus
()))
{
if
(
status
.
equals
(
VerifyEnum
.
已通过
.
getStatus
()))
{
...
@@ -173,13 +148,14 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -173,13 +148,14 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
dto
.
setStatus
(
VerifyEnum
.
未通过
.
getName
());
dto
.
setStatus
(
VerifyEnum
.
未通过
.
getName
());
}
}
dto
.
setType
(
verify
.
getType
());
//检验方式
dto
.
setType
(
verify
.
getType
());
//检验方式
Date
verifyTime
=
verify
.
getVerifyTime
(
);
dto
.
setSubmitTime
(
verify
.
getVerifyTime
());
//交检日期
dto
.
setSubmitTime
(
verify
.
getVerifyTime
());
//交检日期
dto
.
setVerifyTime
(
verify
.
getVerifyTime
());
//检验时间
dto
.
setVerifyTime
(
verify
.
getVerifyTime
());
//检验时间
String
stage1
=
verify
.
getStage
(
);
//检验检测阶段
String
stage1
=
verify
.
getStage
(
);
//检验检测阶段
Map
<
String
,
String
>
map
=
StageEnum
.
getStatusByVerifyNameMap
;
Map
<
String
,
String
>
map
=
StageEnum
.
getStatusByVerifyNameMap
;
for
(
String
key:
map
.
keySet
()){
for
(
String
key:
map
.
keySet
()){
if
(
key
.
equals
(
stage1
))
{
if
(
key
.
equals
(
stage1
))
{
dto
.
setStage
(
map
.
get
(
key
).
toString
(
));
//将阶段赋值
dto
.
setStage
(
String
.
valueOf
(
map
.
get
(
key
)
));
//将阶段赋值
}
}
}
}
String
targetInfo
=
verify
.
getTargetInfo
();
//app上传数据
String
targetInfo
=
verify
.
getTargetInfo
();
//app上传数据
...
@@ -196,7 +172,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -196,7 +172,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(!
StringUtils
.
isEmpty
(
location
))
{
if
(!
StringUtils
.
isEmpty
(
location
))
{
dto
.
setPeopleLocation
(
location
);
dto
.
setPeopleLocation
(
location
);
}
}
Long
welderId
=
jsonObject
.
getLong
(
"welderId"
);
Long
welderId
=
jsonObject
.
getLong
(
"welderId"
);
if
(
welderId
!=
null
)
{
if
(
welderId
!=
null
)
{
dto
.
setWelderId
(
welderId
);
dto
.
setWelderId
(
welderId
);
...
@@ -210,24 +185,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -210,24 +185,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
}
}
}
}
//人员持证判断
//人员持证判断
设备检定状态 管材质量许可
String
peopleStatus
=
jsonObject
.
getString
(
"peopleStatus"
);
String
peopleStatus
=
jsonObject
.
getString
(
"peopleStatus"
);
if
(!
StringUtils
.
isEmpty
(
peopleStatus
))
{
if
(!
StringUtils
.
isEmpty
(
peopleStatus
))
{
dto
.
setPeopleStatus
(
peopleStatus
);
dto
.
setPeopleStatus
(
peopleStatus
);
dto
.
setFacilityStatus
(
peopleStatus
);
dto
.
setPermission
(
peopleStatus
);
}
}
//设备检定状态
String
facilityStatus
=
jsonObject
.
getString
(
"peopleStatus"
);
if
(!
StringUtils
.
isEmpty
(
facilityStatus
))
{
dto
.
setFacilityStatus
(
facilityStatus
);
}
//焊接工艺时长
String
duration
=
jsonObject
.
getString
(
"peopleStatus"
);
if
(!
StringUtils
.
isEmpty
(
duration
))
{
dto
.
setFacilityStatus
(
duration
);
}
Long
weldingId
=
jsonObject
.
getLong
(
"weldingId"
);
Long
weldingId
=
jsonObject
.
getLong
(
"weldingId"
);
if
(
weldingId
!=
null
)
{
if
(
weldingId
!=
null
)
{
dto
.
setWeldingId
(
weldingId
);
dto
.
setWeldingId
(
weldingId
);
...
@@ -238,27 +202,26 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -238,27 +202,26 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
dto
.
setFacilityNumber
(
equipmentDto
.
getCode
());
dto
.
setFacilityNumber
(
equipmentDto
.
getCode
());
}
}
}
}
String
materiaCode
=
jsonObject
.
getString
(
"materialId"
);
Long
materialId
=
jsonObject
.
getLong
(
"materialId"
);
if
(!
ValidationUtil
.
isEmpty
(
materiaCode
))
{
if
(
materialId
!=
null
)
{
//管材编号
dto
.
setMaterialId
(
materialId
);
dto
.
setMaterialCode
(
materiaCode
);
MaterialDto
materialDto
=
materialService
.
queryBySeq
(
materialId
);
Material
material
=
materialService
.
getMaterial
(
materiaCode
);
if
(
materialDto
!=
null
)
{
if
(
material
!=
null
)
{
//管材厂家 生产编号
//管材厂家 管材批号
dto
.
setManufacturer
(
materialDto
.
getManufacturer
());
dto
.
setManufacturer
(
material
.
getManufacturer
());
dto
.
setBatchNumber
(
materialDto
.
getBatchNum
());
dto
.
setBatchNumber
(
material
.
getCode
());
}
}
}
String
permission
=
jsonObject
.
getString
(
"permission"
);
if
(!
StringUtils
.
isEmpty
(
permission
))
{
dto
.
setPermission
(
permission
);
}
}
//工艺
//工艺
String
craft
=
jsonObject
.
getString
(
"craft"
);
String
craft
=
jsonObject
.
getString
(
"craft"
);
if
(!
StringUtils
.
isEmpty
(
craft
))
{
if
(!
StringUtils
.
isEmpty
(
craft
))
{
dto
.
setCraft
(
craft
);
dto
.
setCraft
(
craft
);
}
}
String
duration
=
jsonObject
.
getString
(
"duration"
);
if
(!
StringUtils
.
isEmpty
(
duration
))
{
dto
.
setDuration
(
duration
);
}
//耐压
//耐压
Long
pressureId
=
jsonObject
.
getLong
(
"pressureId"
);
Long
pressureId
=
jsonObject
.
getLong
(
"pressureId"
);
if
(
pressureId
!=
null
)
{
if
(
pressureId
!=
null
)
{
...
@@ -272,6 +235,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -272,6 +235,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(!
StringUtils
.
isEmpty
(
pressureTest
))
{
if
(!
StringUtils
.
isEmpty
(
pressureTest
))
{
dto
.
setMpa
(
pressureTest
);
dto
.
setMpa
(
pressureTest
);
}
}
String
pressureNumber
=
jsonObject
.
getString
(
"pressureNumber"
);
if
(!
ValidationUtil
.
isEmpty
(
pressureNumber
))
{
dto
.
setPressureNumber
(
pressureNumber
);
}
//埋深
//埋深
String
depthType
=
jsonObject
.
getString
(
"depthType"
);
String
depthType
=
jsonObject
.
getString
(
"depthType"
);
if
(!
StringUtils
.
isEmpty
(
depthType
))
{
if
(!
StringUtils
.
isEmpty
(
depthType
))
{
...
@@ -290,17 +257,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -290,17 +257,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(!
StringUtils
.
isEmpty
(
resuts
))
{
if
(!
StringUtils
.
isEmpty
(
resuts
))
{
dto
.
setResuts
(
resuts
);
dto
.
setResuts
(
resuts
);
}
}
//这些后面只需要删除即可
dto
.
setPeopleStatus
(
"合格期内"
);
dto
.
setFacilityStatus
(
"合格期内"
);
dto
.
setDuration
(
"6"
);
dto
.
setPressureNumber
(
"1xm001"
);
dto
.
setResuts
(
"合格"
);
dtoList
.
add
(
dto
);
dtoList
.
add
(
dto
);
}
}
}
}
page
.
setRecords
(
dtoList
);
page
.
setRecords
(
dtoList
);
...
@@ -309,8 +266,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -309,8 +266,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
page
;
return
page
;
}
}
/** cpp
/** cpp
* 智能监检校验数据
* 智能监检校验数据
* @param jsonObject
* @param jsonObject
...
@@ -337,10 +292,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -337,10 +292,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
verify
.
setProjectId
(
projectId
);
//项目id
verify
.
setProjectId
(
projectId
);
//项目id
verify
.
setType
(
TYPE
);
//检验方式
verify
.
setType
(
TYPE
);
//检验方式
verify
.
setVerifyTime
(
time
);
//获取当前时间
verify
.
setVerifyTime
(
time
);
//获取当前时间
List
<
Verify
>
verifyList
=
verifyMapper
.
selectByWelder
(
projectId
,
welderId
,
null
,
null
,
random
);
/**这里json*/
List
<
Verify
>
verifyList
=
verifyMapper
.
selectByWelder
(
projectId
,
welderId
,
null
,
null
,
random
);
//人员
//人员
if
(
stage
.
equals
(
StageEnum
.
焊前人员
.
getVerifyName
()))
{
if
(
stage
.
equals
(
StageEnum
.
焊前人员
.
getVerifyName
()))
{
verify
.
setStage
(
StageEnum
.
焊前人员
.
getStage
());
//阶段
verify
.
setStage
(
StageEnum
.
焊前人员
.
getStage
());
//阶段
//人脸
//人脸
//1.人脸识别校验
//1.人脸识别校验
...
@@ -348,12 +302,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -348,12 +302,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//3.证书是否和项目符合
//3.证书是否和项目符合
//失败
//失败
//属性赋值
//属性赋值
jsonObject
.
put
(
"accord"
,
"符合"
);
jsonObject
.
put
(
CheckEnum
.
符合
.
getKey
(),
CheckEnum
.
符合
.
getName
());
//人脸
if
(
welderId
!=
null
)
{
if
(
welderId
!=
null
)
{
Map
map
=
orgService
.
getdetialInfo
(
welderId
.
toString
(
));
Map
map
=
orgService
.
getdetialInfo
(
welderId
.
toString
(
));
String
certValidDate
=
String
.
valueOf
(
map
.
get
(
"certValidDate"
));
String
certValidDate
=
String
.
valueOf
(
map
.
get
(
"certValidDate"
));
if
(
certValidDate
!=
null
&&
!
certValidDate
.
equals
(
""
))
{
if
(!
ValidationUtil
.
isEmpty
(
certValidDate
))
{
Date
vaildParse
=
null
;
Date
vaildParse
=
null
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
try
{
...
@@ -361,27 +316,24 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -361,27 +316,24 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
(
);
e
.
printStackTrace
(
);
}
}
if
(
time
.
compareTo
(
vaildParse
)
<=
0
)
{
if
(
time
.
compareTo
(
vaildParse
)
<=
0
)
{
jsonObject
.
put
(
"valid"
,
"有效"
);
jsonObject
.
put
(
CheckEnum
.
有效
.
getKey
(),
CheckEnum
.
有效
.
getName
());
jsonObject
.
put
(
CheckEnum
.
合格期内
.
getKey
(),
CheckEnum
.
合格期内
.
getName
());
}
else
{
}
else
{
jsonObject
.
put
(
"valid"
,
"已过期"
);
jsonObject
.
put
(
CheckEnum
.
已过期
.
getKey
(),
CheckEnum
.
已过期
.
getName
());
jsonObject
.
put
(
CheckEnum
.
超期未检
.
getKey
(),
CheckEnum
.
超期未检
.
getName
());
}
}
}
}
}
}
Boolean
flag
=
true
;
Boolean
flag
=
true
;
if
(!
"符合"
.
equals
(
jsonObject
.
getString
(
"accord"
))
||
!
"有效"
.
equals
(
jsonObject
.
getString
(
"valid"
)))
{
if
(!
CheckEnum
.
符合
.
getName
().
equals
(
jsonObject
.
getString
(
CheckEnum
.
符合
.
getKey
()))
||
!
CheckEnum
.
有效
.
getName
().
equals
(
jsonObject
.
getString
(
CheckEnum
.
有效
.
getKey
())))
{
flag
=
false
;
flag
=
false
;
}
}
jsonObject
.
put
(
"peopleStatus"
,
"合格"
);
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
//json信息
if
(!
flag
)
{
if
(!
flag
)
{
jsonObject
.
put
(
"peopleStatus"
,
"不合格"
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
(),
null
);
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//成功
//成功
...
@@ -389,67 +341,53 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -389,67 +341,53 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
//管材
//管材
if
(
stage
.
equals
(
StageEnum
.
焊前管材质量
.
getVerifyName
())){
if
(
stage
.
equals
(
StageEnum
.
焊前管材质量
.
getVerifyName
())){
//从图片中获取管材编号materialId
//管材未校验,进行效验步骤
// Long materialId = jsonObject.getLong("materialId");//管材id
//从图片中获取管材编号
String
materialCode
=
jsonObject
.
getString
(
"materialId"
);
//管材编号(暂时写死)
String
materialCode
=
"1585520415743176365"
;
verify
.
setStage
(
StageEnum
.
焊前管材质量
.
getStage
());
verify
.
setStage
(
StageEnum
.
焊前管材质量
.
getStage
());
/**校验*/
/**校验*/
Boolean
flag
=
false
;
Boolean
flag
=
false
;
if
(!
ValidationUtil
.
isEmpty
(
materialCode
))
{
if
(!
ValidationUtil
.
isEmpty
(
materialCode
))
{
Material
material
=
materialService
.
getMaterial
(
materialCode
);
Material
material
=
materialService
.
getMaterial
(
materialCode
);
if
(!
ValidationUtil
.
isEmpty
(
material
))
{
if
(!
ValidationUtil
.
isEmpty
(
material
))
{
jsonObject
.
put
(
"valid"
,
"有效"
);
jsonObject
.
put
(
CheckEnum
.
有效
.
getKey
(),
CheckEnum
.
有效
.
getName
());
jsonObject
.
put
(
"accord"
,
"符合"
);
jsonObject
.
put
(
CheckEnum
.
符合
.
getKey
(),
CheckEnum
.
符合
.
getName
());
if
(!
ValidationUtil
.
isEmpty
(
material
.
getManufacturer
()))
{
if
(
StringUtils
.
isNotEmpty
(
material
.
getManufacturer
()))
{
jsonObject
.
put
(
"manufacturer"
,
material
.
getManufacturer
());
jsonObject
.
put
(
"manufacturer"
,
material
.
getManufacturer
());
}
}
if
(
StringUtils
.
isNot
Empty
(
material
.
getBatchNum
()))
{
if
(
!
ValidationUtil
.
is
Empty
(
material
.
getBatchNum
()))
{
jsonObject
.
put
(
"batchNumber"
,
material
.
getBatchNum
());
jsonObject
.
put
(
"batchNumber"
,
material
.
getBatchNum
());
}
}
jsonObject
.
put
(
"permission"
,
"合格期内"
);
jsonObject
.
put
(
CheckEnum
.
合格期内
.
getKey
(),
CheckEnum
.
合格期内
.
getName
()
);
flag
=
true
;
flag
=
true
;
}
else
{
}
else
{
jsonObject
.
put
(
"valid"
,
"已超期"
);
jsonObject
.
put
(
CheckEnum
.
已过期
.
getKey
(),
CheckEnum
.
已过期
.
getName
()
);
jsonObject
.
put
(
"accord"
,
"不符合"
);
jsonObject
.
put
(
CheckEnum
.
不符合
.
getKey
(),
CheckEnum
.
不符合
.
getName
()
);
jsonObject
.
put
(
"permission"
,
"不合格"
);
jsonObject
.
put
(
CheckEnum
.
超期未检
.
getKey
(),
CheckEnum
.
超期未检
.
getName
()
);
}
}
}
}
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
if
(!
flag
)
{
if
(!
flag
)
{
//不通过, 添加数据并返回未通过结果
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
(),
null
);
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//校验通过
this
.
addSuccessData
(
verify
,
null
,
jsonObject
);
this
.
addSuccessData
(
verify
,
null
,
jsonObject
);
}
}
//设备
//设备
if
(
stage
.
equals
(
StageEnum
.
焊前设备
.
getVerifyName
())){
if
(
stage
.
equals
(
StageEnum
.
焊前设备
.
getVerifyName
())){
verify
.
setStage
(
StageEnum
.
焊前设备
.
getStage
());
verify
.
setStage
(
StageEnum
.
焊前设备
.
getStage
());
Long
weldingId
=
jsonObject
.
getLong
(
"weldingId"
);
Long
weldingId
=
jsonObject
.
getLong
(
"weldingId"
);
/**
* 效验假数据
*/
Boolean
flag
=
false
;
Boolean
flag
=
false
;
//后面需要修改此处
//后面需要修改此处
if
(!
ValidationUtil
.
isEmpty
(
weldingId
))
{
if
(!
ValidationUtil
.
isEmpty
(
weldingId
))
{
Equipment
equipment
=
equipmentService
.
getEquipment
(
weldingId
);
Equipment
equipment
=
equipmentService
.
getEquipment
(
weldingId
);
if
(!
ValidationUtil
.
isEmpty
(
equipment
))
{
if
(!
ValidationUtil
.
isEmpty
(
equipment
))
{
jsonObject
.
put
(
"valid"
,
"有效"
);
jsonObject
.
put
(
CheckEnum
.
有效
.
getKey
(),
CheckEnum
.
有效
.
getName
()
);
jsonObject
.
put
(
"accord"
,
"符合"
);
jsonObject
.
put
(
CheckEnum
.
符合
.
getKey
(),
CheckEnum
.
符合
.
getName
()
);
jsonObject
.
put
(
"facilityStatus"
,
"合格期内"
);
jsonObject
.
put
(
CheckEnum
.
合格期内
.
getKey
(),
CheckEnum
.
合格期内
.
getName
()
);
if
(
StringUtils
.
isNotEmpty
(
equipment
.
getName
()))
{
if
(
StringUtils
.
isNotEmpty
(
equipment
.
getName
()))
{
jsonObject
.
put
(
"facilityName"
,
equipment
.
getName
());
jsonObject
.
put
(
"facilityName"
,
equipment
.
getName
());
...
@@ -460,17 +398,16 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -460,17 +398,16 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
flag
=
true
;
flag
=
true
;
}
else
{
}
else
{
jsonObject
.
put
(
"valid"
,
"已超期"
);
jsonObject
.
put
(
CheckEnum
.
已过期
.
getKey
(),
CheckEnum
.
已过期
.
getName
()
);
jsonObject
.
put
(
"accord"
,
"不符合"
);
jsonObject
.
put
(
CheckEnum
.
不符合
.
getKey
(),
CheckEnum
.
不符合
.
getName
()
);
jsonObject
.
put
(
"facilityStatus"
,
"不合格"
);
jsonObject
.
put
(
CheckEnum
.
超期未检
.
getKey
(),
CheckEnum
.
超期未检
.
getName
()
);
}
}
}
}
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
//json信息
if
(!
flag
)
{
if
(!
flag
)
{
//校验不通过
//校验不通过
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
()
,
null
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -507,41 +444,21 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -507,41 +444,21 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
}
}
//判断这个工艺是否已经校验
//获取前端传的焊口编号(工艺阶段焊口编号必传)
/* String code = jsonObject.getString("code");//焊口编号
if (StringUtils.isEmpty(code)) {
return VerifyEnum.未通过.getName();
}
//通过项目id 用户id 焊口编号来确定工艺阶段
List<Verify> list= verifyMapper.selectByWelder(projectId, welderId, code,null);
List<Verify> collect = list.stream( ).filter(b -> b.getStage( ).equals(StageEnum.焊接工艺.getStage( ))).collect(Collectors.toList( ));
if (collect != null && collect.size()>0) {
for (Verify v1 : collect) {
if (v1 != null) {
if (v1.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (v1.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}
}
}*/
//如果焊前效验已经通过进行效验步骤
//如果焊前效验已经通过进行效验步骤
Boolean
flag
=
false
;
Boolean
flag
=
false
;
verify
.
setStage
(
StageEnum
.
焊接工艺
.
getStage
());
verify
.
setStage
(
StageEnum
.
焊接工艺
.
getStage
());
String
result
=
jsonObject
.
getString
(
"result"
);
String
result
=
jsonObject
.
getString
(
"result"
);
if
(
VerifyEnum
.
已通过
.
getName
()
.
equals
(
result
))
{
if
(
"ok"
.
equals
(
result
))
{
flag
=
true
;
flag
=
true
;
}
}
jsonObject
.
put
(
"duration"
,
"
前端传的
时长"
);
jsonObject
.
put
(
"duration"
,
"时长"
);
jsonObject
.
put
(
"facilityNumber"
,
"
前端传的
焊机编号"
);
jsonObject
.
put
(
"facilityNumber"
,
"焊机编号"
);
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setCode
(
code
);
if
(!
flag
)
{
if
(!
flag
)
{
//校验不通过
//校验不通过
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
()
,
null
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -570,42 +487,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -570,42 +487,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
}
}
}
}
//管道耐压是否已经校验,获取头部和尾部焊口,耐压之测头部和尾部
/* Verify v = verifyMapper.selectByCode(manyCode, projectId, StageEnum.管道耐压.getStage());
if (v !=null && v.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (v !=null && v.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}*/
/* if (codeArray !=null && codeArray.length>=2) {
String startCode=codeArray[0] ;
String endCode = codeArray[codeArray.length-1];
List<Verify> startList = verifyMapper.selectByWelder(projectId, welderId, startCode,StageEnum.管道耐压.getStage());
List<Verify> endList = verifyMapper.selectByWelder(projectId, welderId, endCode,StageEnum.管道耐压.getStage());
if (startList !=null &&endList != null &&startList.size()>0 && endList.size()>0 ) {
for (Verify startVerity : startList) {
if (startVerity.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (startVerity.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}
for (Verify endVerity : endList) {
if (endVerity.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (endVerity.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}
}
}*/
//如果工艺效验已经通过进行耐压校验步骤,(特别注意,只需要效验头部和尾部耐压)
//如果工艺效验已经通过进行耐压校验步骤,(特别注意,只需要效验头部和尾部耐压)
verify
.
setStage
(
StageEnum
.
管道耐压
.
getStage
());
verify
.
setStage
(
StageEnum
.
管道耐压
.
getStage
());
verify
.
setCode
(
manyCode
);
verify
.
setCode
(
manyCode
);
...
@@ -613,11 +494,19 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -613,11 +494,19 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* 效验假数据
* 效验假数据
*/
*/
Boolean
flag
=
true
;
Boolean
flag
=
true
;
Calendar
calendar
=
Calendar
.
getInstance
();
String
year
=
String
.
valueOf
(
calendar
.
get
(
Calendar
.
YEAR
));
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
int
day
=
calendar
.
get
(
Calendar
.
DATE
);
StringBuffer
stringBuffer
=
new
StringBuffer
(
);
stringBuffer
.
append
(
year
).
append
(
month
).
append
(
day
).
append
(
"-"
)
.
append
(
UUID
.
randomUUID
().
toString
().
substring
(
UUID
.
randomUUID
().
toString
().
length
()-
4
));
jsonObject
.
put
(
"pressureNumber"
,
stringBuffer
.
toString
());
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
//json信息
if
(!
flag
)
{
if
(!
flag
)
{
//校验不通过
//校验不通过
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
()
,
codeArray
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -625,7 +514,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -625,7 +514,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
//埋深
//埋深
if
(
stage
.
equals
(
StageEnum
.
敷设质量
.
getVerifyName
())){
if
(
stage
.
equals
(
StageEnum
.
敷设质量
.
getVerifyName
())){
//查询耐压是否校验通过
//查询耐压是否校验通过
String
manyCode
=
jsonObject
.
getString
(
"manyCode"
);
//获取多个焊口编号
String
manyCode
=
jsonObject
.
getString
(
"manyCode"
);
//获取多个焊口编号
if
(
StringUtils
.
isEmpty
(
manyCode
))
{
if
(
StringUtils
.
isEmpty
(
manyCode
))
{
...
@@ -640,17 +528,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -640,17 +528,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
verify1
!=
null
&&
verify1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
if
(
verify1
!=
null
&&
verify1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//耐压校验已经通过,埋深是否已经校验
/*Verify v = verifyMapper.selectByCode(manyCode, projectId, StageEnum.敷设质量.getStage());
if (v != null) {
if (v.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (v.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}*/
//耐压校验已经通过,进行埋深校验
//耐压校验已经通过,进行埋深校验
verify
.
setStage
(
StageEnum
.
敷设质量
.
getStage
());
verify
.
setStage
(
StageEnum
.
敷设质量
.
getStage
());
verify
.
setCode
(
manyCode
);
verify
.
setCode
(
manyCode
);
...
@@ -658,14 +535,12 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -658,14 +535,12 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* 效验假数据
* 效验假数据
*/
*/
Boolean
flag
=
true
;
Boolean
flag
=
true
;
jsonObject
.
put
(
"facilityName"
,
"前端传的焊机名称"
);
String
targetInfo
=
jsonObject
.
toString
();
String
targetInfo
=
jsonObject
.
toString
();
verify
.
setTargetInfo
(
targetInfo
);
//json信息
verify
.
setTargetInfo
(
targetInfo
);
//json信息
if
(!
flag
)
{
if
(!
flag
)
{
//校验不通过
//校验不通过
String
[]
codeArray
=
manyCode
.
split
(
","
);
String
[]
codeArray
=
manyCode
.
split
(
","
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
()
,
codeArray
);
this
.
addFailData
(
verify
,
jsonObject
,
new
QualityProblem
());
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -688,16 +563,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -688,16 +563,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
v1
!=
null
&&
v1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
if
(
v1
!=
null
&&
v1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
/*//埋深校验已经通过,定位是否已经校验
Verify v = verifyMapper.selectByCode(manyCode, projectId, StageEnum.定位.getStage());
if (v != null) {
if (v.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (v.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}*/
//耐压校验已经通过,没有埋深数据,进行埋深校验
//耐压校验已经通过,没有埋深数据,进行埋深校验
verify
.
setStage
(
StageEnum
.
定位
.
getStage
());
verify
.
setStage
(
StageEnum
.
定位
.
getStage
());
verify
.
setCode
(
manyCode
);
verify
.
setCode
(
manyCode
);
...
@@ -712,7 +577,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -712,7 +577,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//校验不通过
//校验不通过
QualityProblem
qp
=
new
QualityProblem
(
);
QualityProblem
qp
=
new
QualityProblem
(
);
String
[]
codeArray
=
manyCode
.
split
(
","
);
String
[]
codeArray
=
manyCode
.
split
(
","
);
this
.
addFailData
(
verify
,
jsonObject
,
qp
,
codeArray
);
this
.
addFailData
(
verify
,
jsonObject
,
qp
);
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -734,16 +599,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -734,16 +599,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
v1
!=
null
&&
v1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
if
(
v1
!=
null
&&
v1
.
getStatus
().
equals
(
VerifyEnum
.
未通过
.
getStatus
()))
{
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
/* //定位校验已经通过,回填是否已经校验
Verify v2 = verifyMapper.selectByCode(manyCode, projectId, StageEnum.回填.getStage());
if (v2 != null) {
if (v2.getStatus().equals(VerifyEnum.未通过.getStatus())) {
return VerifyEnum.未通过.getName();
}
if (v2.getStatus().equals(VerifyEnum.已通过.getStatus())) {
return VerifyEnum.已通过.getName();
}
}*/
//定位校验已经通过,没有回填数据,进行回填校验
//定位校验已经通过,没有回填数据,进行回填校验
verify
.
setStage
(
StageEnum
.
回填
.
getStage
());
verify
.
setStage
(
StageEnum
.
回填
.
getStage
());
verify
.
setCode
(
manyCode
);
verify
.
setCode
(
manyCode
);
...
@@ -756,8 +611,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -756,8 +611,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(!
flag
)
{
if
(!
flag
)
{
//校验不通过
//校验不通过
QualityProblem
qualityProblem
=
new
QualityProblem
(
);
QualityProblem
qualityProblem
=
new
QualityProblem
(
);
String
[]
codeArray
=
manyCode
.
split
(
","
);
this
.
addFailData
(
verify
,
jsonObject
,
qualityProblem
);
this
.
addFailData
(
verify
,
jsonObject
,
qualityProblem
,
codeArray
);
return
VerifyEnum
.
未通过
.
getName
();
return
VerifyEnum
.
未通过
.
getName
();
}
}
//效验通过
//效验通过
...
@@ -769,51 +623,40 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -769,51 +623,40 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
VerifyEnum
.
已通过
.
getName
();
return
VerifyEnum
.
已通过
.
getName
();
}
}
/** cpp
/** cpp
* 校验失败需要添加的数据
* 校验失败需要添加的数据
* @param verify
* @param verify
* @param qualityProblem
* @param qualityProblem
*/
*/
public
void
addFailData
(
Verify
verify
,
JSONObject
jsonObject
,
QualityProblem
qualityProblem
,
String
[]
codeArray
){
// 静态变量存储最大值
private
static
final
AtomicInteger
atomicNum
=
new
AtomicInteger
(
1
);
public
void
addFailData
(
Verify
verify
,
JSONObject
jsonObject
,
QualityProblem
qualityProblem
){
//校验不通过,存入校验信息,
//校验不通过,存入校验信息,
verify
.
setStatus
(
VerifyEnum
.
未通过
.
getStatus
());
verify
.
setStatus
(
VerifyEnum
.
未通过
.
getStatus
());
try
{
try
{
//智能监检管理表添加数据
//智能监检管理表添加数据
boolean
save
=
this
.
save
(
verify
);
boolean
save
=
this
.
save
(
verify
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
//质量问题表添加数据
//质量问题表添加数据
qualityProblem
.
setProjectId
(
verify
.
getProjectId
());
qualityProblem
.
setProjectId
(
verify
.
getProjectId
());
qualityProblem
.
setSubmitDate
(
new
Date
());
qualityProblem
.
setSubmitDate
(
new
Date
());
//随机生成四位数
Calendar
calendar
=
Calendar
.
getInstance
();
String
random
=
String
.
valueOf
((
int
)
((
Math
.
random
(
)
*
9
+
1
)
*
1000
));
// 获取当前年
if
(
codeArray
==
null
||
codeArray
.
length
==
0
)
{
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
// 获取当前月
String
code
=
jsonObject
.
getString
(
"code"
);
//获取焊口编码
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
if
(
StringUtils
.
isNotEmpty
(
code
))
{
// 获取当前日
//焊前
int
day
=
calendar
.
get
(
Calendar
.
DATE
);
qualityProblem
.
setCode
(
code
+
"-WT"
+
random
);
StringBuffer
stringBuffer
=
new
StringBuffer
(
);
}
else
{
stringBuffer
.
append
(
year
).
append
(
month
).
append
(
day
);
qualityProblem
.
setCode
(
jsonObject
.
getLong
(
"random"
)+
"-WT"
+
random
);
String
date
=
stringBuffer
.
toString
(
);
}
//获取当前的值并自增
int
newNum
=
atomicNum
.
incrementAndGet
(
);
}
String
code
=
String
.
format
(
date
+
"-WT-"
+
"%05d"
,
newNum
);
if
(
codeArray
!=
null
&&
codeArray
.
length
>
0
)
{
qualityProblem
.
setCode
(
code
);
for
(
String
code
:
codeArray
)
{
if
(!
StringUtils
.
isEmpty
(
jsonObject
.
getString
(
code
)))
{
qualityProblem
.
setCode
(
code
+
"-WT"
+
random
);
}
}
}
String
stage
=
jsonObject
.
getString
(
"stage"
);
//获取效验阶段
String
stage
=
jsonObject
.
getString
(
"stage"
);
//获取效验阶段
qualityProblem
.
setGenerateStage
(
stage
);
qualityProblem
.
setGenerateStage
(
stage
);
qualityProblem
.
setProblemDescribe
(
stage
+
"不通过"
);
qualityProblem
.
setProblemDescribe
(
stage
+
"不通过"
);
...
@@ -824,10 +667,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -824,10 +667,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
qualityProblemService
.
save
(
qualityProblem
);
qualityProblemService
.
save
(
qualityProblem
);
problemInitiationService
.
start
(
qualityProblem
);
problemInitiationService
.
start
(
qualityProblem
);
}
}
/** cpp
/** cpp
* 校验成功需要添加的数据
* 校验成功需要添加的数据
* @param verify
* @param verify
...
@@ -836,9 +675,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -836,9 +675,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public
void
addSuccessData
(
Verify
verify
,
String
[]
codeArray
,
JSONObject
js
){
public
void
addSuccessData
(
Verify
verify
,
String
[]
codeArray
,
JSONObject
js
){
//效验通过状态
//效验通过状态
verify
.
setStatus
(
VerifyEnum
.
已通过
.
getStatus
());
verify
.
setStatus
(
VerifyEnum
.
已通过
.
getStatus
());
try
{
try
{
//智能监检管理表添加数据
//智能监检管理表添加数据
this
.
save
(
verify
);
this
.
save
(
verify
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -871,7 +708,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -871,7 +708,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
if
(
codeArray
!=
null
&&
codeArray
.
length
>
0
)
{
if
(
codeArray
!=
null
&&
codeArray
.
length
>
0
)
{
for
(
String
code
:
codeArray
)
{
for
(
String
code
:
codeArray
)
{
if
(!
StringUtils
.
isEmpty
(
code
)&&
verify
.
getProjectId
()
!=
null
)
{
if
(!
ValidationUtil
.
isEmpty
(
code
)&&
verify
.
getProjectId
()
!=
null
)
{
Weld
weld
=
weldMapper
.
getWeldByCodeAndProjectId
(
code
,
verify
.
getProjectId
());
Weld
weld
=
weldMapper
.
getWeldByCodeAndProjectId
(
code
,
verify
.
getProjectId
());
if
(
weld
!=
null
)
{
if
(
weld
!=
null
)
{
//判断是哪一个阶段
//判断是哪一个阶段
...
@@ -880,20 +717,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -880,20 +717,13 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//修改的值
//修改的值
String
name
=
mapEnum
.
get
(
stage
);
String
name
=
mapEnum
.
get
(
stage
);
weld
.
setSuperInspecStatus
(
name
);
//更改监检状态
weld
.
setSuperInspecStatus
(
name
);
//更改监检状态
try
{
weldMapper
.
updateById
(
weld
);
//修改
int
i
=
weldMapper
.
updateById
(
weld
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
}
}
}
}
}
}
}
}
}
}
}
/**
/**
* 弹窗
* 弹窗
* @param sequenceNbr
* @param sequenceNbr
...
@@ -911,11 +741,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -911,11 +741,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(!
StringUtils
.
isEmpty
(
newPhoto
))
{
if
(!
StringUtils
.
isEmpty
(
newPhoto
))
{
openDto
.
setNewPhoto
(
newPhoto
);
openDto
.
setNewPhoto
(
newPhoto
);
}
}
if
(
VerifyEnum
.
未通过
.
getStatus
().
equals
(
verify
.
getStatus
()))
{
if
(
verify
.
getStatus
().
equals
(
"0"
))
{
openDto
.
setResult
(
VerifyEnum
.
未通过
.
getName
());
openDto
.
setResult
(
VerifyEnum
.
未通过
.
getName
());
}
}
if
(
verify
.
getStatus
().
equals
(
"1"
))
{
if
(
VerifyEnum
.
已通过
.
getStatus
().
equals
(
verify
.
getStatus
()
))
{
openDto
.
setResult
(
VerifyEnum
.
已通过
.
getName
());
openDto
.
setResult
(
VerifyEnum
.
已通过
.
getName
());
}
}
//有效性
//有效性
...
@@ -931,9 +760,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -931,9 +760,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
StageEnum
.
焊前人员
.
getStage
().
equals
(
verify
.
getStage
()))
{
if
(
StageEnum
.
焊前人员
.
getStage
().
equals
(
verify
.
getStage
()))
{
Long
welderId
=
object
.
getLong
(
"welderId"
);
Long
welderId
=
object
.
getLong
(
"welderId"
);
if
(
welderId
!=
null
)
{
if
(
welderId
!=
null
)
{
openDto
.
setDetailId
(
welderId
);
openDto
.
setDetailId
(
String
.
valueOf
(
welderId
)
);
//焊工的老照片
//焊工的老照片
Map
map
=
orgService
.
getdetialInfo
(
welderId
.
toString
(
));
Map
map
=
orgService
.
getdetialInfo
(
welderId
.
toString
(
));
if
(!
ValidationUtil
.
isEmpty
(
map
))
{
if
(!
ValidationUtil
.
isEmpty
(
map
))
{
String
image
=
String
.
valueOf
(
map
.
get
(
"image"
))
;
String
image
=
String
.
valueOf
(
map
.
get
(
"image"
))
;
...
@@ -957,41 +785,40 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -957,41 +785,40 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
if
(
StageEnum
.
焊前设备
.
getStage
().
equals
(
verify
.
getStage
()))
{
if
(
StageEnum
.
焊前设备
.
getStage
().
equals
(
verify
.
getStage
()))
{
Long
weldingId
=
object
.
getLong
(
"weldingId"
);
Long
weldingId
=
object
.
getLong
(
"weldingId"
);
if
(
weldingId
!=
null
)
{
if
(
weldingId
!=
null
)
{
openDto
.
setDetailId
(
weldingId
);
openDto
.
setDetailId
(
String
.
valueOf
(
weldingId
)
);
String
image
=
this
.
getImage
(
weldingId
);
String
image
=
this
.
getImage
(
weldingId
);
if
(
StringUtils
.
isNot
Empty
(
image
))
{
if
(
!
ValidationUtil
.
is
Empty
(
image
))
{
openDto
.
setOldPhoto
(
image
);
openDto
.
setOldPhoto
(
image
);
}
}
}
}
}
}
if
(
StageEnum
.
焊前管材质量
.
getStage
().
equals
(
verify
.
getStage
()))
{
if
(
StageEnum
.
焊前管材质量
.
getStage
().
equals
(
verify
.
getStage
()))
{
Long
materialId
=
object
.
getLong
(
"materialId"
);
// 改为管材编号materialId
if
(
materialId
!=
null
)
{
String
materialCode
=
object
.
getString
(
"materialId"
);
openDto
.
setDetailId
(
materialId
);
if
(!
ValidationUtil
.
isEmpty
(
materialCode
))
{
String
image
=
this
.
getImage
(
materialId
);
openDto
.
setDetailId
(
materialCode
);
//管材的编号
if
(
StringUtils
.
isNotEmpty
(
image
))
{
Material
material
=
materialService
.
getMaterial
(
materialCode
);
if
(!
ValidationUtil
.
isEmpty
(
material
))
{
Long
sequenceNbr1
=
material
.
getSequenceNbr
(
);
//管材id
if
(!
ValidationUtil
.
isEmpty
(
sequenceNbr1
))
{
String
image
=
this
.
getImage
(
sequenceNbr1
);
if
(!
ValidationUtil
.
isEmpty
(
image
))
{
openDto
.
setOldPhoto
(
image
);
openDto
.
setOldPhoto
(
image
);
}
}
}
}
}
}
}
}
}
}
ArrayList
<
OpenDto
>
list
=
new
ArrayList
<>(
);
ArrayList
<
OpenDto
>
list
=
new
ArrayList
<>(
);
list
.
add
(
openDto
);
list
.
add
(
openDto
);
return
list
;
return
list
;
}
}
// 图片公共方法
// 图片公共方法
public
String
getImage
(
Long
id
){
public
String
getImage
(
Long
id
){
String
oldPhoto
=
null
;
String
oldPhoto
=
null
;
if
(
id
!=
null
)
{
if
(
id
!=
null
)
{
AttachmentDto
enuipment
=
attachmentService
.
getAttachment
(
id
);
AttachmentDto
enuipment
=
attachmentService
.
getAttachment
(
id
);
if
(
enuipment
!=
null
)
{
if
(
enuipment
!=
null
)
{
String
info
=
enuipment
.
getInfo
(
);
String
info
=
enuipment
.
getInfo
(
);
if
(
StringUtils
.
isNotEmpty
(
info
))
{
if
(
StringUtils
.
isNotEmpty
(
info
))
{
...
@@ -1004,7 +831,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -1004,7 +831,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
JSONObject
object2
=
JSONObject
.
parseObject
(
o1
.
toString
(
));
JSONObject
object2
=
JSONObject
.
parseObject
(
o1
.
toString
(
));
oldPhoto
=
object2
.
getString
(
"url"
);
oldPhoto
=
object2
.
getString
(
"url"
);
if
(
StringUtils
.
isNotEmpty
(
oldPhoto
))
{
if
(
StringUtils
.
isNotEmpty
(
oldPhoto
))
{
String
[]
split
=
oldPhoto
.
split
(
"."
);
String
[]
split
=
oldPhoto
.
split
(
"."
);
//不区分大小写.jpe .JPE,需要转换成小写写
//不区分大小写.jpe .JPE,需要转换成小写写
String
suffix
=
split
[
split
.
length
-
1
].
toLowerCase
(
);
String
suffix
=
split
[
split
.
length
-
1
].
toLowerCase
(
);
...
@@ -1012,7 +838,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -1012,7 +838,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
suffix
.
contains
(
ImageEnum
.
JPG
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
JPEG
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
JPG
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
JPEG
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
BMP
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
PSD
.
getName
()))
{
suffix
.
contains
(
ImageEnum
.
BMP
.
getName
())
||
suffix
.
contains
(
ImageEnum
.
PSD
.
getName
()))
{
return
oldPhoto
;
return
oldPhoto
;
}
}
}
}
}
}
...
@@ -1023,11 +848,77 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
...
@@ -1023,11 +848,77 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return
oldPhoto
;
return
oldPhoto
;
}
}
private
static
final
String
HEGE
=
"合格"
;
private
static
final
String
NOTHEGE
=
"不合格"
;
//耐压所属焊口查看
public
JSONObject
getWeldLook
(
Long
sequenceNbr
){
JSONObject
object
=
new
JSONObject
(
);
if
(
sequenceNbr
!=
null
)
{
Verify
verify
=
verifyMapper
.
selectById
(
sequenceNbr
);
//耐压信息
if
(
verify
!=
null
)
{
String
codes
=
verify
.
getCode
(
);
if
(!
ValidationUtil
.
isEmpty
(
codes
))
{
String
[]
codeArray
=
codes
.
split
(
","
);
for
(
String
code
:
codeArray
)
{
//查工艺
object
.
put
(
"code"
,
code
);
String
targetInfo
=
verify
.
getTargetInfo
(
);
if
(!
ValidationUtil
.
isEmpty
(
targetInfo
))
{
List
<
Verify
>
verifyList
=
verifyMapper
.
selectByWelder
(
verify
.
getProjectId
(
),
null
,
code
,
StageEnum
.
焊接工艺
.
getStage
(
),
null
);
Verify
verify1
=
verifyList
.
stream
(
).
max
((
d1
,
d2
)
->
d1
.
getVerifyTime
(
).
compareTo
(
d2
.
getVerifyTime
(
))).
orElse
(
null
);
JSONObject
craftInfo
=
null
;
if
(
verify1
!=
null
)
{
String
status
=
verify
.
getStatus
(
);
if
(
VerifyEnum
.
已通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"craftStatus"
,
HEGE
);
}
if
(
VerifyEnum
.
未通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"craftStatus"
,
NOTHEGE
);
}
String
targetInfo1
=
verify1
.
getTargetInfo
(
);
craftInfo
=
JSONObject
.
parseObject
(
targetInfo1
);
String
location
=
(
String
)
craftInfo
.
get
(
"location"
);
object
.
put
(
"location"
,
location
);
}
List
<
Verify
>
verifyPeople
=
verifyMapper
.
selectByWelder
(
verify1
.
getProjectId
(
),
(
Long
)
craftInfo
.
get
(
"welderId"
),
null
,
StageEnum
.
焊前人员
.
getStage
(
),
(
Long
)
craftInfo
.
get
(
"random"
));
List
<
Verify
>
verifyEquipment
=
verifyMapper
.
selectByWelder
(
verify1
.
getProjectId
(
),
(
Long
)
craftInfo
.
get
(
"welderId"
),
null
,
StageEnum
.
焊前设备
.
getStage
(
),
(
Long
)
craftInfo
.
get
(
"random"
));
List
<
Verify
>
verifyMaterial
=
verifyMapper
.
selectByWelder
(
verify1
.
getProjectId
(
),
(
Long
)
craftInfo
.
get
(
"welderId"
),
null
,
StageEnum
.
焊前管材质量
.
getStage
(
),
(
Long
)
craftInfo
.
get
(
"random"
));
Verify
vp
=
verifyPeople
.
stream
(
).
max
((
d1
,
d2
)
->
d1
.
getVerifyTime
(
).
compareTo
(
d2
.
getVerifyTime
(
))).
orElse
(
null
);
Verify
ve
=
verifyEquipment
.
stream
(
).
max
((
d1
,
d2
)
->
d1
.
getVerifyTime
(
).
compareTo
(
d2
.
getVerifyTime
(
))).
orElse
(
null
);
Verify
vm
=
verifyMaterial
.
stream
(
).
max
((
d1
,
d2
)
->
d1
.
getVerifyTime
(
).
compareTo
(
d2
.
getVerifyTime
(
))).
orElse
(
null
);
if
(
vp
!=
null
)
{
String
status
=
vp
.
getStatus
();
if
(
VerifyEnum
.
已通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"peopleStatus"
,
HEGE
);
}
if
(
VerifyEnum
.
未通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"peopleStatus"
,
NOTHEGE
);
}
}
if
(
ve
!=
null
)
{
String
status
=
ve
.
getStatus
();
if
(
VerifyEnum
.
已通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"equipmentStatus"
,
HEGE
);
}
if
(
VerifyEnum
.
未通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"equipmentStatus"
,
NOTHEGE
);
}
}
if
(
vm
!=
null
)
{
String
status
=
vm
.
getStatus
();
if
(
VerifyEnum
.
已通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"materialStatus"
,
HEGE
);
}
if
(
VerifyEnum
.
未通过
.
getStatus
().
equals
(
status
))
{
object
.
put
(
"materialStatus"
,
NOTHEGE
);
}
}
}
}
}
}
}
return
object
;
}
}
}
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