Commit 7fcae706 authored by 曹盼盼's avatar 曹盼盼

修改

parent abf8023f
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;
}
......@@ -15,9 +15,9 @@ import java.util.Map;
@AllArgsConstructor
public enum StageEnum {
焊前人员("","STAFF","人员"),
焊前人员("焊前确定","STAFF","人员"),
焊前设备("焊前确定","EQUIPMENT","设备"),
焊前管材质量("","BEFORE-WELDING","管材"),
焊前管材质量("焊前确定","BEFORE-WELDING","管材"),
焊接工艺("工艺确定","CRAFT","工艺"),
管道耐压("耐压确定","VOLTAGE","耐压"),
敷设质量("敷设确定","LAY","敷设"),
......@@ -26,7 +26,6 @@ public enum StageEnum {
private String name;
private String stage;
private String verifyName;
......
......@@ -15,6 +15,6 @@ public class OpenDto {
private String accord; //符合性
private String valid; //有效性
private String result;//结果
private Long detailId;//跳转id
private String detailId;//跳转id 或者管材编码
}
......@@ -112,5 +112,5 @@ public class SmartListDto extends BaseDto {
private Long welderId;
private Long weldingId;
private Long materialId;
private String materialCode;
}
......@@ -77,9 +77,15 @@
<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}
and target_info -> "$.welderId" = #{welderId}
</if>
<if test="welderId !=null and welderId !=''">
and
target_info -> "$.welderId" = #{welderId}
</if>
<if test="code !=null and code !=''">
and
target_info -> "$.code" =#{code}
......@@ -91,6 +97,7 @@
and
target_info -> "$.random" =#{random}
</if>
</where>
</select>
......
......@@ -230,4 +230,6 @@ public class MaterialController extends BaseController {
attachmentMapper.deleteBySourceId(sequenceNbr);
return ResponseHelper.buildResponse(materialServiceImpl.removeById(sequenceNbr));
}
}
......@@ -295,8 +295,18 @@ public class VerifyController extends BaseController {
page.setRecords(verifyServiceImpl.selectById(sequenceNbr));
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));
}
}
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
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.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.WeldDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
......@@ -27,6 +28,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Author cpp
......@@ -100,7 +102,6 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
for (PercentOfPassDto pr : list) {
//获取项目id
Long projectId = pr.getProjectId ( );
//通过项目id查询焊口数据
List<WeldDto> weldDtoList = weldService.getProjectId (projectId);
......@@ -108,24 +109,16 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
//获取焊口信息总条数
int sum = weldDtoList.size ( );
//焊口合格数
int qualifiedData = 0;
for (WeldDto weldDto : weldDtoList) {
String superInspecStatus = weldDto.getSuperInspecStatus ( );
if (superInspecStatus.equals ("合格")) {
qualifiedData++;
}
}
List<WeldDto> collect = weldDtoList.stream( ).filter(weld -> StageEnum.焊接工艺.getName( ).equals(weld.getSuperInspecStatus( ))).collect(Collectors.toList( ));
int qualifiedData = collect.size();
//合格率
BigDecimal sums = new BigDecimal (sum);
BigDecimal qualifiedDatas = new BigDecimal (qualifiedData);
Double pass = qualifiedDatas.divide (sums, 2, BigDecimal.ROUND_HALF_UP).multiply (new BigDecimal (100)).doubleValue ( );
//转换成百分比,生成合格率
String fpy = pass.toString ( ) + "%";
//将合格率赋值给数据集合
pr.setPercentOfPass (fpy);
//将数据添加到新集合里面
newsData.add (pr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment