Commit fa063d22 authored by DESKTOP-BQLVS7A\admin's avatar DESKTOP-BQLVS7A\admin

新增根据单位名称判断是否唯一接口

parent 2ee81ccd
......@@ -43,6 +43,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import javax.swing.text.StyledEditorKit;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
......@@ -452,6 +454,24 @@ public class CompanyController extends BaseController {
}
return ResponseHelper.buildResponse(flag);
}
/**
* 通过企业单位名称判断是否存在
*
* @return
*/
@TycloudOperation(needAuth = false,ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistCompanyName/{name}")
@ApiOperation(httpMethod = "GET",value = "判断企业名称是否存在", notes = "判断企业名称是否存在")
public ResponseModel<Boolean> hasExistCompanyName(@PathVariable(value = "name") String name){
Boolean exist = false;
LambdaQueryWrapper<Company> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Company::getName,name);
Company companyName = companyServiceImpl.getOne(wrapper);
if(!ValidationUtil.isEmpty(companyName)){
exist = true;
}
return ResponseHelper.buildResponse(exist);
}
/**
* 发送手机号验证码
......
......@@ -41,7 +41,7 @@ private InstallationQualityImpl services;
private WeldServiceImpl weld;
//查看质量监检信息
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/find")
@ApiOperation(httpMethod = "GET", value = "质量问题闭环管理-安装质量监检信息-质量监检信息", notes = "质量问题闭环管理-安装质量监检信息-质量监检信息")
public ResponseModel<Page<PercentOfPassDto>> find(@RequestParam(value = "current") int current, @RequestParam
......
......@@ -16,11 +16,13 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.IInstallationQualityMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallationQualityService;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -32,7 +34,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
......@@ -65,6 +66,7 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
//分页查询项目质量监检信息
@Override
@BusinessIdentify
@Transactional
public Page<PercentOfPassDto> find(int current,int size,PercentOfPassDto pd) {
Page page = new Page<>();
page.setCurrent(current);
......@@ -132,8 +134,14 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
//获取焊口信息总条数
int sum = weldDtoList.size ( );
//焊口合格数
List<WeldDto> collect = weldDtoList.stream( ).filter(weld -> StageEnum.焊接工艺.getName( ).equals(weld.getSuperInspecStatus( ))).collect(Collectors.toList( ));
int qualifiedData = collect.size();
int qualifiedData = 0;
for (WeldDto weldDto : weldDtoList) {
String superInspecStatus = weldDto.getSuperInspecStatus ( );
if (superInspecStatus.equals ("合格")) {
qualifiedData++;
}
}
//合格率
BigDecimal sums = new BigDecimal (sum);
BigDecimal qualifiedDatas = new BigDecimal (qualifiedData);
......
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