Compare commits
No commits in common. "691c3f3220510805aaeab9846a691a8abff2ed72" and "412897e5aceb2fffb29a8b89c7ad0ee5826ae55b" have entirely different histories.
691c3f3220
...
412897e5ac
@ -33,12 +33,7 @@ public class InspectionMeetCarOrderController {
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
public CommonResult<?> get(Long id) {
|
||||
public CommonResult<?> get(Long id){
|
||||
return CommonResult.success(inspectionMeetCarOrderService.getById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
public CommonResult<?> delete(Long id) {
|
||||
return CommonResult.success(inspectionMeetCarOrderService.removeById(id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -756,17 +756,6 @@ public class PartnerOwnController extends BaseController {
|
||||
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
|
||||
@GetMapping("/newStaticsTable3")
|
||||
public CommonResult newStaticsTable3(String startTime, String endTime) throws Exception {
|
||||
@ -910,16 +899,4 @@ public class PartnerOwnController extends BaseController {
|
||||
public CommonResult<?> getStaffCount(@RequestBody DlInspectionProject 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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
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,8 +34,6 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private String buyPhone;
|
||||
private String userAddress;
|
||||
private String unitName;
|
||||
private Integer customerSourceId; //客户来源id
|
||||
private Integer businessChannelId; //业务渠道id
|
||||
|
||||
private Long partnerId;
|
||||
/** 检测工主键 */
|
||||
@ -71,8 +69,6 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private Integer recheckCount;
|
||||
/** 重检次数 */
|
||||
private Integer reinspectCount;
|
||||
private String businessChannel; //业务渠道
|
||||
private String otherName;
|
||||
|
||||
/** 0进行中1已结束 */
|
||||
@Excel(name = "0进行中1已结束")
|
||||
|
||||
@ -65,11 +65,6 @@ public class InspectionMeetCarOrder extends TenantBaseDO {
|
||||
private String goodsTitle;
|
||||
private Long skuId;
|
||||
private String skuName;
|
||||
private String otherPhone;
|
||||
private String otherName;
|
||||
private String businessChannel; //业务渠道
|
||||
private Integer customerSourceId; //客户来源id
|
||||
private Integer businessChannelId; //业务渠道id
|
||||
|
||||
/**
|
||||
* 接车类型 0接待 1上门取车
|
||||
|
||||
@ -135,14 +135,4 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
||||
* @param 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);
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
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,7 +3,6 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFileRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -21,6 +20,4 @@ public interface InspectionFileRecordMapper extends BaseMapper<InspectionFileRec
|
||||
* @return
|
||||
*/
|
||||
List<InspectionFileRecord> getRecordList(Long id);
|
||||
|
||||
long queryCount(@Param("servicePackageId") String servicePackageId,@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
||||
@ -40,7 +40,4 @@ public class OrderTableQuery {
|
||||
|
||||
/** 等于1时是查询预约转订单 */
|
||||
private String type;
|
||||
|
||||
/** 检测时长 */
|
||||
private String[] inspectionTime;
|
||||
}
|
||||
|
||||
@ -243,23 +243,4 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
* @return 结果
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
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,6 +19,4 @@ public interface InspectionFileRecordService extends IService<InspectionFileReco
|
||||
* @return 检测文档记录列表
|
||||
*/
|
||||
List<InspectionFileRecord> getRecordList(Long id);
|
||||
|
||||
long queryCount(String servicePackageId, String startTime, String endTime);
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@ -75,7 +74,6 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("appInspectionPartnerService")
|
||||
@ -141,10 +139,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
private InspectionSocket inspectionSocket;
|
||||
@Autowired
|
||||
private IInspectionWorkNodeService workNodeService;
|
||||
@Autowired
|
||||
private IInspectionFileService inspectionFileService;
|
||||
@Autowired
|
||||
private InspectionFileRecordService inspectionFileRecordService;
|
||||
|
||||
@Override
|
||||
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
||||
@ -1536,144 +1530,73 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
@Override
|
||||
public InspectionInfoVo inspectionDetail(Long inspectionInfoId) {
|
||||
InspectionInfo info = inspectionInfoService.getById(inspectionInfoId);
|
||||
if (info == null) return null;
|
||||
|
||||
OrderInfo order = orderService.getById(info.getInspectionOrderId());
|
||||
if (order == null) return null;
|
||||
|
||||
InspectionGoodsSku sku = skuService.getById(order.getSkuId());
|
||||
ShopInspectionGoods goods = goodsService.getById(order.getGoodsId());
|
||||
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());
|
||||
|
||||
AdminUserDO buyUser = userService.getUser(info.getUserId());
|
||||
AdminUserDO worker = userService.getUser(info.getWorkId());
|
||||
InspectionInfoVo res = new InspectionInfoVo();
|
||||
BeanUtils.copyProperties(order, res); // 建议手动复制必要字段
|
||||
|
||||
BeanUtils.copyProperties(order, res);
|
||||
res.setInspectionId(info.getId());
|
||||
res.setBuyUserName(buyUser != null ? buyUser.getNickname() : "");
|
||||
res.setBuyUserPhone(buyUser != null ? buyUser.getMobile() : "");
|
||||
|
||||
if (worker != null) {
|
||||
res.setWorkerAvatar(worker.getAvatar());
|
||||
res.setWorkerName(worker.getNickname());
|
||||
if (ObjectUtil.isNotNull(worker)) {
|
||||
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
|
||||
res.setWorkerName(Optional.ofNullable(worker.getNickname()).orElse(null));
|
||||
res.setWorkerPhone(worker.getMobile());
|
||||
}
|
||||
|
||||
res.setOtherName(info.getOtherName());
|
||||
res.setOtherPhone(info.getOtherPhone());
|
||||
res.setCustomerSource(info.getCustomerSource());
|
||||
res.setBusinessChannel(info.getBusinessChannel());
|
||||
|
||||
// 车系处理
|
||||
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());
|
||||
/*根据工单表中的leadManId查询对应的引车员*/
|
||||
if (ObjectUtil.isNotNull(info.getLeadManId())) {
|
||||
AdminUserDO leadMan = adminUserService.getById(info.getLeadManId());
|
||||
if (ObjectUtil.isNotNull(leadMan)) {
|
||||
res.setLeadManName(leadMan.getNickname());
|
||||
res.setLeadManId(info.getLeadManId());
|
||||
}
|
||||
} else {
|
||||
res.setLeadManName("");
|
||||
}
|
||||
|
||||
if (meetMan != null) {
|
||||
res.setMeetManName(meetMan.getNickname());
|
||||
res.setMeetManId(meetMan.getId());
|
||||
/*根据工单表中的meetManId查询对应的 MeetMan*/
|
||||
if (ObjectUtil.isNotNull(info.getMeetManId())) {
|
||||
AdminUserDO meetMan = adminUserService.getById(info.getMeetManId());
|
||||
if (ObjectUtil.isNotNull(meetMan)) {
|
||||
res.setMeetManName(meetMan.getNickname());
|
||||
res.setMeetManId(info.getMeetManId());
|
||||
}
|
||||
} else {
|
||||
res.setMeetManName("");
|
||||
}
|
||||
|
||||
// 设置订单相关字段
|
||||
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.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
||||
res.setBuyUserPhone(buyUser.getMobile());
|
||||
res.setCarNum(info.getCarNum());
|
||||
res.setCategoryId(info.getCategoryId());
|
||||
res.setCarType(category != null ? category.getCategoryName() : null);
|
||||
res.setStartTime(info.getStartTime());
|
||||
res.setEndTime(info.getEndTime());
|
||||
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.setReinspectCount(info.getReinspectCount());
|
||||
res.setIsRetrial(info.getIsRetrial());
|
||||
res.setIsPass(info.getIsPass());
|
||||
res.setRemark(info.getRemark());
|
||||
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);
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
res.setStepInfos(list);
|
||||
}
|
||||
|
||||
// 工作节点
|
||||
List<InspectionWorkNode> workNodes = inspectionWorkNodeService.getWeorkNodesById(inspectionInfoId.intValue());
|
||||
ShopInspectionCategory category = categoryService.getById(info.getCategoryId());
|
||||
res.setCarType(category.getCategoryName());
|
||||
// 查询节点表
|
||||
List<InspectionWorkNode> workNodes = inspectionWorkNodeService.getWeorkNodesById(Integer.parseInt(String.valueOf(inspectionInfoId)));
|
||||
res.setWorkNodes(workNodes);
|
||||
|
||||
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
|
||||
public List<InspectionInfo> workerInspectionList(Long workerId, String status, String searchValue) {
|
||||
return baseMapper.workerInspectionList(workerId, status, searchValue);
|
||||
@ -2026,8 +1949,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}
|
||||
startTime = startTime + " 00:00:00";
|
||||
endTime = endTime + " 23:59:59";
|
||||
// List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
|
||||
List<Map<String, Object>> res = baseMapper.selectBusinessStatistics( startTime, endTime);
|
||||
List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -2319,55 +2241,4 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
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,15 +28,4 @@ public class InspectionFileRecordServiceImpl extends ServiceImpl<InspectionFileR
|
||||
public List<InspectionFileRecord> getRecordList(Long 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>()
|
||||
.eq(DlInspectionProject::getId, workNode.getProjectId()));
|
||||
// 判断检测项目是否包含制证 并且是合格
|
||||
// 判断检测项目是否包含制证
|
||||
if (ObjectUtil.isNotEmpty(project)) {
|
||||
if (project.getProjectName().contains("制证") && "1".equals(inspectionWorkNode.getType())) {
|
||||
if (project.getProjectName().contains("制证")) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,15 +68,6 @@ public class InspectionInfoVo {
|
||||
private Date validationTime;
|
||||
// 核销人
|
||||
private String validationRealName;
|
||||
private String businessChannel; //业务渠道
|
||||
//客户来源
|
||||
private String customerSource;
|
||||
//车辆品牌型号
|
||||
private String carModel;
|
||||
//检测时长
|
||||
private String inspectionDuration;
|
||||
//车龄
|
||||
private Long carAge;
|
||||
//优惠金额
|
||||
private Long couponDiscount = 0L;
|
||||
//实付金额 分
|
||||
@ -110,6 +101,4 @@ public class InspectionInfoVo {
|
||||
private String meetManName;
|
||||
/** 是否接车*/
|
||||
private String isMeetCar;
|
||||
private String otherName;
|
||||
private String otherPhone;
|
||||
}
|
||||
|
||||
@ -41,12 +41,6 @@ public class OrderTable {
|
||||
/** 客户来源 */
|
||||
private String customerSource;
|
||||
|
||||
/** 业务渠道 */
|
||||
private String businessChannel;
|
||||
|
||||
/** 车辆型号 */
|
||||
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 ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||
//判断商家是否开启评论区
|
||||
// ShopMallPartners partners = partnerService.getById(partnerId);
|
||||
// if (StringUtils.isEmpty(partners.getOpenComment())||partners.getOpenComment().equals("0")){
|
||||
// return success(new ArrayList<>());
|
||||
// }
|
||||
ShopMallPartners partners = partnerService.getById(partnerId);
|
||||
if (StringUtils.isEmpty(partners.getOpenComment())||partners.getOpenComment().equals("0")){
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
Page<commentVo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,partnerId);
|
||||
return success(commentOrderList);
|
||||
|
||||
@ -15,5 +15,4 @@ public class commentVo extends TenantBaseDO {
|
||||
private String realName;
|
||||
private String goodsTitle;
|
||||
private String userImg="http://www.nuoyunr.com/lananRsc/xlg.png";
|
||||
private Long inspectionInfoId;
|
||||
}
|
||||
|
||||
@ -629,8 +629,6 @@ FROM
|
||||
t.createTime,
|
||||
t.customerSource,
|
||||
t.carModel,
|
||||
t.inspectionCount,
|
||||
t.businessChannel,
|
||||
CASE
|
||||
WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格'
|
||||
WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格'
|
||||
@ -646,9 +644,7 @@ FROM
|
||||
oi.pay_time AS payTime, -- 新增字段
|
||||
oi.create_time AS createTime,
|
||||
ii.customer_source AS customerSource,
|
||||
ii.business_channel AS businessChannel,
|
||||
ii.car_model AS carModel,
|
||||
IFNULL(ii.recheck_count, 0) + IFNULL(ii.reinspect_count, 0) + 1 AS inspectionCount,
|
||||
CASE
|
||||
WHEN oi.pay_type IS NULL THEN '未支付'
|
||||
ELSE '已支付'
|
||||
@ -705,16 +701,6 @@ FROM
|
||||
AND (TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) >= #{query.carYear}
|
||||
AND TIMESTAMPDIFF(YEAR, ii.car_register_date, CURDATE()) < #{query.carYear} + 1)
|
||||
</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>
|
||||
AND oi.deleted = '0'
|
||||
) t
|
||||
@ -815,54 +801,4 @@ FROM
|
||||
GROUP BY
|
||||
s.sku_name
|
||||
</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>
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
<?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,14 +10,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where record.file_id = #{id}
|
||||
and record.deleted = 0
|
||||
</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>
|
||||
|
||||
@ -231,11 +231,10 @@
|
||||
</select>
|
||||
<select id="getCommentOrderList" resultType = "cn.iocoder.yudao.module.payment.entity.commentVo">
|
||||
SELECT
|
||||
oi.real_name,oi.comment_desc ,oi.comment_star,oi.comment_time,oi.goods_title,info.id inspectionInfoId
|
||||
real_name,comment_desc ,comment_star,comment_time,goods_title
|
||||
FROM
|
||||
order_info oi
|
||||
LEFT JOIN inspection_info info ON oi.id = info.inspection_order_id
|
||||
where comment_star is not null
|
||||
order_info
|
||||
where partner_id = #{partnerId} and comment_star is not null
|
||||
ORDER BY comment_time desc
|
||||
</select>
|
||||
<select id="pageOrderListSystem" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
|
||||
|
||||
@ -457,45 +457,6 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
List<DlDriveSchoolStaffVO> list = studentMapper.selectStudentListCount();
|
||||
Map<String, Object> rtnMap = new HashMap<>();
|
||||
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分组
|
||||
Map<String, List<DlDriveSchoolStaffVO>> map = list.stream()
|
||||
.filter(item -> item.getCourseType() != null) // 过滤掉 courseType 为 null 的元素
|
||||
@ -526,5 +487,5 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
rtnMap.put("graduated", graduatedCount);
|
||||
rtnMap.put("notGraduated", notGraduatedCount);
|
||||
return rtnMap;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,4 @@ public class DlDriveSchoolStaffVO {
|
||||
private List<String> age;
|
||||
/**拿证天数*/
|
||||
private Integer passDays;
|
||||
/**毕业时间*/
|
||||
private Date gradTime;
|
||||
/**拿证时间*/
|
||||
private Date passTime;
|
||||
}
|
||||
|
||||
@ -476,9 +476,7 @@
|
||||
<select id="selectStudentListCount" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
||||
SELECT
|
||||
main.id AS id,
|
||||
dsco.course_type,
|
||||
dsco.grad_time,
|
||||
dsco.pass_time
|
||||
dsco.course_type
|
||||
FROM
|
||||
drive_school_student main
|
||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
||||
|
||||
@ -58,8 +58,6 @@
|
||||
<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.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 != '' ">
|
||||
<choose>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user