This commit is contained in:
许允枞 2025-02-21 16:42:37 +08:00
parent bbaeff1b19
commit 423869f6ab
17 changed files with 200 additions and 7 deletions

View File

@ -163,4 +163,25 @@ public class InspectionEquInfoController extends BaseController {
}
}
/**
* 添加设备文件夹
*
* @param id 设备id
* @return 文件夹id
*/
@PostMapping("/addFolder")
public CommonResult<?> addFolder(@RequestBody Long id) {
return success(inspectionEquInfoService.addFolder(id));
}
/**
* 查询设备数量根据分类
*
* @return
*/
@GetMapping("/queryEquipmentCountByCategory")
public CommonResult<?> queryEquipmentCountByCategory() {
return success(inspectionEquInfoService.queryEquipmentCountByCategory());
}
}

View File

@ -169,6 +169,16 @@ public class InspectionStaffController extends BaseController {
}
}
/**
* 新增文件夹
* @param userId 用户id
* @return
*/
@PostMapping("/addFolder")
public CommonResult<?> addFolder(@RequestBody Long userId) {
return success(inspectionStaffService.addFolder(userId));
}
/**
* 校验信息
*

View File

@ -70,4 +70,6 @@ public class InspectionAppointment extends TenantBaseDO
private String carIdNo;
private Long pickCarId;
private String isRead;
@TableField(exist = false)
private String skuName;
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper;
import java.util.List;
import cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -34,4 +35,5 @@ public interface InspectionEquInfoMapper extends BaseMapper<InspectionEquInfo>
*/
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page, @Param("inspectionEquInfo") InspectionEquInfo inspectionEquInfo);
List<EquipmentCountVo> queryEquipmentCountByCategory();
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.service;
import java.util.List;
import java.util.Map;
import cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo;
import cn.iocoder.yudao.module.inspection.vo.InspectionEqInfoImportVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -71,4 +72,19 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo> {
* @return 结果
*/
Map<String, Object> importStaff(List<InspectionEqInfoImportVo> list);
/**
* 添加设备文件夹
*
* @param id 设备id
* @return 文件夹id
*/
Long addFolder(Long id);
/**
* 查询设备统计信息
*
* @return
*/
List<EquipmentCountVo> queryEquipmentCountByCategory();
}

View File

@ -108,4 +108,12 @@ public interface IInspectionFileService extends IService<InspectionFile> {
* @return
*/
Set<InspectionFile> selectInspectionFileListByPermissio(InspectionFile inspectionFile, Long userId);
/**
* 新增文件夹
*
* @param folderName 文件夹名称
* @return 文件夹id
*/
Long addFolder(String folderName);
}

View File

@ -67,5 +67,13 @@ public interface InspectionStaffService extends IService<InspectionStaff> {
* @return
*/
Map<String, Object> importStaff(List<StaffImportExcelVO> list);
/**
* 添加文件夹
*
* @param userId 用户id
* @return 文件夹id
*/
Long addFolder(Long userId);
}

View File

@ -1485,8 +1485,10 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
/*根据工单表中的leadManId查询对应的引车员*/
if (ObjectUtil.isNotNull(info.getLeadManId())) {
AdminUserDO leadMan = adminUserService.getById(info.getLeadManId());
res.setLeadManName(leadMan.getNickname());
res.setLeadManId(info.getLeadManId());
if (ObjectUtil.isNotNull(leadMan)) {
res.setLeadManName(leadMan.getNickname());
res.setLeadManId(info.getLeadManId());
}
} else {
res.setLeadManName("");
}

View File

@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
import cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo;
import cn.iocoder.yudao.module.inspection.vo.ImportEquipmentVo;
import cn.iocoder.yudao.module.inspection.vo.InspectionEqInfoImportVo;
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
@ -216,6 +217,34 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
return resultMap;
}
/**
* 添加设备文件夹
*
* @param id 设备id
* @return 文件夹id
*/
@Override
public Long addFolder(Long id) {
InspectionEquInfo inspectionEquInfo = this.getById(id);
if (ObjectUtil.isNotEmpty(inspectionEquInfo)) {
Long folderId = inspectionFileService.addFolder(inspectionEquInfo.getEquName());
//修改文件夹id
this.update(Wrappers.<InspectionEquInfo>lambdaUpdate().eq(InspectionEquInfo::getId, id).set(InspectionEquInfo::getFolderId, folderId));
return folderId;
}
return null;
}
/**
* 查询设备统计信息
*
* @return
*/
@Override
public List<EquipmentCountVo> queryEquipmentCountByCategory() {
return baseMapper.queryEquipmentCountByCategory();
}
/**
* 保存导入的设备信息
*

View File

@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.constant.InspectionConstants;
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
import cn.iocoder.yudao.module.inspection.entity.InspectionFileUser;
@ -363,6 +364,25 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
return resultFiles;
}
/**
* 新增文件夹
*
* @param folderName 文件夹名称
* @return 文件夹id
*/
@Override
public Long addFolder(String folderName) {
InspectionFile inspectionFile = new InspectionFile();
inspectionFile.setFileName(folderName + InspectionConstants.INSPECTION_FOLDER_SUFFIX);
inspectionFile.setType(InspectionConstants.INSPECTION_FOLDER);
inspectionFile.setIsStaffFile(InspectionConstants.INSPECTION_IS_STAFF_FILE);
baseMapper.insert(inspectionFile);
inspectionFile.setFileCode(inspectionFile.getId() + ",");
baseMapper.updateById(inspectionFile);
return inspectionFile.getId();
}
// 获取文件夹内的所有文件包括子文件夹的内容
private List<InspectionFile> getFilesInFolder(Long folderId, List<Long> accessibleFileIds, Map<Long, InspectionFile> fileCache) {
List<InspectionFile> filesInFolder = new ArrayList<>();

View File

@ -212,6 +212,32 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
return resultMap;
}
/**
* 添加文件夹
*
* @param userId 用户id
* @return 文件夹id
*/
@Override
public Long addFolder(Long userId) {
AdminUserDO user = userService.getUser(userId);
Long folderId = inspectionFileService.addFolder(user.getNickname());
//查询员工子表是否存在数据
InspectionStaff staff = this.getOne(Wrappers.<InspectionStaff>lambdaQuery().eq(InspectionStaff::getUserId, userId));
if (ObjectUtil.isNull(staff)) {
staff = new InspectionStaff();
staff.setUserId(userId);
staff.setFolderId(folderId);
//新增
this.save(staff);
} else {
//修改文件夹id
this.update(Wrappers.<InspectionStaff>lambdaUpdate().eq(InspectionStaff::getUserId, userId).set(InspectionStaff::getFolderId, folderId));
}
return folderId;
}
/**
* 保存检测员工
*

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.inspection.vo;
import lombok.Data;
/**
* @Description: 设备统计
* @Author: 86187
* @Date: 2025/02/21 9:54
* @Version: 1.0
*/
@Data
public class EquipmentCountVo {
/**
* 字典表的value
*/
private String categoryId;
/**
* 设备类型
*/
private String categoryName;
/**
* 设备数量
*/
private Long count;
}

View File

@ -12,5 +12,9 @@ public class StatisticsInfo {
private Integer todayOrderAmount=0;
private Integer srlNum=0;
private Integer hgNum=0;
/**
* 未完成数量
*/
private Integer uncompletedNum = 0;
}

View File

@ -113,7 +113,14 @@
or
(oi.is_online = '0' and oi.create_time is not null and oi.create_time like CONCAT(#{timeStr},'%'))
),0) as todayOrderNum, IfNULL(
sum((oi.pay_time like CONCAT(#{timeStr},'%') and oi.create_time like CONCAT(#{timeStr},'%'))),0) as workedNum
sum((oi.pay_time like CONCAT(#{timeStr},'%') and oi.create_time like CONCAT(#{timeStr},'%'))),0) as workedNum,
-- 统计当天未完成的订单
IFNULL(
SUM(
(oi.pay_time IS NULL OR oi.validation_time IS NULL) -- 订单未支付或未验证
AND oi.create_time LIKE CONCAT(#{timeStr},'%') -- 创建时间属于当天
), 0
) AS uncompletedNum
FROM
order_info oi
</select>

View File

@ -94,12 +94,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAppointmentList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionAppointment">
SELECT
ip.*,su.mobile as buyPhoneNum,su.nickname as buyName,ip.goods_title as goodsTitle,
suc.car_nature,suc.car_brand,suc.car_model,suc.car_no
suc.car_nature,suc.car_brand,suc.car_model,suc.car_no,igs.sku_name
FROM
inspection_appointment ip
INNER JOIN system_users su ON ip.user_id = su.id
left JOIN order_info oi ON ip.order_id = oi.id and oi.deleted=0
left join shop_user_car suc on suc.car_id = oi.user_car_id and suc.deleted=0
LEFT JOIN inspection_goods_sku igs on igs.id = ip.sku_id
where ip.deleted=0 and ip.partner_id = #{partnerId}
<if test="phoneNum!=null and phoneNum!=''">
and su.mobile like concat('%',#{phoneNum},'%')

View File

@ -34,5 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select * from inspection_equ_info
where id = #{id}
</select>
<select id="queryEquipmentCountByCategory"
resultType="cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo">
select sd.value categoryId, COUNT(iei.id) count , sd.label categoryName
FROM system_dict_data sd
LEFT JOIN inspection_equ_info iei ON iei.type = sd.value
WHERE sd.dict_type = 'ins_equ_type' and sd.deleted = 0 and iei.deleted = 0
GROUP BY sd.value
</select>
</mapper>

View File

@ -27,14 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join system_role sr2 on sr.role_id = sr2.id
<where>
su.deleted = 0 and sr2.service_package_id = 'jiance' and sr2.code != 'jcyh'
<if test="role.roleId != null">
and sr.role_id = #{role.roleId}
</if>
<if test="role.nickname != null">
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like CONCAT('%',#{role.nickname},'%'))
</if>
</where>
group by su.id
<if test="role.roleId != null">
HAVING SUM(sr.role_id = #{role.roleId}) > 0
</if>
order by su.nickname
</select>
<select id="userCodes" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserRoleDTO">