Commit 670552e2 authored by changxiangyu's avatar changxiangyu

新增'监督检验列表(企业)','检验业务开通列表监管'导出

parent e8ff69b4
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcOpeningApplicationVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -39,4 +40,6 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
List<PublicityInspectOrgInfoDto> queryInspectionOrgListForPublicity(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<InspectionCompanyPublicityDto> queryInspectionOrgListForBiz();
List<JyjcOpeningApplicationVo> queryJyjcOpeningApplicationListByIds(List<String> ids);
}
package com.yeejoin.amos.boot.module.jyjc.api.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import lombok.Data;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
/**
* @author system_generator
* @date 2023-12-14
*/
@Data
public class JyjcOpeningApplicationVo {
@ExcelProperty(value = "申请单编号", index = 0)
String applicationSeq;
@ExcelProperty(value = "申请时间", index = 1)
String applyTime;
@ExcelProperty(value = "检验检测机构名称", index = 2)
String unitCodeName;
@ExcelProperty(value = "开通业务类型", index = 3)
String openBizType;
@ExcelProperty(value = "统一信用代码", index = 4)
String unitCode;
@ExcelProperty(value = "业务有效期至", index = 5)
@DateTimeFormat("yyyy-MM-dd")
Date expiryDate;
@ExcelProperty(value = "作废原因", index = 6)
String remark;
@ExcelProperty(value = "办理状态", index = 7)
String statusName;
@ExcelProperty(value = "办理日期", index = 8)
@DateTimeFormat("yyyy-MM-dd")
Date acceptDate;
}
......@@ -121,4 +121,11 @@
oa.unit_code = ei.use_unit_code
and oa.status = 6616
</select>
<select id="queryJyjcOpeningApplicationListByIds"
resultType="com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcOpeningApplicationVo">
select * from tz_jyjc_opening_application where sequence_nbr in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>;
</select>
</mapper>
......@@ -284,7 +284,7 @@ public class JyjcInspectionApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{bizType}/export")
@ApiOperation(httpMethod = "GET", value = "定(首)检验列表(企业)/电梯检测 列表数据导出", notes = "定(首)检验列表(企业)/电梯检测 列表数据导出")
@ApiOperation(httpMethod = "GET", value = "定(首)检验列表(企业)/电梯检测/监督检验 列表数据导出", notes = "定(首)检验列表(企业)/电梯检测/监督检验 列表数据导出")
public void export(@PathVariable(value = "bizType")String bizType, HttpServletResponse response, String ids) {
Assert.hasText(ids,"未选择导出数据");
jyjcInspectionApplicationServiceImpl.export(bizType,response, Arrays.asList(ids.split(",")));
......
......@@ -21,6 +21,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -31,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
......@@ -292,4 +294,18 @@ public class JyjcOpeningApplicationController extends BaseController {
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.queryInspectionOrgListForBiz());
}
/**
* 检验业务开通列表导出
* @param response
* @param ids
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/exportdata")
@ApiOperation(httpMethod = "GET", value = "检验业务开通列表导出", notes = "检验业务开通列表导出")
public void dataExport(HttpServletResponse response, String ids) {
Assert.hasText(ids,"未选择导出数据");
jyjcOpeningApplicationServiceImpl.exportData(response,Arrays.asList(ids.split(",")));
}
}
......@@ -93,16 +93,16 @@ import java.util.stream.Collectors;
@Slf4j
public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspectionApplicationModel, JyjcInspectionApplication, JyjcInspectionApplicationMapper> implements IJyjcInspectionApplicationService {
@Autowired
private JyjcInspectionResultServiceImpl inspectionResultService;
@Autowired
private JyjcInspectionApplicationEquipServiceImpl applicationEquipService;
private static final String EQU_STATE = "EQU_STATE";
private static final String EQU_CODE = "EQU_CODE";
private static final String SEQUENCE_NBR = "SEQUENCE_NBR";
private static final String SUMMIT_TYPE = "0";
private static final String FIRST_INSPECT = "firstInspect";
private static final String SUPERVISE = "supervise";
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
@Autowired
EventPublisher eventPublisher;
@Autowired
@Lazy
InspectionPlanServiceImpl inspectionPlanService;
......@@ -112,80 +112,64 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired
JyjcInspectionApplicationAttachmentServiceImpl jyjcInspectionApplicationAttachmentService;
@Autowired
JyjcInspectionApplicationEquipServiceImpl jyjcInspectionApplicationEquipService;
@Autowired
JyjcInspectionApplicationPushLogServiceImpl jyjcInspectionApplicationPushLogService;
@Autowired
JyjcOpeningApplicationServiceImpl jyjcOpeningApplicationService;
@Autowired
WorkflowFeignService workflowFeignService;
@Autowired
CommonServiceImpl commonService;
@Autowired
CmWorkflowServiceImpl cmWorkflowService;
@Value("classpath:/json/bizTypeInfo.json")
private Resource bizTypeInfo;
@Autowired
private JyjcInspectionApplicationEquipMapper jyjcInspectionApplicationEquipMapper;
@Autowired
JgFeignClient jgFeignClient;
@Autowired
private RedisUtils redisUtils;
@Autowired
TaskModelServiceImpl taskModelService;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
@Autowired
JyjcOpeningApplicationServiceImpl openingApplicationService;
@Autowired
RedissonClient redissonClient;
@Autowired
JyjcBaseMapper jyjcBaseMapper;
@Autowired
IdxBizJgUseInfoMapper jgUseInfoMapper;
@Autowired
JyjcInspectionApplicationNoAcceptLogServiceImpl noAcceptLogService;
@Autowired
RestHighLevelClient restHighLevelClient;
@Autowired
private JyjcInspectionResultServiceImpl inspectionResultService;
@Autowired
private JyjcInspectionApplicationEquipServiceImpl applicationEquipService;
@Value("classpath:/json/bizTypeInfo.json")
private Resource bizTypeInfo;
@Autowired
private JyjcInspectionApplicationEquipMapper jyjcInspectionApplicationEquipMapper;
@Autowired
private RedisUtils redisUtils;
@Autowired
private ESEquipmentCategory esEquipmentCategory;
private static final String EQU_STATE = "EQU_STATE";
private static final String EQU_CODE = "EQU_CODE";
private static final String SEQUENCE_NBR = "SEQUENCE_NBR";
private static final String SUMMIT_TYPE = "0";
private static final String FIRST_INSPECT = "firstInspect";
/**
* 省特检院等特殊公司code
*/
@Value("${shanxi.tjy.code:126100004352004822}")
private String shanxiCompanyCode;
@Autowired
RestHighLevelClient restHighLevelClient;
@NotNull
public static List<DictionarieModel> getDictionarieModels(String bizType) {
List<JYJCTypeEnum> enums = JYJCTypeEnum.getListByBizType(bizType);
return enums.stream().map(e -> {
DictionarieModel dictionarieModel = new DictionarieModel();
dictionarieModel.setDictCode(e.getCode());
dictionarieModel.setDictName(e.getName());
return dictionarieModel;
}).collect(Collectors.toList());
}
@Transactional(rollbackFor = Exception.class)
public JyjcInspectionApplicationModel save(@RequestBody JSONObject obj, ReginParams reginParams) {
......@@ -320,8 +304,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
} else {
String taskContent = "来自" + model.getEquList() + "【" + model.getSupervisoryCode() + "】的业务办理,【申请单号:" + model.getApplicationNo() + "】";
taskModelService.updateTaskContentById(MapBuilder.<String, Object>create().put("taskContent", taskContent).
put("relationId", model.getSequenceNbr() + "").build());
taskModelService.updateTaskContentById(MapBuilder.<String, Object>create().put("taskContent", taskContent).put("relationId", model.getSequenceNbr() + "").build());
}
}
......@@ -488,7 +471,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return dictionary != null ? dictionary.getName() : "";
}
@Override
public Boolean deleteBatchData(List<Long> sequenceNbr) {
this.deleteBatchSeq(sequenceNbr);
......@@ -505,11 +487,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return getBaseMapper().listByCategory(page, equipClassify);
}
@Override
public Page<JyjcInspectionApplicationModel> queryForPageList(Page<JyjcInspectionApplication> page, JyjcInspectionApplicationModel model) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class);
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String companyType = reginParams.getCompany().getCompanyType();
String companyCode = reginParams.getCompany().getCompanyCode();
String currentUserId = reginParams.getUserModel().getUserId();
......@@ -535,6 +515,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
/**
* 定(首)检验列表(企业)/ 电梯检测 列表数据导出
*
* @param bizType
* @param response
* @param ids
......@@ -542,7 +523,15 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Override
public void export(String bizType, HttpServletResponse response, List<String> ids) {
List<JyjcInspectionApplicationVo> exportData = this.baseMapper.queryExportInIds(ids);
String typeName = FIRST_INSPECT.equals(bizType) ? "定(首)检验列表" : "电梯检测列表";
String typeName;
if (FIRST_INSPECT.equals(bizType)) {
typeName = "定(首)检验列表";
} else if (SUPERVISE.equals(bizType)) {
typeName = "监督检验列表";
} else {
typeName = "电梯检验列表";
}
ExcelUtil.createTemplate(response, typeName + "数据", typeName, exportData, JyjcInspectionApplicationVo.class, null, false);
}
......@@ -722,16 +711,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
this.setResultTypeByBizType(resultModel, model.getBizType());
resultModels.add(resultModel);
// 新增设备履历信息
jgResumeInfoDtoList.add(JgResumeInfoDto.builder()
.applyNo(entity.getApplicationNo())
.businessType(resultModel.getInspectionTypeName())
.businessId(String.valueOf(entity.getSequenceNbr()))
.equId(applicationEquipModels.get(i).getEquipUnicode())
.approvalUnit(model.getInspectionUnitName())
.approvalUnitCode(model.getInspectionUnitCode())
.status("正常")
.routePath(taskV2Model.getRoutePath())
.build());
jgResumeInfoDtoList.add(JgResumeInfoDto.builder().applyNo(entity.getApplicationNo()).businessType(resultModel.getInspectionTypeName()).businessId(String.valueOf(entity.getSequenceNbr())).equId(applicationEquipModels.get(i).getEquipUnicode()).approvalUnit(model.getInspectionUnitName()).approvalUnitCode(model.getInspectionUnitCode()).status("正常").routePath(taskV2Model.getRoutePath()).build());
}
inspectionResultService.saveOrUpdateBatch(resultModels);
// 报检信息推送
......@@ -748,7 +728,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
}
private void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
try {
jgFeignClient.saveBatchResume(jgResumeInfoDtoList);
......@@ -876,7 +855,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return true;
}
@Transactional(rollbackFor = Exception.class)
public Boolean doNoAccept(Map<String, Object> params) {
String instanceId = params.get("instanceId").toString();
......@@ -956,7 +934,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
noAcceptLogService.createWithModel(noAcceptLogModel);
}
/**
* 撤回流程办理单
*/
......@@ -1017,22 +994,13 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
private InstanceRuntimeData buildInstanceRuntimeData(JyjcInspectionApplication jyjcInspectionApplication) {
return InstanceRuntimeData.builder()
.nextExecuteUserIds(jyjcInspectionApplication.getNextExecuteUserIds())
.promoter(jyjcInspectionApplication.getPromoter())
.nextTaskId(jyjcInspectionApplication.getNextTaskId())
.build();
return InstanceRuntimeData.builder().nextExecuteUserIds(jyjcInspectionApplication.getNextExecuteUserIds()).promoter(jyjcInspectionApplication.getPromoter()).nextTaskId(jyjcInspectionApplication.getNextTaskId()).build();
}
private InstanceRuntimeData buildInstanceRuntimeData(JyjcInspectionApplicationModel jyjcInspectionApplication) {
return InstanceRuntimeData.builder()
.nextExecuteUserIds(jyjcInspectionApplication.getNextExecuteUserIds())
.promoter(jyjcInspectionApplication.getPromoter())
.nextTaskId(jyjcInspectionApplication.getNextTaskId())
.build();
return InstanceRuntimeData.builder().nextExecuteUserIds(jyjcInspectionApplication.getNextExecuteUserIds()).promoter(jyjcInspectionApplication.getPromoter()).nextTaskId(jyjcInspectionApplication.getNextTaskId()).build();
}
private void buildRoleList(List<ProcessTaskDTO> processTasks, List<String> roleListNext, List<String> roleListAll) {
processTasks.forEach(p -> {
p.getNextCandidateGroups().values().forEach(e -> {
......@@ -1080,7 +1048,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
taskModelService.buildTaskModel(Arrays.asList(dto));
}
private void createNextTask(JyjcInspectionApplicationModel model, String taskName, String nextUserIds) {
// 先更新之前的待办
TaskV2Model taskV2Model = updateTaskModel(model);
......@@ -1117,7 +1084,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
taskModelService.buildTaskModel(Collections.singletonList(modelDto));
}
private TaskV2Model updateTaskModel(JyjcInspectionApplicationModel model) {
Map<String, Object> params = new HashMap<>();
params.put("relationId", model.getProcessInstanceId());
......@@ -1132,7 +1098,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return taskModelService.updateTaskModel(params);
}
/**
* 缓存当前正在流程中的实例的流程数据
*/
......@@ -1195,8 +1160,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
result.setTotal(0);
return result;
}
String companyCode = company.getString("companyCode").contains("_") ?
company.getString("companyCode").split("_")[1] : company.getString("companyCode");
String companyCode = company.getString("companyCode").contains("_") ? company.getString("companyCode").split("_")[1] : company.getString("companyCode");
String type = company.getString("companyType");
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数
......@@ -1301,7 +1265,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
*
* @param boolMust 条件
*/
private void setFilterOfInFlowing(BoolQueryBuilder boolMust,String equListCode, String inspectionType) {
private void setFilterOfInFlowing(BoolQueryBuilder boolMust, String equListCode, String inspectionType) {
Set<String> records = this.getEquipInFlowing();
if (records != null && !records.isEmpty()) {
boolMust.mustNot(QueryBuilders.termsQuery("SEQUENCE_NBR.keyword", records));
......@@ -1330,24 +1294,11 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return fullAddress;
}
public List<TzBaseEnterpriseInfoDto> getInspectionUnitListForWorkbench(String openBizType) {
return commonService.getInspectionUnitList(openBizType);
}
public List<DictionarieModel> inspectTypeListByBizType(String bizType) {
return getDictionarieModels(bizType);
}
@NotNull
public static List<DictionarieModel> getDictionarieModels(String bizType) {
List<JYJCTypeEnum> enums = JYJCTypeEnum.getListByBizType(bizType);
return enums.stream().map(e -> {
DictionarieModel dictionarieModel = new DictionarieModel();
dictionarieModel.setDictCode(e.getCode());
dictionarieModel.setDictName(e.getName());
return dictionarieModel;
}).collect(Collectors.toList());
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
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.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.TzsUserPermissionDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionCompanyPublicityDto;
......@@ -26,6 +27,8 @@ import com.yeejoin.amos.boot.module.jyjc.api.enums.OpenBizTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcOpeningApplicationMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.*;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcOpeningApplicationService;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionApplicationVo;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcOpeningApplicationVo;
import com.yeejoin.amos.boot.module.jyjc.biz.action.RuleActionHandler;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
import com.yeejoin.amos.boot.module.jyjc.biz.feign.TzsServiceFeignClient;
......@@ -65,6 +68,9 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
......@@ -81,80 +87,56 @@ import java.util.stream.Collectors;
@Slf4j
public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningApplicationModel, JyjcOpeningApplication, JyjcOpeningApplicationMapper> implements IJyjcOpeningApplicationService {
@Autowired
private TzsServiceFeignClient tzsServiceFeignClient;
private final static String INDUSTRY_SUPERVISOR_DICT_TYPE = "HYZGBM";
/**
* 人员级别字典KEY
*/
private final static String RYJB_JYJC_DICT_KEY = "RYJB_JYJC";
/**
* 所有人员资质检验检测项目key
*/
private final static String ZZXM_JYJC_DICT_KEY = "ZZXM_JYJC_ALL";
private static Map<String, DictionarieValueModel> permissionLevelMap;
private static List<DictionarieValueModel> permissionItemList;
@Autowired
JyjcOpeningApplicationMapper jyjcOpeningApplicationMapper;
@Autowired
BaseUnitLicenceMapper baseUnitLicenceMapper;
@Autowired
CommonServiceImpl commonService;
@Autowired
CmWorkflowServiceImpl cmWorkflowService;
@Autowired
TaskModelServiceImpl taskModelService;
@Autowired
DataDictionaryMapper dataDictionaryMapper;
@Autowired
RuleActionHandler ruleActionHandler;
@Autowired
RedissonClient redissonClient;
@Autowired
private TzsServiceFeignClient tzsServiceFeignClient;
@Value("${process-definition-key.jyjc.openapplication:}")
private String processDefinitionKey;
@Value("${jy.user-post:66151}")
private String jyUserPost;
@Value("${jy.cert.type.code:1233-1}")
private String jyCertTypeCode;
@Value("${jc.user-post:66152}")
private String jcUserPost;
@Value("${jc.cert.type.code:1233-2}")
private String jcCertTypeCode;
@Value("classpath:/json/bizTypeInfo.json")
private org.springframework.core.io.Resource bizTypeInfo;
@Autowired
private TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
BaseUnitLicenceMapper baseUnitLicenceMapper;
@Autowired
private TzsUserInfoMapper userInfoMapper;
@Autowired
CommonServiceImpl commonService;
@Autowired
CmWorkflowServiceImpl cmWorkflowService;
@Autowired
TaskModelServiceImpl taskModelService;
@Autowired
DataDictionaryMapper dataDictionaryMapper;
@Autowired
RuleActionHandler ruleActionHandler;
@Autowired
RedissonClient redissonClient;
@Autowired
private RuleCommonServiceImpl ruleCommonService;
@Autowired
private TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
private static Map<String, DictionarieValueModel> permissionLevelMap;
private static List<DictionarieValueModel> permissionItemList;
private final static String INDUSTRY_SUPERVISOR_DICT_TYPE = "HYZGBM";
/**
* 人员级别字典KEY
*/
private final static String RYJB_JYJC_DICT_KEY = "RYJB_JYJC";
/**
* 所有人员资质检验检测项目key
*/
private final static String ZZXM_JYJC_DICT_KEY = "ZZXM_JYJC_ALL";
/**
* 编辑、工作台暂存逻辑
*
......@@ -457,7 +439,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
private void setBaseUnitLicences(String unitCode, JyjcOpeningApplicationModel jyjcOpeningApplicationModel, boolean isNeedFilter) {
List<BaseUnitLicence> baseUnitLicences = baseUnitLicenceMapper.selectList(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, unitCode)
.gt(BaseUnitLicence::getExpiryDate , new Date())
.gt(BaseUnitLicence::getExpiryDate, new Date())
.in(BaseUnitLicence::getCertTypeCode, Arrays.asList(jyCertTypeCode, jcCertTypeCode)));
List<TzBaseUnitLicenceDto> licences = baseUnitLicences.stream().map(l -> {
TzBaseUnitLicenceDto licenceDto = new TzBaseUnitLicenceDto();
......@@ -566,10 +548,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 查询资质的人,
List<TzsUserPermissionDto> permissionDtos = userInfoMapper.queryPermissionByUserSeq(userInfo.getSequenceNbr(), this.buildPermissionKey(post));
// 注意检验资质、检测资质,每人只有一行数据, 一个人一个证
if(permissionDtos.size() > 0){
if (permissionDtos.size() > 0) {
TzsUserPermissionDto userPermissionDto = permissionDtos.get(0);
// 不会出现为null, 程序健壮处理
if(userPermissionDto.getPermissionItem() != null && userPermissionDto.getPermissionLevel() != null ){
if (userPermissionDto.getPermissionItem() != null && userPermissionDto.getPermissionLevel() != null) {
vo.setPermissionItem(JSONArray.parseArray(userPermissionDto.getPermissionItem()));
vo.setPermissionItemName(this.castItemCode2Name(vo.getPermissionItem()));
vo.setPermissionLevelName(this.getDictNameByCode(userPermissionDto.getPermissionLevel()));
......@@ -677,7 +659,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
taskParams.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
taskParams.put("model", jyjcOpeningApplication);
taskModelService.updateTaskModel(taskParams);
List<String> detectionRegion = (List<String>)params.get("detectionRegion");
List<String> detectionRegion = (List<String>) params.get("detectionRegion");
jyjcOpeningApplication.setDetectionRegion(detectionRegion);
jyjcOpeningApplication.setPromoter("");
jyjcOpeningApplication.setNextTaskId("");
......@@ -969,9 +951,9 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
public List<InspectionCompanyPublicityDto> queryInspectionOrgListForBiz() {
// 查询所有已经业务开通的检验检测机构,已机构为维度进行证的合并处理
List<InspectionCompanyPublicityDto> inspectionCompanyPublicityDtos = this.getBaseMapper().queryInspectionOrgListForBiz();
List<InspectionCompanyPublicityDto> inspectionCompanyPublicityDtos = this.getBaseMapper().queryInspectionOrgListForBiz();
// 枚举转换
inspectionCompanyPublicityDtos.forEach(c->{
inspectionCompanyPublicityDtos.forEach(c -> {
c.setDetectionRegion(this.castRegionCode2Name(c.getDetectionRegion()));
c.setApprovalInfo(this.breakNewLineForApprovalInfo(c.getApprovalInfo()));
c.setOpenBizType(this.castOpenBizTypeCode2Name(c.getOpenBizType()));
......@@ -992,4 +974,16 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
private String castOpenBizTypeCode2Name(String openBizType) {
return OpenBizTypeEnum.getOneByCode(openBizType).getName();
}
public void exportData(HttpServletResponse response, List<String> ids) {
List<JyjcOpeningApplicationVo> exportData = jyjcOpeningApplicationMapper.queryJyjcOpeningApplicationListByIds(ids);
for (JyjcOpeningApplicationVo data : exportData) {
data.setOpenBizType(this.getOpenBizTypeName(data.getOpenBizType()));
}
ExcelUtil.createTemplate(response, "检验检测开通列表数据", "检验检测开通列表", exportData, JyjcOpeningApplicationVo.class, null, false);
}
}
\ 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