fix 企业端资料下载bug

This commit is contained in:
zhangqinlin
2021-10-18 14:45:40 +08:00
parent c2ba2a8515
commit 7f6283b51e
5 changed files with 11 additions and 8 deletions
@@ -22,6 +22,7 @@ import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oConvertUtils;
import com.jero.company.entity.PayContactsManagement;
import com.jero.data.entity.PayCaseCommitteeSubitem;
@@ -39,6 +40,7 @@ import io.swagger.annotations.ApiImplicitParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
@@ -90,9 +92,10 @@ public class PayWorkingGroupDistributionRecordController extends JeroController<
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize
) {
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String name = oConvertUtils.replaceAllPercent(fileName);
Page<DownloadFileRecord> page = new Page(pageNo, pageSize);
IPage<DownloadFileRecord> pageList = payWorkingGroupDistributionRecordService.pageFileList(page,name);
IPage<DownloadFileRecord> pageList = payWorkingGroupDistributionRecordService.pageFileList(page,name,sysUser.getId());
if(!pageList.getRecords().isEmpty()) {
for (DownloadFileRecord s : pageList.getRecords()) {
if (s.getFileType().equals("1")) {
@@ -21,5 +21,5 @@ public interface PayWorkingGroupDistributionRecordMapper extends BaseMapper<PayW
* @param fileName
* @return
*/
IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page,@Param("fileName") String fileName);
IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page,@Param("fileName") String fileName,@Param("id") String id);
}
@@ -11,7 +11,7 @@
pwdg.create_time as uploadTime
FROM pay_working_group_distribution_record pwdg
LEFT JOIN oss_file ossf on(pwdg.file_id=ossf.id)
left join pay_working_group pwg on(pwdg.project_id=pwg.id) where pwdg.project_type=1
left join pay_working_group pwg on(pwdg.project_id=pwg.id) where pwdg.project_type=1 and pwdg.contacts_id=#{id}
union all
SELECT
ossf.id as fileId ,
@@ -21,7 +21,7 @@
pwdg.create_time as uploadTime
FROM pay_working_group_distribution_record pwdg
LEFT JOIN oss_file ossf on(pwdg.file_id=ossf.id)
left join pay_case_committee pcc on(pwdg.project_id=pcc.id) where pwdg.project_type=2
left join pay_case_committee pcc on(pwdg.project_id=pcc.id) where pwdg.project_type=2 and pwdg.contacts_id=#{id}
union all
SELECT
ossf.id as fileId,
@@ -34,7 +34,7 @@
pm.meeting_name as fileCome
,3 as fileType,
pm.create_time as uploadTime
from pay_meeting pm join mysql.help_topic ht on ht.help_topic_id <![CDATA[<]]> LENGTH(pm.meeting_data)-LENGTH(REPLACE(pm.meeting_data,',',''))+1 WHERE pm.meeting_data is not null) pht
from pay_meeting pm join mysql.help_topic ht on ht.help_topic_id <![CDATA[<]]> LENGTH(pm.meeting_data)-LENGTH(REPLACE(pm.meeting_data,',',''))+1 right join pay_meeting_remind_record pmrr on(pmrr.meeting_id=pm.id) WHERE pm.meeting_data is not null and pmrr.contact_id=#{id}) pht
left join oss_file ossf on (pht.fileId=ossf.id)) ail
<where>
<if test="fileName!=null and fileName!=''">
@@ -41,5 +41,5 @@ public interface IPayWorkingGroupDistributionRecordService extends IService<PayW
* @param fileName
* @return
*/
IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page, String fileName);
IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page, String fileName, String id);
}
@@ -331,8 +331,8 @@ public class PayWorkingGroupDistributionRecordServiceImpl extends ServiceImpl<Pa
}
@Override
public IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page, String fileName) {
return payWorkingGroupDistributionRecordMapper.pageFileList(page,fileName);
public IPage<DownloadFileRecord> pageFileList(Page<DownloadFileRecord> page, String fileName, String id) {
return payWorkingGroupDistributionRecordMapper.pageFileList(page,fileName,id);
}
private void setRecord(PayWorkingGroupDistributionRecord payWorkingGroupDistributionRecord,String[] s,List<PayWorkingGroupDistributionRecord> listPayWorkingGroupDistributionRecord,OSSFile byId){