Commit ffa64307 authored by suhuiguang's avatar suhuiguang

1.公示测试代码

parent a3bfcee9
package com.yeejoin.amos.boot.module.jyjc.api.dto;
import lombok.Data;
/**
* 检验机构公示
*
* @author Administrator
*/
@Data
public class InspectionCompanyPublicityDto {
/**
* 单位名称
*/
private String unitName;
/**
* 单位编码
*/
private String unitCode;
/**
* 核准信息:核准证号、核准证有限期
*/
private String approvalInfo;
/**
* 开通区域
*/
private String detectionRegion;
/**
* 业务有效期
*/
private String expiryDate;
/**
* 法人
*/
private String legalPerson;
/**
* 联系人
*/
private String useContact;
/**
* 联系人电话
*/
private String contactPhone;
/**
* 检验及检测人员数量
*/
private Long personNum;
/**
* 开通业务类型
*/
private String openBizType;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionCompanyPublicityDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.PublicityInspectOrgInfoDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
......@@ -36,4 +37,6 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
* @return List<PublicityInspectOrgInfoDto>
*/
List<PublicityInspectOrgInfoDto> queryInspectionOrgListForPublicity(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<InspectionCompanyPublicityDto> queryInspectionOrgListForBiz();
}
......@@ -83,4 +83,41 @@
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
ORDER BY unitName
</select>
<select id="queryInspectionOrgListForBiz" resultType="com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionCompanyPublicityDto">
select
ei.sequence_nbr,
ei.use_unit as unitName,
oa.unit_code,
oa.detection_region,
oa.expiry_date,
ei.legal_person,
ei.use_contact,
ei.contact_phone,
(select count(1) from tzs_user_info u where u.unit_code = ei.use_unit_code and u.is_delete = false) as personNum,
(
select
group_concat(concat(a.cert_no,'#',a.expiry_date)) cert_no
from
(
SELECT
cert_no,
min(expiry_date) as expiry_date
FROM
"tz_base_unit_licence"
where
unit_code= ei.use_unit_code
and cert_type_code like '1233%'
and expiry_date >= CURRENT_DATE
AND (case when cert_type_code = '1233-1' then 'jy' else 'jc' end) = oa.open_biz_type
GROUP BY cert_no,cert_type_code
) a
) as approvalInfo,
oa.open_biz_type
from
tz_jyjc_opening_application oa,
tz_base_enterprise_info ei
where
oa.unit_code = ei.use_unit_code
and oa.status = 6616
</select>
</mapper>
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionCompanyPublicityDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
......@@ -284,4 +285,11 @@ public class JyjcOpeningApplicationController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "检验检测机构公示", notes = "检验检测机构公示")
@PostMapping(value = "/inspectionOrgList/publicity")
public ResponseModel<List<InspectionCompanyPublicityDto>> inspectionOrgListForPublicity() {
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.queryInspectionOrgListForBiz());
}
}
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionCompanyPublicityDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BusinessTypeEnum;
......@@ -967,4 +968,30 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
commonService.saveExecuteFlowData2Redis(inspectionApplication.getWorkflowProstanceId(), this.buildInstanceRuntimeData(inspectionApplication));
});
}
public List<InspectionCompanyPublicityDto> queryInspectionOrgListForBiz() {
// 查询所有已经业务开通的检验检测机构,已机构为维度进行证的合并处理
List<InspectionCompanyPublicityDto> inspectionCompanyPublicityDtos = this.getBaseMapper().queryInspectionOrgListForBiz();
// 枚举转换
inspectionCompanyPublicityDtos.forEach(c->{
c.setDetectionRegion(this.castRegionCode2Name(c.getDetectionRegion()));
c.setApprovalInfo(this.breakNewLineForApprovalInfo(c.getApprovalInfo()));
c.setOpenBizType(this.castOpenBizTypeCode2Name(c.getOpenBizType()));
});
return inspectionCompanyPublicityDtos;
}
private String castRegionCode2Name(String detectionRegion) {
return "";
}
private String breakNewLineForApprovalInfo(String approvalInfo) {
String[] approvalArray = approvalInfo.split("#");
StringBuilder stringBuilder = new StringBuilder();
return "";
}
private String castOpenBizTypeCode2Name(String openBizType) {
return OpenBizTypeEnum.getOneByCode(openBizType).getName();
}
}
\ No newline at end of file
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