Commit c145de89 authored by suhuiguang's avatar suhuiguang

检验检测检验结果数据权限按钮控制显示隐藏调整

parent b6c73526
......@@ -109,6 +109,9 @@
<if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null">
and use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%')
</if>
<if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null">
and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
</if>
<choose>
<when test="identity == 'apply'">
and res.application_unit_code = #{jyjcInspectionResultModel.companyCode}
......
......@@ -4,13 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil;
......@@ -24,7 +22,6 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttach
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
......@@ -127,7 +124,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
model = new JyjcInspectionResultModel();
}
// 判断当前登录人身份(报检机构、接收机构、即时报检又是接收机构、都不是(不存在此情况))
String identity= this.getCompanyIdentityByType(reginParams.getCompany().getCompanyType());
String identity = this.getCompanyIdentityByType(reginParams.getCompany().getCompanyType());
model.setCompanyCode(reginParams.getCompany().getCompanyCode());
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectForPage(page, model, identity);
resultPage.getRecords().forEach(v -> {
......@@ -142,26 +139,26 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return resultPage;
}
private String getCompanyIdentityByType(String companyType){
private String getCompanyIdentityByType(String companyType) {
// 可发起单位的单位类型(角色与单位类型已绑定,在业务系统增加的账号不会出现角色与的单位类型不匹配场景)
String[] applyIdentityDefine = {"使用单位", "安装改造维修单位"};
// 可进行检验检测申请接收的单位类型,在业务系统增加的账号不会出现角色与的单位类型不匹配场景
String[] receiveIdentityDefine = {"检验检测机构"};
boolean isApplyIdentityMatch = false;
boolean isReceiveIdentityMatch = false;
if(Arrays.stream(applyIdentityDefine).anyMatch(companyType::contains)){
if (Arrays.stream(applyIdentityDefine).anyMatch(companyType::contains)) {
isApplyIdentityMatch = true;
}
if(Arrays.stream(receiveIdentityDefine).anyMatch(companyType::contains)){
if (Arrays.stream(receiveIdentityDefine).anyMatch(companyType::contains)) {
isReceiveIdentityMatch = true;
}
if(isApplyIdentityMatch && !isReceiveIdentityMatch){
if (isApplyIdentityMatch && !isReceiveIdentityMatch) {
return "apply";
}
if(!isApplyIdentityMatch && isReceiveIdentityMatch){
if (!isApplyIdentityMatch && isReceiveIdentityMatch) {
return "receive";
}
if(isApplyIdentityMatch){
if (isApplyIdentityMatch) {
return "all";
}
return "no";
......@@ -235,7 +232,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
paramList.add(resultParam);
}
});
if (!CollectionUtils.isEmpty(paramList)){
if (!CollectionUtils.isEmpty(paramList)) {
resultParamService.saveOrUpdateBatch(paramList);
}
......@@ -254,11 +251,11 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
inspectionDetectionInfoMapper.updateById(info);
}
//更新使用信息表
useInfoMapper.updateByRecord(model.getEquipUnicode(),model.getNextInspectionDate(),model.getInspectionType(),model.getApplicationNo());
useInfoMapper.updateByRecord(model.getEquipUnicode(), model.getNextInspectionDate(), model.getInspectionType(), model.getApplicationNo());
return model;
}
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info, JyjcInspectionResultAttachment jybgFile ) {
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info, JyjcInspectionResultAttachment jybgFile) {
// 回填检验机构名称
LambdaQueryWrapper<TzBaseEnterpriseInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TzBaseEnterpriseInfo::getUseCode, model.getInspectionUnitCode());
......
......@@ -5,9 +5,9 @@
UPDATE
idx_biz_jg_use_info
SET
NEXT_INSPECT_DATE = #{nextInspectDate},
LAST_INSPECT_TYPE = #{lastInspectType},
LAST_INSPECT_REPORT_NO = #{lastInspectReportNo}
"NEXT_INSPECT_DATE" = #{nextInspectDate},
"LAST_INSPECT_TYPE" = #{lastInspectType},
"LAST_INSPECT_REPORT_NO" = #{lastInspectReportNo}
WHERE
RECORD = #{record}
......
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