Commit 2f572f2b authored by 曹盼盼's avatar 曹盼盼

校验和项目资源关联,修改企业审核,修改焊评依赖

parent 649def05
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
......@@ -21,4 +22,6 @@ public interface CompanyMapper extends BaseMapper<Company> {
IPage<CompanyDto> queryCompanyPage(IPage<CompanyDto> page,Company companyParam);
CompanyDto queryBySeq1(Long sequenceNbr);
@Select("select * from tz_ugp_company where sequence_nbr= #{sequenceNbr}")
Company qById(Long sequenceNbr);
}
......@@ -222,7 +222,7 @@ public class CompanyController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "check")
@PostMapping(value = "/check")
@ApiOperation(httpMethod = "POST", value = "根据sequenceNbr更新,并创建单位及管理员", notes = "根据sequenceNbr更新,并创建单位及管理员")
public ResponseModel<Boolean> companyCheck(@RequestBody CompanyDto model,Long sequenceNbr,String bizOrgType) throws Exception{
return ResponseHelper.buildResponse(companyServiceImpl.companyCheck(model,sequenceNbr,bizOrgType));
......
......@@ -173,12 +173,9 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
Map<Long, List<Long>> roleSeqsMap = new HashMap<>();
Map<Long,List<RoleModel>> orgRoles = new HashMap<>();
Set<String> appCodeSet = new HashSet<>();
Company company = this.getById(sequenceNbr);
Company company = companyMapper.selectById(sequenceNbr);
if (!ValidationUtil.isEmpty(company)&& "已审核".equals(company.getApproved())){
company.setApproved(model.getApproved());
if (company.getApproved().equals("已审核")){
final CompanyModel companyModel = new CompanyModel();
AgencyUserModel agencyUserModel = new AgencyUserModel();
......
......@@ -360,4 +360,22 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
return page;
}
public ProjectResource getprojectResource(Long resourceId,Long sequenceNbr,String type){
LambdaQueryWrapper<ProjectResource> wrapper = new LambdaQueryWrapper<>();
ProjectResource projectResource =null;
if (sequenceNbr == null) {
wrapper.eq(resourceId!=null,ProjectResource::getResourceId,resourceId)
.eq(!ValidationUtil.isEmpty(type),ProjectResource::getType,type);
projectResource=projectResourceMapper.selectOne(wrapper);
return projectResource;
}
if (resourceId == null) {
wrapper.eq(resourceId!=null,ProjectResource::getSequenceNbr,sequenceNbr)
.eq(!ValidationUtil.isEmpty(type),ProjectResource::getType,type);
projectResource=projectResourceMapper.selectOne(wrapper);
return projectResource;
}
return projectResource;
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.ugp.api.Enum.*;
......@@ -11,85 +10,44 @@ 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.mapper.VerifyMapper;
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.biz.framework.BusinessIdentify;
import jnr.ffi.Struct;
import lombok.var;
import org.apache.commons.lang.StringUtils;
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.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.springframework.data.elasticsearch.annotations.DateFormat.year;
/**
* 智能监检管理表服务实现类
*
* @author system_generator
* @date 2022-09-22
*/
@Service
public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper> implements IVerifyService {
@Autowired
InstallNoticeServiceImpl installNoticeService;
@Autowired
WeldServiceImpl weldService;
@Autowired
WeldMapper weldMapper;
@Autowired
OrgServiceImpl orgService;
@Autowired
private MaterialServiceImpl materialService;
@Autowired
VerifyMapper verifyMapper;
@Autowired
private EquipmentServiceImpl equipmentService;
@Autowired
private QualityProblemServiceImpl qualityProblemService;
@Autowired
private ProjectServiceImpl projectServiceImpl;
......@@ -97,7 +55,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
private ProjectResourceServiceImpl projectResourceService;
@Autowired
private AttachmentServiceImpl attachmentService;
@Autowired
private ProblemInitiationServiceImpl problemInitiationService;
@Autowired
......@@ -125,6 +82,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* stage 阶段
* page 分页
*/
@Override
public Page<SmartListDto> commonality(String stage, Page<SmartListDto> page, SmartListDto smartListDto){
Page<Verify> objectPage = new Page<>( );
objectPage.setCurrent(page.getCurrent());
......@@ -304,9 +262,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//失败
//属性赋值
jsonObject.put(CheckEnum.符合.getKey(),CheckEnum.符合.getName());//人脸
if (welderId != null) {
ProjectResource resource = projectResourceService.getprojectResource(welderId, null, "welder");
if (!ValidationUtil.isEmpty(resource)) {
Map map = orgService.getdetialInfo(welderId.toString( ));
String certValidDate = String.valueOf(map.get("certValidDate"));
if (certValidDate!=null && !certValidDate.equals("")) {
......@@ -326,6 +284,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
}
}
}
Boolean flag =true;
if (!CheckEnum.符合.getName().equals(jsonObject.getString(CheckEnum.符合.getKey())) ||
!CheckEnum.有效.getName().equals(jsonObject.getString(CheckEnum.有效.getKey()))) {
......@@ -351,8 +310,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
/**校验*/
Boolean flag =false;
if (!ValidationUtil.isEmpty(materialCode)) {
//由于通过管材编号查询,项目资源中没有管材编号,先查管材资源,在通过管材资源id查询项目资源
Material material = materialService.getMaterial(materialCode);
if (!ValidationUtil.isEmpty(material)) {
ProjectResource resource = projectResourceService.getprojectResource(null, material.getSequenceNbr(), "material");
if (!ValidationUtil.isEmpty(material) && !ValidationUtil.isEmpty(resource)) {
jsonObject.put(CheckEnum.有效.getKey(),CheckEnum.有效.getName());
jsonObject.put(CheckEnum.符合.getKey(),CheckEnum.符合.getName());
if (!ValidationUtil.isEmpty(material.getManufacturer())) {
......@@ -384,8 +345,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
Boolean flag =false ;
//后面需要修改此处
if (!ValidationUtil.isEmpty(weldingId)) {
ProjectResource resource = projectResourceService.getprojectResource(weldingId, null, "material");
Equipment equipment = equipmentService.getEquipment(weldingId);
if (!ValidationUtil.isEmpty(equipment)) {
if (!ValidationUtil.isEmpty(equipment) && !ValidationUtil.isEmpty(resource)) {
jsonObject.put(CheckEnum.有效.getKey(),CheckEnum.有效.getName());
jsonObject.put(CheckEnum.符合.getKey(),CheckEnum.符合.getName());
jsonObject.put(CheckEnum.合格期内.getKey(),CheckEnum.合格期内.getName());
......@@ -396,7 +358,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
jsonObject.put("facilityNumber",equipment.getCode());
}
flag=true;
}else{
jsonObject.put(CheckEnum.已过期.getKey(),CheckEnum.已过期.getName());
jsonObject.put(CheckEnum.不符合.getKey(),CheckEnum.不符合.getName());
......@@ -463,8 +424,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
}
//效验通过
this.addSuccessData(verify,null,jsonObject);
/**注意: app那边没有 暂时耐压假数据*/
Verify v1 = new Verify( );
JSONObject object = new JSONObject( );
......@@ -690,8 +649,11 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
String stage = StageEnum.getDetailVerifyNameMap.get(jsonObject.getString("stage"));//获取效验阶段
qualityProblem.setGenerateStage(stage);
qualityProblem.setProblemDescribe(stage+"不通过");
//获取智能监检表id
Verify verify1 = verifyMapper.selectByTargetInfo(verify.getTargetInfo( ));
//获取智能监检表id(项目id和检验时间)
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Verify::getVerifyTime,verify.getVerifyTime())
.eq(Verify::getProjectId,verify.getProjectId());
Verify verify1 = verifyMapper.selectOne(wrapper);
Long sequenceNbr = verify1.getSequenceNbr( );
qualityProblem.setStageVerifyId(sequenceNbr);
qualityProblemService.save(qualityProblem);
......@@ -718,11 +680,10 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
String code = jsonObject.getString("code");//获取焊口编号
// 通过焊口码和项目id查询
if (!StringUtils.isEmpty(code)&& verify.getProjectId() !=null) {
Weld weld=weldMapper.getWeldByCodeAndProjectId(code, verify.getProjectId());
if (weld != null) {
//判断是哪一个阶段
String stage = verify.getStage( );
String stage = verify.getStage();
Map<String, String> mapEnum = StageEnum.getStageByNameMap;
//修改的值
String name = mapEnum.get(stage);
......
......@@ -28,7 +28,8 @@
<dependency>
<groupId>fakepath</groupId>
<artifactId>ugp-welding-evaluation-inspection-sdk</artifactId>
<version>1.0</version>
<version>1.2.0</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
......
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