更新
This commit is contained in:
parent
b2ce977796
commit
e4346ad141
@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.inspection.enums.DriverLicenseType;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffExportVo;
|
||||
@ -181,15 +182,15 @@ public class InspectionStaffController extends BaseController {
|
||||
|
||||
/**
|
||||
* 获取已完成项目
|
||||
* @param userId 用户id
|
||||
* @param query 请求参数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getFinishProjectByUserId")
|
||||
public CommonResult<?> getFinishProjectByUserId(@RequestParam("userId") Long userId,
|
||||
public CommonResult<?> getFinishProjectByUserId(InspectionListQuery query,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<Map<String, Object>> page = new Page<>(pageNo, pageSize);
|
||||
return success(inspectionStaffService.getFinishProjectByUserId(page, userId));
|
||||
return success(inspectionStaffService.getFinishProjectByUserId(page, query));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,6 +23,7 @@ public class InspectionBusinessChannelController {
|
||||
@GetMapping("/tree")
|
||||
public CommonResult<List<InspectionBusinessChannel>> getChannelTree(InspectionBusinessChannel channel) {
|
||||
return CommonResult.success(inspectionBusinessChannelService.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
|
||||
.eq(ObjectUtil.isNotEmpty(channel.getType()), InspectionBusinessChannel::getType, channel.getType())
|
||||
.like(ObjectUtil.isNotEmpty(channel.getName()), InspectionBusinessChannel::getName, channel.getName())));
|
||||
}
|
||||
|
||||
@ -60,10 +61,11 @@ public class InspectionBusinessChannelController {
|
||||
|
||||
/**
|
||||
* 获取业务渠道或客户来源列表(app)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CommonResult<?> list(){
|
||||
public CommonResult<?> list() {
|
||||
return CommonResult.success(inspectionBusinessChannelService.getChannelTree());
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffProjectCountVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -50,5 +51,5 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
||||
*/
|
||||
List<Map<String, Object>> selectExceptionNodesByInspectionIds(@Param("ids") List<Long> idList);
|
||||
|
||||
IPage<Map<String, Object>> selectStaffProjectByUserId(@Param("page")Page<Map<String, Object>> page, @Param("userId") Long userId);
|
||||
IPage<Map<String, Object>> selectStaffProjectByUserId(@Param("page")Page<Map<String, Object>> page, @Param("query") InspectionListQuery query);
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.inspection.query;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InspectionListQuery {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 客户来源
|
||||
*/
|
||||
private String customerSource;
|
||||
}
|
@ -262,4 +262,13 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> customerSourceCount(String startTime, String endTime, Long businessId);
|
||||
|
||||
/**
|
||||
* 文件统计列表
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
Map<String, Object> fileStatisticsList(String servicePackageId, String startTime, String endTime);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.*;
|
||||
import cn.iocoder.yudao.module.inspection.query.GoodsQuery;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.vo.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -81,6 +82,6 @@ public interface InspectionStaffService extends IService<InspectionStaff> {
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, Long userId);
|
||||
IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, InspectionListQuery query);
|
||||
}
|
||||
|
||||
|
@ -2373,4 +2373,33 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
maps.sort(Comparator.comparingInt(map -> -Integer.parseInt(map.get("theNum").toString())));
|
||||
return maps;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件统计列表
|
||||
*
|
||||
* @param servicePackageId
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> fileStatisticsList(String servicePackageId, String startTime, String endTime) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
// 根据开始时间与结束时间查询新增文件
|
||||
if (StringUtils.isEmpty(startTime)) {
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(new Date()), "yyyy-MM-dd");
|
||||
}
|
||||
if (StringUtils.isEmpty(endTime)) {
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(new Date()), "yyyy-MM-dd");
|
||||
}
|
||||
List<InspectionFile> insertFile = inspectionFileService.list(Wrappers.<InspectionFile>lambdaQuery()
|
||||
.eq(InspectionFile::getServicePackageId, servicePackageId)
|
||||
.between(InspectionFile::getCreateTime, startTime, endTime));
|
||||
|
||||
result.put("insertFile", insertFile);
|
||||
|
||||
// 根据开始时间与结束时间查询修改文件
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionStaffMapper;
|
||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionWorkNodeMapper;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||
@ -259,8 +260,8 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, Long userId) {
|
||||
return inspectionWorkNodeMapper.selectStaffProjectByUserId(page,userId);
|
||||
public IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, InspectionListQuery query) {
|
||||
return inspectionWorkNodeMapper.selectStaffProjectByUserId(page,query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -289,36 +289,43 @@
|
||||
</select>
|
||||
<select id="selectStaffProjectByUserId" resultType="java.util.Map">
|
||||
SELECT
|
||||
ii.id AS inspectionInfoId,
|
||||
ii.user_id AS userId,
|
||||
ii.user_name AS userName,
|
||||
ii.buy_name AS buyName,
|
||||
ii.buy_phone AS buyPhone,
|
||||
ii.car_num AS carNum,
|
||||
ii.car_model AS carModel,
|
||||
ii.car_status AS carStatus,
|
||||
ii.start_time AS startTime,
|
||||
ii.end_time AS endTime,
|
||||
ii.unit_name AS unitName,
|
||||
ii.partner_id,
|
||||
ii.work_id AS workId,
|
||||
ii.worker_name AS workerName,
|
||||
ii.worker_phone AS workerPhone,
|
||||
ii.worker_avatar AS workerAvatar,
|
||||
CASE
|
||||
WHEN ii.is_pass = '0' THEN '不通过'
|
||||
WHEN ii.is_pass = '1' THEN '通过'
|
||||
WHEN ii.is_pass IS NULL THEN '进行中'
|
||||
ELSE '未知'
|
||||
END AS status,
|
||||
GROUP_CONCAT(ip.project_name ORDER BY iwn.order_num SEPARATOR ',') AS projectName
|
||||
ii.id AS inspectionInfoId,
|
||||
ii.user_id AS userId,
|
||||
ii.user_name AS userName,
|
||||
ii.buy_name AS buyName,
|
||||
ii.buy_phone AS buyPhone,
|
||||
ii.car_num AS carNum,
|
||||
ii.car_model AS carModel,
|
||||
ii.car_status AS carStatus,
|
||||
ii.start_time AS startTime,
|
||||
ii.end_time AS endTime,
|
||||
ii.unit_name AS unitName,
|
||||
ii.partner_id,
|
||||
ii.work_id AS workId,
|
||||
ii.worker_name AS workerName,
|
||||
ii.worker_phone AS workerPhone,
|
||||
ii.worker_avatar AS workerAvatar,
|
||||
CASE
|
||||
WHEN ii.is_pass = '0' THEN '不通过'
|
||||
WHEN ii.is_pass = '1' THEN '通过'
|
||||
WHEN ii.is_pass IS NULL THEN '进行中'
|
||||
ELSE '未知'
|
||||
END AS status,
|
||||
GROUP_CONCAT(ip.project_name ORDER BY iwn.order_num SEPARATOR ',') AS projectName
|
||||
FROM inspection_work_node iwn
|
||||
LEFT JOIN inspection_info ii ON iwn.inspection_info_id = ii.id
|
||||
LEFT JOIN inspection_project ip ON ip.id = iwn.project_id
|
||||
WHERE
|
||||
iwn.deal_user_id = #{userId}
|
||||
AND iwn.status = '2'
|
||||
AND iwn.deleted = b'0'
|
||||
LEFT JOIN inspection_info ii ON iwn.inspection_info_id = ii.id
|
||||
LEFT JOIN inspection_project ip ON ip.id = iwn.project_id
|
||||
<where>
|
||||
<if test="query.userId != null">
|
||||
AND iwn.deal_user_id = #{query.userId}
|
||||
</if>
|
||||
<if test="query.customerSource != null">
|
||||
AND ii.customer_source = #{query.customerSource}
|
||||
</if>
|
||||
|
||||
AND iwn.status = '2'
|
||||
AND iwn.deleted = b'0'
|
||||
</where>
|
||||
GROUP BY ii.id
|
||||
ORDER BY ii.start_time DESC;
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user