Compare commits
7 Commits
412897e5ac
...
691c3f3220
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
691c3f3220 | ||
|
|
5a8b8e92c3 | ||
|
|
c226a8692a | ||
|
|
beb37ddd78 | ||
|
|
8802208c01 | ||
|
|
ca9bdc21cc | ||
|
|
843a21a44e |
@ -33,7 +33,12 @@ public class InspectionMeetCarOrderController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
public CommonResult<?> get(Long id){
|
public CommonResult<?> get(Long id) {
|
||||||
return CommonResult.success(inspectionMeetCarOrderService.getById(id));
|
return CommonResult.success(inspectionMeetCarOrderService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public CommonResult<?> delete(Long id) {
|
||||||
|
return CommonResult.success(inspectionMeetCarOrderService.removeById(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -756,6 +756,17 @@ public class PartnerOwnController extends BaseController {
|
|||||||
return success(partnerList.staticsTable3(partners.getPartnerId(), startTime, endTime));
|
return success(partnerList.staticsTable3(partners.getPartnerId(), startTime, endTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户来源统计
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/customerSourceCount")
|
||||||
|
public CommonResult<?> customerSourceCount(String startTime, String endTime, Long businessId) {
|
||||||
|
return success(partnerList.customerSourceCount(startTime, endTime, businessId));
|
||||||
|
}
|
||||||
|
|
||||||
//新统计表格3
|
//新统计表格3
|
||||||
@GetMapping("/newStaticsTable3")
|
@GetMapping("/newStaticsTable3")
|
||||||
public CommonResult newStaticsTable3(String startTime, String endTime) throws Exception {
|
public CommonResult newStaticsTable3(String startTime, String endTime) throws Exception {
|
||||||
@ -899,4 +910,16 @@ public class PartnerOwnController extends BaseController {
|
|||||||
public CommonResult<?> getStaffCount(@RequestBody DlInspectionProject dlInspectionProject) {
|
public CommonResult<?> getStaffCount(@RequestBody DlInspectionProject dlInspectionProject) {
|
||||||
return success(partnerList.getStaffCount(dlInspectionProject));
|
return success(partnerList.getStaffCount(dlInspectionProject));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件统计
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/fileStatistics")
|
||||||
|
public CommonResult<?> fileStatistics(String servicePackageId,@RequestParam(value = "startTime", required = false) String startTime,
|
||||||
|
@RequestParam(value = "endTime", required = false) String endTime){
|
||||||
|
return success(partnerList.fileStatistics(servicePackageId,startTime, endTime));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,69 @@
|
|||||||
|
package cn.iocoder.yudao.module.inspection.controller.admin;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/channel")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InspectionBusinessChannelController {
|
||||||
|
|
||||||
|
private final InspectionBusinessChannelService inspectionBusinessChannelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务渠道/客户来源树结构
|
||||||
|
*/
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public CommonResult<List<InspectionBusinessChannel>> getChannelTree(InspectionBusinessChannel channel) {
|
||||||
|
return CommonResult.success(inspectionBusinessChannelService.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
|
||||||
|
.like(ObjectUtil.isNotEmpty(channel.getName()), InspectionBusinessChannel::getName, channel.getName())));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增业务渠道或客户来源
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public boolean addChannel(@RequestBody InspectionBusinessChannel channel) {
|
||||||
|
return inspectionBusinessChannelService.save(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务渠道或客户来源
|
||||||
|
*/
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public CommonResult<InspectionBusinessChannel> getChannelById(@PathVariable("id") Long id) {
|
||||||
|
return CommonResult.success(inspectionBusinessChannelService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改业务渠道或客户来源
|
||||||
|
*/
|
||||||
|
@PutMapping("/update")
|
||||||
|
public CommonResult<?> updateChannel(@RequestBody InspectionBusinessChannel channel) {
|
||||||
|
return CommonResult.success(inspectionBusinessChannelService.updateById(channel));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除业务渠道或客户来源
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public CommonResult<?> deleteChannel(@PathVariable("id") Long id) {
|
||||||
|
return CommonResult.success(inspectionBusinessChannelService.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务渠道或客户来源列表(app)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public CommonResult<?> list(){
|
||||||
|
return CommonResult.success(inspectionBusinessChannelService.getChannelTree());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
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.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InspectionBusinessChannel extends TenantBaseDO {
|
||||||
|
|
||||||
|
private Integer id; // 主键ID
|
||||||
|
|
||||||
|
private Integer pid; // 父ID
|
||||||
|
|
||||||
|
private String name; // 名称
|
||||||
|
|
||||||
|
private Integer type; // 0-业务渠道 1-客户来源
|
||||||
|
|
||||||
|
// 子节点
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<InspectionBusinessChannel> children;
|
||||||
|
}
|
||||||
@ -34,6 +34,8 @@ public class InspectionInfo extends TenantBaseDO
|
|||||||
private String buyPhone;
|
private String buyPhone;
|
||||||
private String userAddress;
|
private String userAddress;
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
private Integer customerSourceId; //客户来源id
|
||||||
|
private Integer businessChannelId; //业务渠道id
|
||||||
|
|
||||||
private Long partnerId;
|
private Long partnerId;
|
||||||
/** 检测工主键 */
|
/** 检测工主键 */
|
||||||
@ -69,6 +71,8 @@ public class InspectionInfo extends TenantBaseDO
|
|||||||
private Integer recheckCount;
|
private Integer recheckCount;
|
||||||
/** 重检次数 */
|
/** 重检次数 */
|
||||||
private Integer reinspectCount;
|
private Integer reinspectCount;
|
||||||
|
private String businessChannel; //业务渠道
|
||||||
|
private String otherName;
|
||||||
|
|
||||||
/** 0进行中1已结束 */
|
/** 0进行中1已结束 */
|
||||||
@Excel(name = "0进行中1已结束")
|
@Excel(name = "0进行中1已结束")
|
||||||
|
|||||||
@ -65,6 +65,11 @@ public class InspectionMeetCarOrder extends TenantBaseDO {
|
|||||||
private String goodsTitle;
|
private String goodsTitle;
|
||||||
private Long skuId;
|
private Long skuId;
|
||||||
private String skuName;
|
private String skuName;
|
||||||
|
private String otherPhone;
|
||||||
|
private String otherName;
|
||||||
|
private String businessChannel; //业务渠道
|
||||||
|
private Integer customerSourceId; //客户来源id
|
||||||
|
private Integer businessChannelId; //业务渠道id
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接车类型 0接待 1上门取车
|
* 接车类型 0接待 1上门取车
|
||||||
|
|||||||
@ -135,4 +135,14 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
|||||||
* @param endTime 结束时间
|
* @param endTime 结束时间
|
||||||
*/
|
*/
|
||||||
List<Map<String, Object>> queryInspectionSkuList(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
List<Map<String, Object>> queryInspectionSkuList(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务统计
|
||||||
|
* @param startTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> selectBusinessStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
|
List<Map<String, Object>> customerSourceCount(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("businessId") Long businessId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
package cn.iocoder.yudao.module.inspection.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface InspectionBusinessChannelMapper extends BaseMapper<InspectionBusinessChannel> {
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
|||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -20,4 +21,6 @@ public interface InspectionFileRecordMapper extends BaseMapper<InspectionFileRec
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<InspectionFileRecord> getRecordList(Long id);
|
List<InspectionFileRecord> getRecordList(Long id);
|
||||||
|
|
||||||
|
long queryCount(@Param("servicePackageId") String servicePackageId,@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,4 +40,7 @@ public class OrderTableQuery {
|
|||||||
|
|
||||||
/** 等于1时是查询预约转订单 */
|
/** 等于1时是查询预约转订单 */
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
/** 检测时长 */
|
||||||
|
private String[] inspectionTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,4 +243,23 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
|
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件统计
|
||||||
|
*
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Map<String, Object> fileStatistics(String servicePackageId, String startTime, String endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户来源统计
|
||||||
|
*
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @param businessId 业务渠道id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> customerSourceCount(String startTime, String endTime, Long businessId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
package cn.iocoder.yudao.module.inspection.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface InspectionBusinessChannelService extends IService<InspectionBusinessChannel> {
|
||||||
|
List<InspectionBusinessChannel> getChannelTree();
|
||||||
|
}
|
||||||
@ -19,4 +19,6 @@ public interface InspectionFileRecordService extends IService<InspectionFileReco
|
|||||||
* @return 检测文档记录列表
|
* @return 检测文档记录列表
|
||||||
*/
|
*/
|
||||||
List<InspectionFileRecord> getRecordList(Long id);
|
List<InspectionFileRecord> getRecordList(Long id);
|
||||||
|
|
||||||
|
long queryCount(String servicePackageId, String startTime, String endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@ -74,6 +75,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.temporal.TemporalAdjusters;
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service("appInspectionPartnerService")
|
@Service("appInspectionPartnerService")
|
||||||
@ -139,6 +141,10 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
private InspectionSocket inspectionSocket;
|
private InspectionSocket inspectionSocket;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInspectionWorkNodeService workNodeService;
|
private IInspectionWorkNodeService workNodeService;
|
||||||
|
@Autowired
|
||||||
|
private IInspectionFileService inspectionFileService;
|
||||||
|
@Autowired
|
||||||
|
private InspectionFileRecordService inspectionFileRecordService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
||||||
@ -1530,73 +1536,144 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
@Override
|
@Override
|
||||||
public InspectionInfoVo inspectionDetail(Long inspectionInfoId) {
|
public InspectionInfoVo inspectionDetail(Long inspectionInfoId) {
|
||||||
InspectionInfo info = inspectionInfoService.getById(inspectionInfoId);
|
InspectionInfo info = inspectionInfoService.getById(inspectionInfoId);
|
||||||
|
if (info == null) return null;
|
||||||
|
|
||||||
OrderInfo order = orderService.getById(info.getInspectionOrderId());
|
OrderInfo order = orderService.getById(info.getInspectionOrderId());
|
||||||
|
if (order == null) return null;
|
||||||
|
|
||||||
InspectionGoodsSku sku = skuService.getById(order.getSkuId());
|
InspectionGoodsSku sku = skuService.getById(order.getSkuId());
|
||||||
AdminUserDO buyUser = userService.getUser(info.getUserId());
|
ShopInspectionGoods goods = goodsService.getById(order.getGoodsId());
|
||||||
AdminUserDO worker = userService.getUser(info.getWorkId());
|
ShopInspectionCategory category = categoryService.getById(info.getCategoryId());
|
||||||
|
|
||||||
|
// 批量查询用户信息
|
||||||
|
Set<Long> userIds = new HashSet<>();
|
||||||
|
userIds.add(info.getUserId());
|
||||||
|
userIds.add(info.getWorkId());
|
||||||
|
if (info.getLeadManId() != null) userIds.add(info.getLeadManId());
|
||||||
|
if (info.getMeetManId() != null) userIds.add(info.getMeetManId());
|
||||||
|
|
||||||
|
List<AdminUserDO> userList = userService.list(Wrappers.<AdminUserDO>lambdaQuery()
|
||||||
|
.in(AdminUserDO::getId,userIds)); // 你需新增 getUsers(Collection<Long> ids)
|
||||||
|
|
||||||
|
//转为map
|
||||||
|
Map<Long, AdminUserDO> userMap = userList.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity()));
|
||||||
|
|
||||||
|
AdminUserDO buyUser = userMap.get(info.getUserId());
|
||||||
|
AdminUserDO worker = userMap.get(info.getWorkId());
|
||||||
|
AdminUserDO leadMan = userMap.get(info.getLeadManId());
|
||||||
|
AdminUserDO meetMan = userMap.get(info.getMeetManId());
|
||||||
|
|
||||||
InspectionInfoVo res = new InspectionInfoVo();
|
InspectionInfoVo res = new InspectionInfoVo();
|
||||||
BeanUtils.copyProperties(order, res);
|
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
|
||||||
|
|
||||||
res.setInspectionId(info.getId());
|
res.setInspectionId(info.getId());
|
||||||
if (ObjectUtil.isNotNull(worker)) {
|
res.setBuyUserName(buyUser != null ? buyUser.getNickname() : "");
|
||||||
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
|
res.setBuyUserPhone(buyUser != null ? buyUser.getMobile() : "");
|
||||||
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
|
|
||||||
|
if (worker != null) {
|
||||||
|
res.setWorkerAvatar(worker.getAvatar());
|
||||||
|
res.setWorkerName(worker.getNickname());
|
||||||
res.setWorkerPhone(worker.getMobile());
|
res.setWorkerPhone(worker.getMobile());
|
||||||
}
|
}
|
||||||
/*根据工单表中的leadManId查询对应的引车员*/
|
|
||||||
if (ObjectUtil.isNotNull(info.getLeadManId())) {
|
res.setOtherName(info.getOtherName());
|
||||||
AdminUserDO leadMan = adminUserService.getById(info.getLeadManId());
|
res.setOtherPhone(info.getOtherPhone());
|
||||||
if (ObjectUtil.isNotNull(leadMan)) {
|
res.setCustomerSource(info.getCustomerSource());
|
||||||
res.setLeadManName(leadMan.getNickname());
|
res.setBusinessChannel(info.getBusinessChannel());
|
||||||
res.setLeadManId(info.getLeadManId());
|
|
||||||
}
|
// 车系处理
|
||||||
|
res.setCarModel(extractCarModel(info.getCarModel()));
|
||||||
|
|
||||||
|
// 处理检测时长
|
||||||
|
if ("1".equals(info.getStatus())) {
|
||||||
|
long durationMs = calculateInspectionDuration(info);
|
||||||
|
res.setInspectionDuration(formatDuration(durationMs));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.getCarRegisterDate() != null) {
|
||||||
|
long days = DateUtil.between(info.getCarRegisterDate(), new Date(), DateUnit.DAY);
|
||||||
|
long carAge = days / 365; // 向下取整
|
||||||
|
res.setCarAge(carAge);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (leadMan != null) {
|
||||||
|
res.setLeadManName(leadMan.getNickname());
|
||||||
|
res.setLeadManId(leadMan.getId());
|
||||||
} else {
|
} else {
|
||||||
res.setLeadManName("");
|
res.setLeadManName("");
|
||||||
}
|
}
|
||||||
/*根据工单表中的meetManId查询对应的 MeetMan*/
|
|
||||||
if (ObjectUtil.isNotNull(info.getMeetManId())) {
|
if (meetMan != null) {
|
||||||
AdminUserDO meetMan = adminUserService.getById(info.getMeetManId());
|
res.setMeetManName(meetMan.getNickname());
|
||||||
if (ObjectUtil.isNotNull(meetMan)) {
|
res.setMeetManId(meetMan.getId());
|
||||||
res.setMeetManName(meetMan.getNickname());
|
|
||||||
res.setMeetManId(info.getMeetManId());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
res.setMeetManName("");
|
res.setMeetManName("");
|
||||||
}
|
}
|
||||||
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
|
||||||
res.setBuyUserPhone(buyUser.getMobile());
|
// 设置订单相关字段
|
||||||
|
res.setGoodsId(order.getGoodsId());
|
||||||
|
res.setGoodsPrice(order.getGoodsPrice());
|
||||||
|
res.setIsOnline(order.getIsOnline());
|
||||||
|
res.setOrderStatus(order.getOrderStatus());
|
||||||
|
|
||||||
|
// SKU 信息
|
||||||
|
res.setGoodsName(sku != null ? sku.getSkuName() : null);
|
||||||
|
|
||||||
|
// 图片
|
||||||
|
res.setGoodsImage(goods != null ? goods.getImage() : null);
|
||||||
|
|
||||||
|
// 检测信息字段
|
||||||
res.setCarNum(info.getCarNum());
|
res.setCarNum(info.getCarNum());
|
||||||
res.setCategoryId(info.getCategoryId());
|
res.setCategoryId(info.getCategoryId());
|
||||||
|
res.setCarType(category != null ? category.getCategoryName() : null);
|
||||||
res.setStartTime(info.getStartTime());
|
res.setStartTime(info.getStartTime());
|
||||||
res.setEndTime(info.getEndTime());
|
res.setEndTime(info.getEndTime());
|
||||||
res.setStatus(info.getStatus());
|
res.setStatus(info.getStatus());
|
||||||
res.setGoodsId(order.getGoodsId());
|
|
||||||
res.setGoodsPrice(order.getGoodsPrice());
|
|
||||||
res.setGoodsName(sku.getSkuName());
|
|
||||||
res.setIsOnline(order.getIsOnline());
|
|
||||||
res.setRecheckCount(info.getRecheckCount());
|
res.setRecheckCount(info.getRecheckCount());
|
||||||
res.setReinspectCount(info.getReinspectCount());
|
res.setReinspectCount(info.getReinspectCount());
|
||||||
res.setIsRetrial(info.getIsRetrial());
|
res.setIsRetrial(info.getIsRetrial());
|
||||||
res.setIsPass(info.getIsPass());
|
res.setIsPass(info.getIsPass());
|
||||||
res.setRemark(info.getRemark());
|
res.setRemark(info.getRemark());
|
||||||
res.setMakeCert(info.getMakeCert());
|
res.setMakeCert(info.getMakeCert());
|
||||||
res.setOrderStatus(order.getOrderStatus());
|
|
||||||
ShopInspectionGoods goods = goodsService.getById(order.getGoodsId());
|
// 步骤信息
|
||||||
res.setGoodsImage(goods.getImage());
|
|
||||||
LambdaQueryWrapper<InspectionStepInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(InspectionStepInfo::getInspectionInfoId, inspectionInfoId).orderByAsc(InspectionStepInfo::getStepNum);
|
|
||||||
queryWrapper.orderBy(true, false, InspectionStepInfo::getId);
|
|
||||||
List<InspectionStepInfo> list = stepInfoService.listByInspectionInfoId(inspectionInfoId);
|
List<InspectionStepInfo> list = stepInfoService.listByInspectionInfoId(inspectionInfoId);
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
res.setStepInfos(list);
|
res.setStepInfos(list);
|
||||||
}
|
}
|
||||||
ShopInspectionCategory category = categoryService.getById(info.getCategoryId());
|
|
||||||
res.setCarType(category.getCategoryName());
|
// 工作节点
|
||||||
// 查询节点表
|
List<InspectionWorkNode> workNodes = inspectionWorkNodeService.getWeorkNodesById(inspectionInfoId.intValue());
|
||||||
List<InspectionWorkNode> workNodes = inspectionWorkNodeService.getWeorkNodesById(Integer.parseInt(String.valueOf(inspectionInfoId)));
|
|
||||||
res.setWorkNodes(workNodes);
|
res.setWorkNodes(workNodes);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String extractCarModel(String carModel) {
|
||||||
|
if (StrUtil.isBlank(carModel)) return null;
|
||||||
|
int idx = carModel.indexOf("牌");
|
||||||
|
return idx > 0 ? carModel.substring(0, idx) : carModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long calculateInspectionDuration(InspectionInfo info) {
|
||||||
|
if (info.getEndTime() != null) {
|
||||||
|
return DateUtil.betweenMs(info.getStartTime(), info.getEndTime());
|
||||||
|
}
|
||||||
|
InspectionStepInfo latest = stepInfoService.getOne(Wrappers.<InspectionStepInfo>lambdaQuery()
|
||||||
|
.eq(InspectionStepInfo::getInspectionInfoId, info.getId())
|
||||||
|
.orderByDesc(InspectionStepInfo::getCreateTime).last("LIMIT 1"));
|
||||||
|
return latest != null ? DateUtil.betweenMs(info.getStartTime(), latest.getUpdateTime()) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatDuration(long ms) {
|
||||||
|
long minutes = ms / (1000 * 60);
|
||||||
|
return (minutes / 60) + "小时" + (minutes % 60) + "分";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionInfo> workerInspectionList(Long workerId, String status, String searchValue) {
|
public List<InspectionInfo> workerInspectionList(Long workerId, String status, String searchValue) {
|
||||||
return baseMapper.workerInspectionList(workerId, status, searchValue);
|
return baseMapper.workerInspectionList(workerId, status, searchValue);
|
||||||
@ -1949,7 +2026,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
}
|
}
|
||||||
startTime = startTime + " 00:00:00";
|
startTime = startTime + " 00:00:00";
|
||||||
endTime = endTime + " 23:59:59";
|
endTime = endTime + " 23:59:59";
|
||||||
List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
|
// List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
|
||||||
|
List<Map<String, Object>> res = baseMapper.selectBusinessStatistics( startTime, endTime);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2241,4 +2319,55 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
}
|
}
|
||||||
return staffCount;
|
return staffCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件统计
|
||||||
|
*
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> fileStatistics(String servicePackageId,String startTime, String endTime) {
|
||||||
|
// 判断开始时间与结束时间如果为空 默认查询本月
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
long addCount = inspectionFileService.count(Wrappers.<InspectionFile>lambdaQuery()
|
||||||
|
.eq(InspectionFile::getServicePackageId, servicePackageId)
|
||||||
|
.between(InspectionFile::getCreateTime, startTime, endTime));
|
||||||
|
|
||||||
|
// 查询文件记录表
|
||||||
|
long updateCount = inspectionFileRecordService.queryCount(servicePackageId, startTime, endTime);
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("addCount", addCount);
|
||||||
|
map.put("updateCount", updateCount);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户来源统计
|
||||||
|
*
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> customerSourceCount(String startTime, String endTime, Long businessId) {
|
||||||
|
// 判断开始时间与结束时间如果为空 默认查询本月
|
||||||
|
if (StringUtils.isNotEmpty(startTime)) {
|
||||||
|
startTime = startTime + " 00:00:00";
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(endTime)) {
|
||||||
|
endTime = endTime + " 23:59:59";
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> maps = baseMapper.customerSourceCount(startTime, endTime, businessId);
|
||||||
|
// 根据map中的theNum从大到小排序
|
||||||
|
maps.sort(Comparator.comparingInt(map -> -Integer.parseInt(map.get("theNum").toString())));
|
||||||
|
return maps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.inspection.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||||
|
import cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class InspectionBusinessChannelServiceImpl extends ServiceImpl<InspectionBusinessChannelMapper, InspectionBusinessChannel> implements InspectionBusinessChannelService {
|
||||||
|
@Override
|
||||||
|
public List<InspectionBusinessChannel> getChannelTree() {
|
||||||
|
// 查询所有业务渠道(父节点)
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -28,4 +28,15 @@ public class InspectionFileRecordServiceImpl extends ServiceImpl<InspectionFileR
|
|||||||
public List<InspectionFileRecord> getRecordList(Long id) {
|
public List<InspectionFileRecord> getRecordList(Long id) {
|
||||||
return baseMapper.getRecordList(id);
|
return baseMapper.getRecordList(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param servicePackageId
|
||||||
|
* @param startTime
|
||||||
|
* @param endTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public long queryCount(String servicePackageId, String startTime, String endTime) {
|
||||||
|
return baseMapper.queryCount(servicePackageId, startTime, endTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -221,9 +221,9 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
// 更新或插入步骤信息
|
// 更新或插入步骤信息
|
||||||
DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
|
DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
|
||||||
.eq(DlInspectionProject::getId, workNode.getProjectId()));
|
.eq(DlInspectionProject::getId, workNode.getProjectId()));
|
||||||
// 判断检测项目是否包含制证
|
// 判断检测项目是否包含制证 并且是合格
|
||||||
if (ObjectUtil.isNotEmpty(project)) {
|
if (ObjectUtil.isNotEmpty(project)) {
|
||||||
if (project.getProjectName().contains("制证")) {
|
if (project.getProjectName().contains("制证") && "1".equals(inspectionWorkNode.getType())) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,15 @@ public class InspectionInfoVo {
|
|||||||
private Date validationTime;
|
private Date validationTime;
|
||||||
// 核销人
|
// 核销人
|
||||||
private String validationRealName;
|
private String validationRealName;
|
||||||
|
private String businessChannel; //业务渠道
|
||||||
|
//客户来源
|
||||||
|
private String customerSource;
|
||||||
|
//车辆品牌型号
|
||||||
|
private String carModel;
|
||||||
|
//检测时长
|
||||||
|
private String inspectionDuration;
|
||||||
|
//车龄
|
||||||
|
private Long carAge;
|
||||||
//优惠金额
|
//优惠金额
|
||||||
private Long couponDiscount = 0L;
|
private Long couponDiscount = 0L;
|
||||||
//实付金额 分
|
//实付金额 分
|
||||||
@ -101,4 +110,6 @@ public class InspectionInfoVo {
|
|||||||
private String meetManName;
|
private String meetManName;
|
||||||
/** 是否接车*/
|
/** 是否接车*/
|
||||||
private String isMeetCar;
|
private String isMeetCar;
|
||||||
|
private String otherName;
|
||||||
|
private String otherPhone;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,12 @@ public class OrderTable {
|
|||||||
/** 客户来源 */
|
/** 客户来源 */
|
||||||
private String customerSource;
|
private String customerSource;
|
||||||
|
|
||||||
|
/** 业务渠道 */
|
||||||
|
private String businessChannel;
|
||||||
|
|
||||||
/** 车辆型号 */
|
/** 车辆型号 */
|
||||||
private String carModel;
|
private String carModel;
|
||||||
|
|
||||||
|
/** 检测次数 */
|
||||||
|
private Integer inspectionCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,10 +163,10 @@ public class OrderController extends BaseController {
|
|||||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
//判断商家是否开启评论区
|
//判断商家是否开启评论区
|
||||||
ShopMallPartners partners = partnerService.getById(partnerId);
|
// ShopMallPartners partners = partnerService.getById(partnerId);
|
||||||
if (StringUtils.isEmpty(partners.getOpenComment())||partners.getOpenComment().equals("0")){
|
// if (StringUtils.isEmpty(partners.getOpenComment())||partners.getOpenComment().equals("0")){
|
||||||
return success(new ArrayList<>());
|
// return success(new ArrayList<>());
|
||||||
}
|
// }
|
||||||
Page<commentVo> page = new Page<>(pageNum, pageSize);
|
Page<commentVo> page = new Page<>(pageNum, pageSize);
|
||||||
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,partnerId);
|
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,partnerId);
|
||||||
return success(commentOrderList);
|
return success(commentOrderList);
|
||||||
|
|||||||
@ -15,4 +15,5 @@ public class commentVo extends TenantBaseDO {
|
|||||||
private String realName;
|
private String realName;
|
||||||
private String goodsTitle;
|
private String goodsTitle;
|
||||||
private String userImg="http://www.nuoyunr.com/lananRsc/xlg.png";
|
private String userImg="http://www.nuoyunr.com/lananRsc/xlg.png";
|
||||||
|
private Long inspectionInfoId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -629,6 +629,8 @@ FROM
|
|||||||
t.createTime,
|
t.createTime,
|
||||||
t.customerSource,
|
t.customerSource,
|
||||||
t.carModel,
|
t.carModel,
|
||||||
|
t.inspectionCount,
|
||||||
|
t.businessChannel,
|
||||||
CASE
|
CASE
|
||||||
WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格'
|
WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格'
|
||||||
WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格'
|
WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格'
|
||||||
@ -644,7 +646,9 @@ FROM
|
|||||||
oi.pay_time AS payTime, -- 新增字段
|
oi.pay_time AS payTime, -- 新增字段
|
||||||
oi.create_time AS createTime,
|
oi.create_time AS createTime,
|
||||||
ii.customer_source AS customerSource,
|
ii.customer_source AS customerSource,
|
||||||
|
ii.business_channel AS businessChannel,
|
||||||
ii.car_model AS carModel,
|
ii.car_model AS carModel,
|
||||||
|
IFNULL(ii.recheck_count, 0) + IFNULL(ii.reinspect_count, 0) + 1 AS inspectionCount,
|
||||||
CASE
|
CASE
|
||||||
WHEN oi.pay_type IS NULL THEN '未支付'
|
WHEN oi.pay_type IS NULL THEN '未支付'
|
||||||
ELSE '已支付'
|
ELSE '已支付'
|
||||||
@ -701,6 +705,16 @@ FROM
|
|||||||
AND (TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) >= #{query.carYear}
|
AND (TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) >= #{query.carYear}
|
||||||
AND TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) < #{query.carYear} + 1)
|
AND TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) < #{query.carYear} + 1)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.inspectionTime != null and query.inspectionTime.length == 2">
|
||||||
|
AND ii.start_time IS NOT NULL AND ii.end_time IS NOT NULL
|
||||||
|
AND TIMESTAMPDIFF(MINUTE, ii.start_time, ii.end_time)
|
||||||
|
BETWEEN #{query.inspectionTime[0]} AND #{query.inspectionTime[1]}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="query.inspectionTime[0] !=null and query.inspectionTime.length == 1">
|
||||||
|
AND ii.start_time IS NOT NULL AND ii.end_time IS NOT NULL
|
||||||
|
AND TIMESTAMPDIFF(MINUTE, ii.start_time, ii.end_time) >= #{query.inspectionTime[0]}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
AND oi.deleted = '0'
|
AND oi.deleted = '0'
|
||||||
) t
|
) t
|
||||||
@ -801,4 +815,54 @@ FROM
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
s.sku_name
|
s.sku_name
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectBusinessStatistics" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
ibc.id,
|
||||||
|
ibc.name,
|
||||||
|
COUNT(ii.id) AS theNum,
|
||||||
|
ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount
|
||||||
|
FROM
|
||||||
|
inspection_business_channel ibc
|
||||||
|
LEFT JOIN
|
||||||
|
inspection_info ii
|
||||||
|
ON ibc.name = ii.business_channel AND ii.deleted = '0'
|
||||||
|
<if test="startTime != null">
|
||||||
|
AND ii.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
LEFT JOIN
|
||||||
|
order_info oi
|
||||||
|
ON oi.id = ii.inspection_order_id AND oi.deleted = '0'
|
||||||
|
WHERE
|
||||||
|
ibc.deleted = '0'
|
||||||
|
AND ibc.type = '0'
|
||||||
|
GROUP BY
|
||||||
|
ibc.name
|
||||||
|
</select>
|
||||||
|
<select id="customerSourceCount" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
ibc.id,
|
||||||
|
ibc.name,
|
||||||
|
COUNT(ii.id) AS theNum,
|
||||||
|
ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount
|
||||||
|
FROM
|
||||||
|
inspection_business_channel ibc
|
||||||
|
LEFT JOIN
|
||||||
|
inspection_info ii
|
||||||
|
ON ibc.name = ii.customer_source AND ii.deleted = '0'
|
||||||
|
<if test="startTime != null">
|
||||||
|
AND ii.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
LEFT JOIN
|
||||||
|
order_info oi
|
||||||
|
ON oi.id = ii.inspection_order_id AND oi.deleted = '0'
|
||||||
|
WHERE
|
||||||
|
ibc.deleted = '0'
|
||||||
|
AND ibc.type = '1'
|
||||||
|
<if test="businessId != null">
|
||||||
|
AND ibc.pid = #{businessId}
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
ibc.name
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -10,4 +10,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where record.file_id = #{id}
|
where record.file_id = #{id}
|
||||||
and record.deleted = 0
|
and record.deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryCount" resultType="java.lang.Long">
|
||||||
|
select count(1)
|
||||||
|
from inspection_file_record record
|
||||||
|
INNER JOIN inspection_file file on record.file_id = file.id
|
||||||
|
where record.deleted = 0
|
||||||
|
AND file.service_package_id = #{servicePackageId}
|
||||||
|
<if test="startTime != null">
|
||||||
|
AND record.create_time between #{startTime} and #{endTime}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -231,10 +231,11 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getCommentOrderList" resultType = "cn.iocoder.yudao.module.payment.entity.commentVo">
|
<select id="getCommentOrderList" resultType = "cn.iocoder.yudao.module.payment.entity.commentVo">
|
||||||
SELECT
|
SELECT
|
||||||
real_name,comment_desc ,comment_star,comment_time,goods_title
|
oi.real_name,oi.comment_desc ,oi.comment_star,oi.comment_time,oi.goods_title,info.id inspectionInfoId
|
||||||
FROM
|
FROM
|
||||||
order_info
|
order_info oi
|
||||||
where partner_id = #{partnerId} and comment_star is not null
|
LEFT JOIN inspection_info info ON oi.id = info.inspection_order_id
|
||||||
|
where comment_star is not null
|
||||||
ORDER BY comment_time desc
|
ORDER BY comment_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="pageOrderListSystem" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
|
<select id="pageOrderListSystem" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
|
||||||
|
|||||||
@ -457,6 +457,45 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
||||||
Map<String, Object> rtnMap = new HashMap<>();
|
Map<String, Object> rtnMap = new HashMap<>();
|
||||||
rtnMap.put("all", list.size());
|
rtnMap.put("all", list.size());
|
||||||
|
|
||||||
|
// 按 courseType 分组
|
||||||
|
Map<String, List<DlDriveSchoolStaffVO>> courseTypeMap = list.stream()
|
||||||
|
.filter(item -> item.getCourseType() != null)
|
||||||
|
.collect(Collectors.groupingBy(DlDriveSchoolStaffVO::getCourseType));
|
||||||
|
|
||||||
|
// 统计各 courseType 的总人数
|
||||||
|
for (String courseType : courseTypeMap.keySet()) {
|
||||||
|
rtnMap.put(courseType, courseTypeMap.get(courseType).size());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按毕业状态分组(gradTime 是否为空)
|
||||||
|
Map<String, List<DlDriveSchoolStaffVO>> graduatedMap = list.stream()
|
||||||
|
.filter(item -> item.getCourseType() != null)
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
item -> item.getGradTime() != null ? "graduated" : "notGraduated"
|
||||||
|
));
|
||||||
|
|
||||||
|
// 统计总毕业/未毕业人数
|
||||||
|
rtnMap.put("graduated", graduatedMap.getOrDefault("graduated", Collections.emptyList()).size());
|
||||||
|
rtnMap.put("notGraduated", graduatedMap.getOrDefault("notGraduated", Collections.emptyList()).size());
|
||||||
|
|
||||||
|
// 按 courseType + 毕业状态分组(例如:C1_graduated, C2_notGraduated)
|
||||||
|
Map<String, Long> courseTypeGraduatedCount = list.stream()
|
||||||
|
.filter(item -> item.getCourseType() != null)
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
item -> item.getCourseType() + "_" + (item.getGradTime() != null ? "graduated" : "notGraduated"),
|
||||||
|
Collectors.counting()
|
||||||
|
));
|
||||||
|
|
||||||
|
// 将 courseType + 毕业状态的统计结果放入 rtnMap
|
||||||
|
courseTypeGraduatedCount.forEach((key, count) -> rtnMap.put(key, count));
|
||||||
|
|
||||||
|
return rtnMap;
|
||||||
|
}
|
||||||
|
/*public Map<String, Object> getStudentCount() {
|
||||||
|
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
||||||
|
Map<String, Object> rtnMap = new HashMap<>();
|
||||||
|
rtnMap.put("all", list.size());
|
||||||
//按courseType分组
|
//按courseType分组
|
||||||
Map<String, List<DlDriveSchoolStaffVO>> map = list.stream()
|
Map<String, List<DlDriveSchoolStaffVO>> map = list.stream()
|
||||||
.filter(item -> item.getCourseType() != null) // 过滤掉 courseType 为 null 的元素
|
.filter(item -> item.getCourseType() != null) // 过滤掉 courseType 为 null 的元素
|
||||||
@ -487,5 +526,5 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
rtnMap.put("graduated", graduatedCount);
|
rtnMap.put("graduated", graduatedCount);
|
||||||
rtnMap.put("notGraduated", notGraduatedCount);
|
rtnMap.put("notGraduated", notGraduatedCount);
|
||||||
return rtnMap;
|
return rtnMap;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,4 +64,8 @@ public class DlDriveSchoolStaffVO {
|
|||||||
private List<String> age;
|
private List<String> age;
|
||||||
/**拿证天数*/
|
/**拿证天数*/
|
||||||
private Integer passDays;
|
private Integer passDays;
|
||||||
|
/**毕业时间*/
|
||||||
|
private Date gradTime;
|
||||||
|
/**拿证时间*/
|
||||||
|
private Date passTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -476,7 +476,9 @@
|
|||||||
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
||||||
SELECT
|
SELECT
|
||||||
main.id AS id,
|
main.id AS id,
|
||||||
dsco.course_type
|
dsco.course_type,
|
||||||
|
dsco.grad_time,
|
||||||
|
dsco.pass_time
|
||||||
FROM
|
FROM
|
||||||
drive_school_student main
|
drive_school_student main
|
||||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
||||||
|
|||||||
@ -58,6 +58,8 @@
|
|||||||
<if test="entity.courseName != null and entity.courseName != '' "> and dsp.name like concat('%', #{entity.courseName}, '%')</if>
|
<if test="entity.courseName != null and entity.courseName != '' "> and dsp.name like concat('%', #{entity.courseName}, '%')</if>
|
||||||
<if test="entity.userId != null "> and dsp.user_id = #{entity.userId}</if>
|
<if test="entity.userId != null "> and dsp.user_id = #{entity.userId}</if>
|
||||||
<if test="entity.courseId != null and entity.courseId != '' "> and dsp.course_id = #{entity.courseId}</if>
|
<if test="entity.courseId != null and entity.courseId != '' "> and dsp.course_id = #{entity.courseId}</if>
|
||||||
|
<if test="entity.subject != null "> and dsp.subject = #{entity.subject}</if>
|
||||||
|
<if test="entity.examStatus != null and entity.examStatus != '' "> and dsp.exam_status = #{entity.examStatus}</if>
|
||||||
<!--<if test="entity.studentIdCard != null and entity.studentIdCard != '' "> AND RIGHT(dss.id_card, 4) = RIGHT(#{entity.studentIdCard}, 4) </if>-->
|
<!--<if test="entity.studentIdCard != null and entity.studentIdCard != '' "> AND RIGHT(dss.id_card, 4) = RIGHT(#{entity.studentIdCard}, 4) </if>-->
|
||||||
<if test="entity.studentIdCard != null and entity.studentIdCard != '' ">
|
<if test="entity.studentIdCard != null and entity.studentIdCard != '' ">
|
||||||
<choose>
|
<choose>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user