| | |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.module.client.api.SysClient; |
| | | import cn.huge.module.sys.dto.FileIdInfoBaseDTO; |
| | | import cn.huge.module.sys.dto.FileIdTypeInfoBaseDTO; |
| | | import cn.huge.module.sys.dto.FileInfoBaseDTO; |
| | | import cn.huge.module.sys.dto.FileTypeInfoBaseDTO; |
| | | import cn.huge.module.sys.dto.*; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @title: 系统公共服务微服务调用接口 |
| | |
| | | |
| | | /** |
| | | * 附件中心-根据多个所属编号查询附件并根据先根据ownerId再根据附件类型分组 |
| | | * @param ownerIdList 所属业务编号 |
| | | * @param term 所属业务编号 |
| | | * @return List |
| | | */ |
| | | public List<FileIdTypeInfoBaseDTO> listIdTypeInfoByOwnerIdList(List<String> ownerIdList){ |
| | | public List<FileIdTypeInfoBaseDTO> listIdTypeInfoByOwnerIdList(Map<String, Object> term){ |
| | | List<FileIdTypeInfoBaseDTO> fileIdTypeInfoBaseDTOList = new ArrayList<>(); |
| | | try{ |
| | | ReturnBO returnBo = sysClient.listTypeInfoByOwnerIdList(ownerIdList); |
| | | ReturnBO returnBo = sysClient.listTypeInfoByOwnerIdList(term); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | List<LinkedHashMap> list = (List<LinkedHashMap>) returnBo.getData(); |
| | |
| | | |
| | | /** |
| | | * 附件中心-根据业务编号查询固定格式所有附件 |
| | | * @param ownerIdList 所属业务编号 |
| | | * @param term 所属业务编号 |
| | | * @return List |
| | | */ |
| | | public List<FileIdInfoBaseDTO> listIdInfoByOwnerIdList(List<String> ownerIdList){ |
| | | public List<FileIdInfoBaseDTO> listIdInfoByOwnerIdList(Map<String, Object> term){ |
| | | List<FileIdInfoBaseDTO> fileIdInfoBaseDTOList = new ArrayList<>(); |
| | | try{ |
| | | ReturnBO returnBo = sysClient.listInfoByOwnerIdList(ownerIdList); |
| | | ReturnBO returnBo = sysClient.listInfoByOwnerIdList(term); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | List<LinkedHashMap> list = (List<LinkedHashMap>) returnBo.getData(); |
| | |
| | | } |
| | | return fileIdInfoBaseDTOList; |
| | | } |
| | | |
| | | /** |
| | | * 附件中心-根据业务编号查询固定格式所有附件 |
| | | * @param limitTable 表名 |
| | | * @param limitType 时限类型 |
| | | * @return List |
| | | */ |
| | | public Integer getTimeLimit(String limitTable, String limitType){ |
| | | int timeTerm = 0; |
| | | try{ |
| | | ReturnBO returnBo = sysClient.getTimeLimit(limitTable, limitType); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | timeTerm = (int)returnBo.getData(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[SysClientImpl.listIdInfoByOwnerIdList]调用异常:"+e, e); |
| | | } |
| | | return timeTerm; |
| | | } |
| | | |
| | | /** |
| | | * 获取时限 |
| | | * @url {ctx}/api/web/syTimeLimit/getExpireTime |
| | | * @param computeTime |
| | | * @param limitType |
| | | * @return |
| | | */ |
| | | public Date getExpireTime(Date computeTime, String limitType){ |
| | | Date expireTime = null; |
| | | try{ |
| | | ReturnBO returnBo = sysClient.getExpireTime(computeTime, limitType); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | expireTime = (Date) returnBo.getData(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[SysClientImpl.getExpireTime]调用异常:"+e, e); |
| | | } |
| | | return expireTime; |
| | | } |
| | | |
| | | /** |
| | | * 根据条件删除附件关系 |
| | | * @param fileTypeTermsDTO 条件 |
| | | * @return Object |
| | | */ |
| | | public void removeFileRelate(FileTypeTermsDTO fileTypeTermsDTO) { |
| | | try { |
| | | ReturnBO returnBo = sysClient.removeFileRelate(fileTypeTermsDTO); |
| | | if (ReturnConsts.OK != returnBo.getCode()){ |
| | | log.error("Client外服务接口[SysClientImpl.removeFileRelate]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("service方法[SysClientImpl.removeFileRelate]请求异常:"+e, e); |
| | | } |
| | | } |
| | | } |