更新
This commit is contained in:
parent
4b60ceaac2
commit
c770cbbea1
@ -69,10 +69,8 @@ public class InspectionFileController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/listByPermission")
|
||||
public CommonResult listByPermission(InspectionFile inspectionFile) throws Exception {
|
||||
// ShopMallPartners partners = partnerService.shopInfoByUserId();
|
||||
// inspectionFile.setPartnerId(partners.getPartnerId());
|
||||
//判断当前登陆人的角色是否是可以查看文件
|
||||
boolean ifFile = permissionApi.hasDictTypeRole("ins_file_role");
|
||||
boolean ifFile = permissionApi.hasDictTypeRole(inspectionFile.getDictType());
|
||||
if (ifFile) {
|
||||
return success(inspectionFileService.selectInspectionFileList(inspectionFile));
|
||||
}else {
|
||||
|
@ -33,9 +33,7 @@ public class InspectionFileRecordController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/get/{id}")
|
||||
public CommonResult<?> getByFileId(@PathVariable Long id) {
|
||||
List<InspectionFileRecord> list = inspectionFileRecordService.list(Wrappers.lambdaQuery(InspectionFileRecord.class)
|
||||
.eq(InspectionFileRecord::getFileId, id)
|
||||
.orderBy(true, true, InspectionFileRecord::getCreateTime));
|
||||
List<InspectionFileRecord> list = inspectionFileRecordService.getRecordList(id);
|
||||
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
@ -53,6 +53,9 @@ public class InspectionFile extends TenantBaseDO
|
||||
/** 员工、设备的默认文件夹*/
|
||||
private String defaultKey;
|
||||
|
||||
/** 服务套餐id */
|
||||
private String servicePackageId;
|
||||
|
||||
/**
|
||||
* 是否为员工附 0-是 1-否
|
||||
*/
|
||||
@ -67,4 +70,7 @@ public class InspectionFile extends TenantBaseDO
|
||||
|
||||
@TableField(exist = false)
|
||||
private String fileType;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String dictType;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.inspection.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -44,4 +45,7 @@ public class InspectionFileRecord extends TenantBaseDO {
|
||||
* 预警时间
|
||||
*/
|
||||
private Date warnTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 检测文档记录表
|
||||
* @Author: 86187
|
||||
@ -12,4 +14,10 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionFileRecordMapper extends BaseMapper<InspectionFileRecord> {
|
||||
/**
|
||||
* 获取检测文档记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<InspectionFileRecord> getRecordList(Long id);
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||
import cn.iocoder.yudao.module.inspection.entity.TreeCommonResult;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.inspection.service;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 检测文档记录表
|
||||
* @Author: 86187
|
||||
@ -10,4 +12,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface InspectionFileRecordService extends IService<InspectionFileRecord> {
|
||||
/**
|
||||
* 获取检测文档记录列表
|
||||
*
|
||||
* @param id 文档id
|
||||
* @return 检测文档记录列表
|
||||
*/
|
||||
List<InspectionFileRecord> getRecordList(Long id);
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.inspection.service.InspectionFileRecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 检测文档记录表
|
||||
* @Author: 86187
|
||||
@ -16,4 +18,14 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
public class InspectionFileRecordServiceImpl extends ServiceImpl<InspectionFileRecordMapper, InspectionFileRecord> implements InspectionFileRecordService {
|
||||
/**
|
||||
* 获取检测文档记录列表
|
||||
*
|
||||
* @param id 文档id
|
||||
* @return 检测文档记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<InspectionFileRecord> getRecordList(Long id) {
|
||||
return baseMapper.getRecordList(id);
|
||||
}
|
||||
}
|
||||
|
@ -234,6 +234,7 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
||||
} else {
|
||||
queryWrapper.isNull(InspectionFile::getFatherId);
|
||||
}
|
||||
queryWrapper.eq(InspectionFile::getServicePackageId, inspectionFile.getServicePackageId());
|
||||
queryWrapper.orderByAsc(InspectionFile::getType);
|
||||
queryWrapper.orderByDesc(InspectionFile::getCreateTime);
|
||||
if (ObjectUtil.isNotEmpty(inspectionFile.getFileName())) {
|
||||
@ -339,6 +340,7 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
||||
// 2. 获取所有文件及文件夹信息(避免多次查询数据库)
|
||||
// 1. 查询所有文件信息,确保只查询必要的字段,并通过索引优化文件名的like查询
|
||||
List<InspectionFile> fileList = this.list(Wrappers.lambdaQuery(InspectionFile.class)
|
||||
.eq(InspectionFile::getServicePackageId, inspectionFile.getServicePackageId())
|
||||
.select(InspectionFile::getId, InspectionFile::getFileName, InspectionFile::getFatherId, InspectionFile::getFilePath, InspectionFile::getType) // 仅查询必要字段
|
||||
// .like(ObjectUtil.isNotEmpty(inspectionFile.getFileName()), InspectionFile::getFileName, inspectionFile.getFileName())
|
||||
.orderBy(false, false, InspectionFile::getCreateTime));
|
||||
|
@ -480,6 +480,7 @@ FROM
|
||||
IFNULL(SUM(oi.sku_name LIKE '%上户%'),0) shNum,
|
||||
IFNULL(SUM(oi.sku_name LIKE '%非定检%'),0) fdjNum,
|
||||
IFNULL(SUM(oi.sku_name LIKE '%双燃料%'),0) srlNum,
|
||||
IFNULL(SUM(oi.sku_name LIKE '%其他检测%'),0) qtjcNum,
|
||||
IFNULL(SUM(ii.recheck_count),0) recheckNum,
|
||||
IFNULL(SUM(ii.reinspect_count),0) reinspectNum
|
||||
FROM
|
||||
@ -649,9 +650,11 @@ FROM
|
||||
ELSE '已支付'
|
||||
END AS pay,
|
||||
CASE
|
||||
WHEN has_status_0_or_null THEN '检测中'
|
||||
WHEN (ii.status = 0 OR ii.status = 2) AND has_status_1 THEN '检测中'
|
||||
WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成'
|
||||
/*WHEN THEN '检测中'*/
|
||||
/*WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成'*/
|
||||
WHEN ( ii.status = 1) THEN '已完成'
|
||||
/*WHEN ((ii.status = 0 OR ii.status = 2) AND has_status_1 OR has_status_0_or_null)THEN '检测中'*/
|
||||
WHEN ((ii.status = 0 OR ii.status = 2))THEN '检测中'
|
||||
WHEN (ii.status = 0 OR ii.status = 2) AND COALESCE(max_iwn_status, 0) = 0 THEN '待检测'
|
||||
ELSE '未知状态'
|
||||
END AS status,
|
||||
|
@ -3,4 +3,11 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionFileRecordMapper">
|
||||
<select id="getRecordList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord">
|
||||
select record.*,user.nickname
|
||||
from inspection_file_record record
|
||||
LEFT JOIN system_users user on record.creator = user.id
|
||||
where record.file_id = #{id}
|
||||
and record.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user