fix:企业端分标委详情

This commit is contained in:
zhangqinlin
2021-12-13 19:01:57 +08:00
parent 1d3d05e710
commit dca20827eb
3 changed files with 60 additions and 13 deletions
@@ -13,11 +13,14 @@ import java.util.List;
*/
@Data
public class DetailForCaseCommittee {
@ApiModelProperty(value = "主键")
private java.lang.String id;
@ApiModelProperty(value = "分标委名称")
private java.lang.String name;
@ApiModelProperty(value = "负责人")
private java.lang.String principal;
@ApiModelProperty(value = "分标委简介")
private java.lang.String remarks;
@ApiModelProperty(value = "文件集合")
private List<Files> files;
@@ -12,20 +12,22 @@
</select>
<resultMap id="searchFile" type="com.jero.data.entity.DetailForCaseCommittee">
<id property="id" column="id"></id>
<result property="name" column="name"></result>
<collection property="files" ofType="com.jero.data.entity.Files" javaType="java.util.List" >
<result property="remarks" column="remarks"></result>
<result property="principal" column="principal"></result>
<collection property="files" ofType="com.jero.data.entity.Files" javaType="java.util.List" select="listForChildren" column="{id=id,userId=userId}" >
<result property="fileId" column="fileId"></result>
<result property="fileName" column="fileName"></result>
</collection>
</resultMap>
<select id="detail" resultMap="searchFile">
SELECT pcc.name,ossf.id as fileId,ossf.file_name as fileName FROM pay_case_committee pcc left join pay_working_group_distribution_record pwgdr on(pcc.id=pwgdr.project_id) left join oss_file
ossf on(pwgdr.file_id=ossf.id) where pcc.id=#{id} and pwgdr.contacts_id=#{userId} group by pwgdr.id
</select>
<!-- <select id="listForChildren" resultType="com.jero.data.entity.Files">-->
<!-- select ossf.id as fileId,ossf.file_name as fileName from pay_case_committee_subitem pccs left join pay_working_group_distribution_record pwgdr on(pccs.id=pwgdr.project_id) left join oss_file-->
<!-- ossf on(pwgdr.file_id=ossf.id) where pccs.committee_id=#{id} and pccs.contacts_id=#{userId}-->
<!-- </select>-->
</mapper>
SELECT pcc.name,pcc.id,pcc.remarks,pcc.create_by as principal ,#{userId} as userId FROM pay_case_committee pcc where pcc.id=#{id}
</select>
<select id="listForChildren" resultType="com.jero.data.entity.Files">
SELECT ossf.id as fileId,ossf.file_name as fileName FROM pay_case_committee pcc left join pay_working_group_distribution_record pwgdr on(pcc.id=pwgdr.project_id) left join oss_file
ossf on(pwgdr.file_id=ossf.id) where pcc.id=#{id}
and pwgdr.contacts_id=#{userId} group by pwgdr.id
</select>
</mapper>
@@ -3,10 +3,21 @@ package com.jero.project.service.impl;
import com.jero.project.entity.PayResearchProject;
import com.jero.project.mapper.PayResearchProjectMapper;
import com.jero.project.service.IPayResearchProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.Charsets;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import java.security.SecureRandom;
/**
* @Description: pay_research_project
* @Author: jeecg-boot
@@ -14,6 +25,37 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
* @Version: V1.0
*/
@Service
@Slf4j
public class PayResearchProjectServiceImpl extends ServiceImpl<PayResearchProjectMapper, PayResearchProject> implements IPayResearchProjectService {
private String keys="qczxd00001_memberSystem";
/**
* 加密,并将结果转成16进制字符串
*
*/
public static String encrypt(String datasource, String password) {
try {
SecureRandom random = new SecureRandom();
DESKeySpec desKey = new DESKeySpec(password.getBytes(Charsets.UTF_8));
// 创建一个密匙工厂,然后用它把DESKeySpec转换成
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey securekey = keyFactory.generateSecret(desKey);
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance("DES");
// 用密匙初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, securekey, random);
// 现在,获取数据并加密
// 正式执行加密操作
byte[] result = cipher.doFinal(datasource.getBytes(Charsets.UTF_8));
// 转成16进制
return Hex.encodeHexString(result);
} catch (Throwable e) {
e.printStackTrace();
log.error(String.valueOf(e));
}
return null;
}
}