更新0721

This commit is contained in:
xyc 2025-07-21 15:42:08 +08:00
parent a73630b2b0
commit 7951168bb8
26 changed files with 550 additions and 106 deletions

View File

@ -385,7 +385,7 @@ public class InspectionInfoController extends BaseController {
* @date 16:22 2024/12/18
**/
@GetMapping("/getCountByType")
public CommonResult<?> getCountByType(@RequestParam("partnerId") Integer partnerId) {
public CommonResult<?> getCountByType(@RequestParam(required = false, name = "partnerId") Integer partnerId) {
return success(inspectionInfoService.getCountByType(partnerId));
}
@ -396,7 +396,7 @@ public class InspectionInfoController extends BaseController {
* @date 16:22 2024/12/18
**/
@GetMapping("/getBusinessCountByType")
public CommonResult<?> getBusinessCountByType(@RequestParam("partnerId") Integer partnerId) {
public CommonResult<?> getBusinessCountByType(@RequestParam(required = false, name ="partnerId") Integer partnerId) {
return success(inspectionInfoService.getBusinessCountByType(partnerId));
}

View File

@ -182,7 +182,7 @@ public class InspectionMallPartnersController extends BaseController {
Map<String, Object> stringObjectMap = orderInfoService.workOrderData(query);
rows.add(CollUtil.newArrayList("公示价格汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("goodsPriceSum").toString()) / 100d) + "", "实付金额汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("payMoneySum").toString()) / 100d) + ""));
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "公示价格", "实收金额", "付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果","出纳是否确认"));
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "公示价格", "实收金额", "付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果", "出纳是否确认"));
List<DictDataDO> sysDictData = dictDataService.getDictDataListByDictType("pay_type");
@ -216,12 +216,12 @@ public class InspectionMallPartnersController extends BaseController {
if (ObjectUtil.isNotEmpty(item.getCashierConfirm())) {
if (item.getCashierConfirm().equals("0")) {
cashier = "待审核";
}else {
} else {
cashier = "已审核";
}
}
rows.add(CollUtil.newArrayList(Optional.ofNullable(item.getCarNum()).orElse(""), Optional.ofNullable(item.getGoodsTitle()).orElse(""), Optional.ofNullable(item.getSkuName()).orElse(""), Optional.ofNullable(item.getBusinessChannel()).orElse(""), Optional.ofNullable(item.getCustomerSource()).orElse(""), Optional.ofNullable(item.getOtherName()).orElse(""), ObjectUtil.isEmpty(item.getGoodsPrice()) ? "" : BigDecimal.valueOf(item.getGoodsPrice())
rows.add(CollUtil.newArrayList(Optional.ofNullable(item.getCarNum()).orElse(item.getCertificateNum()), Optional.ofNullable(item.getGoodsTitle()).orElse(""), Optional.ofNullable(item.getSkuName()).orElse(""), Optional.ofNullable(item.getBusinessChannel()).orElse(""), Optional.ofNullable(item.getCustomerSource()).orElse(""), Optional.ofNullable(item.getOtherName()).orElse(""), ObjectUtil.isEmpty(item.getGoodsPrice()) ? "" : BigDecimal.valueOf(item.getGoodsPrice())
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
.toString(), ObjectUtil.isEmpty(item.getRealPayMoney()) ? "暂未支付" : BigDecimal.valueOf(item.getRealPayMoney())
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
@ -229,14 +229,102 @@ public class InspectionMallPartnersController extends BaseController {
Optional.ofNullable(item.getBuyPhone()).orElse(""), payTypeStr, ObjectUtil.isEmpty(item.getStartTime()) ? "" : DateUtil.format(item.getStartTime(), "yyyy-MM-dd hh:mm"), ObjectUtil.isEmpty(item.getEndTime()) ? "" : DateUtil.format(item.getEndTime(), "yyyy-MM-dd hh:mm"), isPassStr, cashier));
}
// 创建 ExcelWriter
ExcelWriter writer = ExcelUtil.getWriter();
// ====== 拼接标题 ======
StringBuilder titleBuilder = new StringBuilder("检测工单");
StringBuilder filterBuilder = new StringBuilder();
// 时间范围
if (query.getInspectionTime() != null && query.getInspectionTime().length == 2) {
filterBuilder.append("时间:")
.append(query.getInspectionTime()[0])
.append(" - ")
.append(query.getInspectionTime()[1])
.append("");
}
// 客户来源
if (StringUtils.isNotEmpty(query.getCustomerSource())) {
filterBuilder.append("客户来源:")
.append(query.getCustomerSource())
.append("");
}
// 业务渠道
if (StringUtils.isNotEmpty(query.getBusinessChannel())) {
filterBuilder.append("业务渠道:")
.append(query.getBusinessChannel())
.append("");
}
// 车龄
if (query.getCarYear() != null) {
filterBuilder.append("车龄:")
.append(query.getCarYear())
.append("年,");
}
// 检测类型
if (StringUtils.isNotEmpty(query.getSkuName())) {
filterBuilder.append("检测类型:")
.append(query.getSkuName())
.append("");
}
// 支付方式
if (StringUtils.isNotEmpty(query.getPayType())) {
filterBuilder.append("支付方式:")
.append(query.getPayType())
.append("");
}
// 支付状态
if (query.getPayStatus() != null) {
filterBuilder.append("支付状态:")
.append(query.getPayStatus() == 0 ? "未支付" : "已支付")
.append("");
}
// 车辆型号/车龄关键字
if (StringUtils.isNotEmpty(query.getCarModelOrCarYear())) {
filterBuilder.append("车牌号或合格证后六位:")
.append(query.getCarModelOrCarYear())
.append("");
}
// 车辆型号/车龄关键字
if (ObjectUtil.isNotEmpty(query.getCarYear())) {
filterBuilder.append("车龄:")
.append(query.getCarYear())
.append("");
}
// 去掉最后一个多余的逗号
if (filterBuilder.length() > 0 && filterBuilder.charAt(filterBuilder.length() - 1) == '') {
filterBuilder.deleteCharAt(filterBuilder.length() - 1);
}
// 如果有筛选条件就加括号
if (filterBuilder.length() > 0) {
titleBuilder.append("").append(filterBuilder).append("");
}
// ====== 合并单元格写标题 ======
writer.merge(14, titleBuilder.toString());
// ====== 设置标题行高 ======
writer.setRowHeight(0, 30);
//跳过当前行既第一行非必须在此演示用
//合并单元格后的标题行使用默认标题样式
//一次性写出内容强制输出标题
writer.write(rows, true);
ExcelExtraHelper.enhanceExcel(writer, rows,
CollUtil.newArrayList(8,11,12,15),
CollUtil.newArrayList(8, 11, 12, 15),
null);
//out为OutputStream需要写出到的目标流
//response为HttpServletResponse对象
@ -254,7 +342,7 @@ public class InspectionMallPartnersController extends BaseController {
@GetMapping("/workOrderData")
public CommonResult workOrderData(OrderTableQuery query, Integer pageSize, Integer pageNum) {
public CommonResult workOrderData(OrderTableQuery query, Integer pageSize, Integer pageNum) {
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
// Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
// List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);

View File

@ -477,17 +477,10 @@ public class PartnerOwnController extends BaseController {
//获取到店预约的数据
@GetMapping("/getAppointmentList")
public CommonResult getAppointmentList(Long partnerId, String phoneNum,
Integer pageSize, Integer pageNum,
String carNo, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) throws Exception {
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
// if (!partnersTmp.getUserId().equals(user.getId())){
// return null;
// }
public CommonResult getAppointmentList(AppointmentQuery query,
Integer pageSize, Integer pageNum) throws Exception {
Page<InspectionAppointment> page = new Page<>(pageNum, pageSize);
// ShopMallPartners shopMallPartners = partnerList.shopInfo();
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page, null, phoneNum, carNo, startTime, endTime);
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page, query);
return success(appointments);
}

View File

@ -0,0 +1,12 @@
package cn.iocoder.yudao.module.inspection.entity;
import lombok.Data;
@Data
public class AppointmentQuery {
String phoneNum;
String carNo;
String startTime;
String endTime;
Integer deleted;
}

View File

@ -34,6 +34,11 @@ public class InspectionBatchSettlementOrder extends TenantBaseDO implements Seri
*/
private Long payMoney;
/**
* 优惠金额
*/
private Long reduceMoney = 0L;
/**
* 订单id集合
*/

View File

@ -244,4 +244,18 @@ public class InspectionInfo extends TenantBaseDO
*/
@TableField(exist = false)
private String accountingConfirmRemark;
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(exist = false)
private Date insuranceExpiryDate;
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(exist = false)
private Date vehicleInsuranceExpiryDate;
/** 保险公司名称 */
@TableField(exist = false)
private String insuranceCompanyName;
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.inspection.mapper;
import cn.iocoder.yudao.module.inspection.entity.AppointmentQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -69,4 +70,5 @@ public interface InspectionAppointmentMapper extends BaseMapper<InspectionAppoin
List<InspectionAppointment> getAppointmentOwn(@Param("userId") Long userId);
IPage<InspectionAppointment> getAppointmentListNew(Page<InspectionAppointment> page, @Param("vo") AppointmentQuery query);
}

View File

@ -68,4 +68,10 @@ public class OrderTableQuery {
private String remark;
private String receivablesAccount;
/** 优惠金额 */
private Long reduceMoney;
/** 筛选类型 */
private String dateType;
}

View File

@ -126,6 +126,7 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
void makeCertOk(Long inspectionId);
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum, String carNo, String startTime, String endTime);
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, AppointmentQuery query);
IPage<OrderInfo> validationList(Page<OrderInfo> page, Long partnerId, String searchValue);

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.inspection.service;
import cn.iocoder.yudao.module.inspection.entity.AppointmentQuery;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -77,5 +78,6 @@ public interface IInspectionAppointmentService extends IService<InspectionAppoi
JSONObject computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception;
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum, String carNo, String startTime, String endTime);
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, AppointmentQuery query);
List<InspectionAppointment> getAppointmentOwn();
}

View File

@ -157,6 +157,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
private WxPayService wxPayService;
@Autowired
private CompanyService companyService;
@Autowired
private IShopUserCarService shopUserCarService;
@Override
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
@ -375,6 +377,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series", series);
return res;
}
@Override
public JSONObject chartInfoAmount(String startTime, String endTime) {
startTime = startTime + " 00:00:00";
@ -1756,6 +1759,12 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
// 车系处理
res.setCarModel(extractCarModel(info.getCarModel()));
// 根据车牌号查询车辆信息
ShopUserCar car = shopUserCarService.selectUserCarsByCarNo(info.getCarNum());
if (car != null) {
BeanUtils.copyProperties(car, res);
}
// 处理检测时长
if ("1".equals(info.getStatus())) {
long durationMs = calculateInspectionDuration(info);
@ -1952,6 +1961,16 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
return appointmentService.getAppointmentList(page, partnerId, phoneNum, carNo, startTime, endTime);
}
@Override
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, AppointmentQuery query) {
if (StrUtil.isNotEmpty(query.getStartTime()) && StrUtil.isNotEmpty(query.getEndTime())) {
query.setStartTime(query.getStartTime() + " 00:00:00");
query.setEndTime(query.getEndTime() + " 23:59:59");
}
return appointmentService.getAppointmentList(page, query);
}
@Override
public IPage<OrderInfo> validationList(Page<OrderInfo> page, Long partnerId, String searchValue) {
@ -2697,7 +2716,9 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
if (query.getType().equals("cn")) {
Long realPayMoney = query.getRealPayMoney();
Long reduceMoney = query.getReduceMoney();
long averageMoney = realPayMoney / query.getIds().size();
long averageReduceMoney = reduceMoney / query.getIds().size();
// 根据ids 修改工单结算
orderService.update(Wrappers.<OrderInfo>lambdaUpdate()
.in(OrderInfo::getId, orderIds)
@ -2706,6 +2727,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
.set(OrderInfo::getCashierConfirm, "1")
.set(OrderInfo::getReceivablesAccount, query.getReceivablesAccount())
.set(OrderInfo::getCashierConfirmUser, SecurityFrameworkUtils.getLoginUserId())
.set(ObjectUtil.isNotEmpty(query.getReduceMoney()), OrderInfo::getReduceMoney, averageReduceMoney)
.set(OrderInfo::getCashierConfirmTime, new Date())
.set(ObjectUtil.isNotEmpty(query.getRemark()), OrderInfo::getCashierConfirmRemark, query.getRemark()));
@ -2715,6 +2737,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
.map(String::valueOf) // Long 转为 String
.collect(Collectors.joining(",")));
inspectionBatchSettlementOrder.setPayMoney(realPayMoney);
inspectionBatchSettlementOrder.setReduceMoney(reduceMoney);
batchSettlementOrderService.save(inspectionBatchSettlementOrder);
} else {
// 会计审核

View File

@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.appBase.controller.admin.InspectionSocket;
import cn.iocoder.yudao.module.config.entity.ReminderMessage;
import cn.iocoder.yudao.module.config.service.RedisDelayedQueueService;
import cn.iocoder.yudao.module.constant.InspectionConstants;
import cn.iocoder.yudao.module.inspection.entity.*;
import cn.iocoder.yudao.module.shop.entity.ShopConfig;
import cn.iocoder.yudao.module.shop.service.IShopConfigService;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
@ -35,10 +36,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.DateUtils;
import cn.iocoder.yudao.util.StringUtils;
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
import cn.iocoder.yudao.module.inspection.entity.InspectionGoodsSku;
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionGoods;
import cn.iocoder.yudao.module.inspection.mapper.InspectionAppointmentMapper;
import cn.iocoder.yudao.module.inspection.service.*;
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
@ -510,6 +507,10 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum, String carNo, String startTime, String endTime) {
return baseMapper.getAppointmentList(page, partnerId, phoneNum, carNo, startTime, endTime);
}
@Override
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, AppointmentQuery query) {
return baseMapper.getAppointmentListNew(page, query);
}
@Override
public List<InspectionAppointment> getAppointmentOwn() {

View File

@ -167,7 +167,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
@Transactional(rollbackFor = Exception.class)
public int insertInspectionInfo(InspectionInfo inspectionInfo) throws Exception {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
// ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
if (ObjectUtils.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
throw new RuntimeException("请选择检测项目");
@ -176,7 +175,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
AdminUserDO workerUser = userService.getUser(loginUser.getId());
String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户";
String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "";
// AdminUserDO user = getAdminUserDO(buyPhone);
AdminUserDO user = userService.getUserByUsername(buyPhone, null, USER_TYPE_CUS);
if (ObjectUtils.isEmpty(user)) {
@ -198,6 +196,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
inspectionInfo.setUserId(user.getId());
}
InspectionGoodsSku sku = skuService.getById(inspectionInfo.getSkuId());
if (ObjectUtil.isEmpty(sku)) {
throw new RuntimeException("商品不存在");
}
ShopInspectionGoods goods = goodsService.getById(sku.getGoodsId());
// ShopMallPartners partner = appInspectionPartnerService.getById(goods.getPartnerId());
@ -312,11 +313,10 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
}
//增加客户信息
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PartnerCustomerInfo::getPartnerId, inspectionInfo.getPartnerId()).eq(PartnerCustomerInfo::getUserId, orderInfo.getUserId()).last("limit 1");
queryWrapper.eq(PartnerCustomerInfo::getUserId, orderInfo.getUserId()).last("limit 1");
PartnerCustomerInfo customerInfo = customerInfoService.getOne(queryWrapper);
if (ObjectUtil.isEmpty(customerInfo)) {
customerInfo = new PartnerCustomerInfo();
customerInfo.setPartnerId(inspectionInfo.getPartnerId());
customerInfo.setUserId(user.getId());
customerInfo.setCustomerPhone(user.getMobile());
customerInfo.setCustomerName(user.getNickname());
@ -615,6 +615,10 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
}
@Override
public IPage<InspectionInfo> pageWorkOrder(OrderTableQuery query, Page<InspectionInfo> page) {
if (StringUtils.isNotEmpty(query.getDatetimeRange())) {
query.getDatetimeRange()[0] = query.getDatetimeRange()[0] + " 00:00:00";
query.getDatetimeRange()[1] = query.getDatetimeRange()[1] + " 23:59:59";
}
return baseMapper.pageWorkOrderNew(query, page);
}
@ -773,6 +777,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
public Boolean judgeUpdateLeadMan(Long id) {
boolean result = true;
InspectionInfo inspectionInfo = baseMapper.selectById(id);
if (ObjectUtil.isEmpty(inspectionInfo)) {
throw new RuntimeException("工单不存在");
}
if (!inspectionInfo.getStatus().equals("2")) {
result = false;
}
@ -855,7 +862,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
try {
InspectionInfo inspectionInfo = new InspectionInfo();
inspectionInfo.setPartnerId(partnerId.longValue());
// inspectionInfo.setPartnerId(partnerId.longValue());
// 获取当前登录人
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
@ -1026,7 +1033,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
try {
InspectionInfo inspectionInfo = new InspectionInfo();
inspectionInfo.setPartnerId(partnerId.longValue());
// inspectionInfo.setPartnerId(partnerId.longValue());
// 获取当前登录人
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();

View File

@ -137,4 +137,24 @@ public class InspectionInfoVo {
* 会计确认备注
*/
private String accountingConfirmRemark;
/**
* 用户id
*/
private Long userId;
/** 下次年检日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date nextInspectionDate;
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date insuranceExpiryDate;
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date vehicleInsuranceExpiryDate;
/** 保险公司名称 */
private String insuranceCompanyName;
}

View File

@ -0,0 +1,41 @@
//package cn.iocoder.yudao.module.job.logger;
//
//import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
//import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
//import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
///**
// * 物理删除 N 天前的访问日志的 Job
// *
// * @author j-sentinel
// */
//@Component
//@Slf4j
//public class AccessLogCleanJob implements JobHandler {
//
// @Resource
// private ApiAccessLogService apiAccessLogService;
//
// /**
// * 清理超过14天的日志
// */
// private static final Integer JOB_CLEAN_RETAIN_DAY = 14;
//
// /**
// * 每次删除间隔的条数如果值太高可能会造成数据库的压力过大
// */
// private static final Integer DELETE_LIMIT = 100;
//
// @Override
// @TenantIgnore
// public String execute(String param) {
// Integer count = apiAccessLogService.cleanAccessLog(JOB_CLEAN_RETAIN_DAY, DELETE_LIMIT);
// log.info("[execute][定时执行清理访问日志数量 ({}) 个]", count);
// return String.format("定时执行清理访问日志数量 %s 个", count);
// }
//
//}

View File

@ -41,6 +41,7 @@ import java.time.ZoneId;
import java.util.*;
import static cn.iocoder.yudao.common.BaseConstants.SIGN_CREATE;
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS;
/**
* 客户信息Service业务层处理
@ -121,13 +122,10 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
*/
@Override
public int insertPartnerCustomerInfo(PartnerCustomerInfo partnerCustomerInfo) throws Exception {
// 获取当前商户信息
ShopMallPartners partners = partnerService.shopInfo();
// 检查客户是否已存在
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PartnerCustomerInfo::getPartnerId, partners.getPartnerId())
.eq(PartnerCustomerInfo::getCustomerPhone, partnerCustomerInfo.getCustomerPhone());
queryWrapper.eq(PartnerCustomerInfo::getCustomerPhone, partnerCustomerInfo.getCustomerPhone());
PartnerCustomerInfo customerInfo = this.getOne(queryWrapper);
if (ObjectUtils.isNotEmpty(customerInfo)) {
@ -145,6 +143,7 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
userSaveReqVO.setUsername(partnerCustomerInfo.getCustomerPhone());
userSaveReqVO.setNickname(partnerCustomerInfo.getCustomerName());
userSaveReqVO.setPassword("123456");
userSaveReqVO.setUserType(USER_TYPE_CUS);
Long uid = userService.createUser(userSaveReqVO);
user.setId(uid);
// Set<Long> ids = new HashSet<>();
@ -249,11 +248,10 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl<PartnerCustomerI
}
// 填充 partnerCustomerInfo
partnerCustomerInfo.setPartnerId(partners.getPartnerId());
partnerCustomerInfo.setUserId(user.getId());
// 插入 partner_customer_info
return baseMapper.insertPartnerCustomerInfo(partnerCustomerInfo);
return baseMapper.insert(partnerCustomerInfo);
}
/* Date转换为LocalDateTime */

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.core.controller.BaseController;
import cn.iocoder.yudao.module.shop.entity.InsuranceSaveVo;
import cn.iocoder.yudao.module.shop.entity.ShopUserCar;
import cn.iocoder.yudao.module.shop.service.IShopUserCarService;
import cn.iocoder.yudao.util.ExcelUtil;
@ -24,8 +25,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/admin-api/system/userCar")
public class ShopUserCarController extends BaseController
{
public class ShopUserCarController extends BaseController {
@Autowired
private IShopUserCarService shopUserCarService;
@ -36,33 +36,32 @@ public class ShopUserCarController extends BaseController
// @PreAuthorize("@ss.hasPermi('system:userCar:list')")
@GetMapping("/list")
public CommonResult list(ShopUserCar shopUserCar,
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
{
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
Page<ShopUserCar> page = new Page<>(pageNum, pageSize);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page,shopUserCar);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page, shopUserCar);
return success(list);
}
@GetMapping("/listOfPartner")
public CommonResult listOfPartner(ShopUserCar shopUserCar,
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
{
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
Page<ShopUserCar> page = new Page<>(pageNum, pageSize);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page,shopUserCar);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page, shopUserCar);
return success(list);
}
/**
* 导出用户车辆列表
*/
// @PreAuthorize("@ss.hasPermi('system:userCar:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, ShopUserCar shopUserCar,
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
{
Page<ShopUserCar> page = new Page<>(pageNum,pageSize);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page,shopUserCar);
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
Page<ShopUserCar> page = new Page<>(pageNum, pageSize);
IPage<ShopUserCar> list = shopUserCarService.selectShopUserCarList(page, shopUserCar);
ExcelUtil<ShopUserCar> util = new ExcelUtil<ShopUserCar>(ShopUserCar.class);
util.exportExcel(response, list.getRecords(), "用户车辆数据");
}
@ -72,8 +71,7 @@ public class ShopUserCarController extends BaseController
*/
// @PreAuthorize("@ss.hasPermi('system:userCar:query')")
@GetMapping(value = "/{carId}")
public CommonResult getInfo(@PathVariable("carId") Long carId)
{
public CommonResult getInfo(@PathVariable("carId") Long carId) {
return success(shopUserCarService.selectShopUserCarByCarId(carId));
}
@ -81,10 +79,8 @@ public class ShopUserCarController extends BaseController
* 新增用户车辆
*/
// @PreAuthorize("@ss.hasPermi('system:userCar:add')")
@PostMapping
public CommonResult add(@RequestBody ShopUserCar shopUserCar)
{
public CommonResult add(@RequestBody ShopUserCar shopUserCar) {
return toAjax(shopUserCarService.insertShopUserCar(shopUserCar));
}
@ -92,10 +88,8 @@ public class ShopUserCarController extends BaseController
* 修改用户车辆
*/
// @PreAuthorize("@ss.hasPermi('system:userCar:edit')")
@PutMapping
public CommonResult edit(@RequestBody ShopUserCar shopUserCar)
{
public CommonResult edit(@RequestBody ShopUserCar shopUserCar) {
return toAjax(shopUserCarService.updateShopUserCar(shopUserCar));
}
@ -104,46 +98,63 @@ public class ShopUserCarController extends BaseController
* 删除用户车辆
*/
// @PreAuthorize("@ss.hasPermi('system:userCar:remove')")
@DeleteMapping("/{carIds}")
public CommonResult remove(@PathVariable Long[] carIds)
{
@DeleteMapping("/{carIds}")
public CommonResult remove(@PathVariable Long[] carIds) {
return toAjax(shopUserCarService.deleteShopUserCarByCarIds(carIds));
}
@GetMapping(value = "/getUserCar")
@TenantIgnore
public CommonResult getUserCarByUserId()
{
public CommonResult getUserCarByUserId() {
return success(shopUserCarService.selectShopUserCarByUserId(getUserId()));
}
@PostMapping("/vehicleLicenseOCR")
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception
{
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception {
return success(shopUserCarService.vehicleLicenseOCR(imagePath));
}
@PostMapping("/appVehicleLicenseOCR")
public CommonResult appVehicleLicenseOCR(String imagePath) throws Exception
{
public CommonResult appVehicleLicenseOCR(String imagePath) throws Exception {
return success(shopUserCarService.appVehicleLicenseOCR(imagePath));
}
//20240327追加接口
//20240327追加接口
@PostMapping("/appVehicleLicenseOCR2")
public CommonResult appVehicleLicenseOCR2(String imagePath) throws Exception
{
public CommonResult appVehicleLicenseOCR2(String imagePath) throws Exception {
return success(shopUserCarService.appVehicleLicenseOCR2(imagePath));
}
@PostMapping("/infoCardOCR")
public CommonResult infoCardOCR(String imagePath) throws Exception
{
public CommonResult infoCardOCR(String imagePath) throws Exception {
shopUserCarService.infoCardOCR(imagePath);
return success();
}
@GetMapping("/getInfoCard")
public CommonResult getInfoCard()
{
return success( shopUserCarService.getInfoCard());
public CommonResult getInfoCard() {
return success(shopUserCarService.getInfoCard());
}
/**
* 保险信息完善
*
* @param insuranceSaveVo 保险信息
*/
@PostMapping("/completeInsuranceInformation")
public CommonResult<?> completeInsuranceInformation(@RequestBody InsuranceSaveVo insuranceSaveVo) {
shopUserCarService.completeInsuranceInformation(insuranceSaveVo);
return CommonResult.ok();
}
/**
* 根据车牌号查询车辆信息
*
* @param carNo 车牌号
* @return 车辆信息
*/
@GetMapping("/getUserCarByCarNo")
public CommonResult<?> getUserCarByCarNo(String carNo) {
return CommonResult.success(shopUserCarService.selectUserCarsByCarNo(carNo));
}
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.shop.entity;
import lombok.Data;
import java.util.Date;
@Data
public class InsuranceSaveVo {
/**
* 用户ID
*/
private Long userId;
/**
* 车牌号码
*/
private String carNo;
/**
* 保险公司名称
*/
private String insuranceCompanyName;
/**
* 交强险到期日期
*/
private Date insuranceExpiryDate;
/**
* 商业险到期日期
*/
private Date vehicleInsuranceExpiryDate;
/**
* 下次年检日期
*/
private Date nextInspectionDate;
}

View File

@ -55,6 +55,10 @@ public class ShopUserCar extends TenantBaseDO
@Excel(name = "年检日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionDate;
/** 保险公司名称 */
@Excel(name = "保险公司名称")
private String insuranceCompanyName;
/** 保险日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "保险日期", width = 30, dateFormat = "yyyy-MM-dd")
@ -76,9 +80,14 @@ public class ShopUserCar extends TenantBaseDO
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "险到期日期", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "交强险到期日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date insuranceExpiryDate;
/** 保险到期日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "商业险到期日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date vehicleInsuranceExpiryDate;
private String carBrand;
//车辆性质
private String carNature;

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.shop.service;
import java.util.List;
import cn.iocoder.yudao.module.shop.entity.InsuranceSaveVo;
import cn.iocoder.yudao.module.shop.entity.ShopUserCar;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -14,8 +16,7 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException;
* @author ruoyi
* @date 2023-07-10
*/
public interface IShopUserCarService extends IService<ShopUserCar>
{
public interface IShopUserCarService extends IService<ShopUserCar> {
/**
* 查询用户车辆
*
@ -65,16 +66,37 @@ public interface IShopUserCarService extends IService<ShopUserCar>
public int deleteShopUserCarByCarId(Long carId);
public ShopUserCar selectShopUserCarByUserId(Long userId);
ShopUserCar selectUserCarsByUserIdCarNum(Long userId,String carNum);
ShopUserCar selectUserCarsByUserIdCarNum(Long userId, String carNum);
List<ShopUserCar> selectUserCarsByUserId(Long userId);
List<ShopUserCar> getDbCars(Long userId);
String vehicleLicenseOCR(String imagePath) throws TencentCloudSDKException;
String appVehicleLicenseOCR(String imagePath) throws Exception;
JSONObject appVehicleLicenseOCR2(String imagePath) throws Exception;
void infoCardOCR( String imagePath) throws TencentCloudSDKException;
void infoCardOCR(String imagePath) throws TencentCloudSDKException;
JSONObject getInfoCard();
void deleteShopUserCarByUserId(Long userId);
public void completeInsuranceInformation(InsuranceSaveVo insuranceSaveVo);
/**
* 根据车牌号查询车辆信息
*
* @param carNo 车牌号
* @return
*/
ShopUserCar selectUserCarsByCarNo(String carNo);
/**
* 查询车辆到期提醒
*/
public void expirationReminder();
}

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.shop.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.shop.entity.InsuranceSaveVo;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
@ -11,6 +13,7 @@ import cn.iocoder.yudao.util.IDCardOCR;
import cn.iocoder.yudao.util.VehicleLicenseOCR;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.util.StringUtils;
@ -406,6 +409,50 @@ public class ShopUserCarServiceImpl extends ServiceImpl<ShopUserCarMapper,ShopUs
baseMapper.deleteShopUserCarByUserId(userId);
}
/**
* 完善保险时间
* @param insuranceSaveVo
*/
@Override
public void completeInsuranceInformation(InsuranceSaveVo insuranceSaveVo) {
// 根据车牌号查询车辆是否存在
ShopUserCar userCar = baseMapper.selectOne(Wrappers.<ShopUserCar>lambdaQuery()
.eq(ShopUserCar::getCarNo, insuranceSaveVo.getCarNo())
.last("limit 1"));
if (userCar == null) {
// 新建
userCar = new ShopUserCar();
BeanUtil.copyProperties(insuranceSaveVo, userCar);
baseMapper.insert(userCar);
} else {
//更新
BeanUtil.copyProperties(insuranceSaveVo, userCar);
baseMapper.updateById(userCar);
}
}
/**
* 根据车牌号查询车辆信息
*
* @param carNo 车牌号
* @return
*/
@Override
public ShopUserCar selectUserCarsByCarNo(String carNo) {
return getOne(Wrappers.<ShopUserCar>lambdaQuery()
.eq(ShopUserCar::getCarNo, carNo)
.last("limit 1"));
}
/**
* 查询车辆到期提醒
*/
@Override
public void expirationReminder() {
}
//处理年检日期保养日期
void dealCarDate(ShopUserCar shopUserCar){
//注册日期

View File

@ -256,17 +256,17 @@
AND iwn.create_time BETWEEN concat(#{datetimeRange[0]}, ' 00:00:00') AND concat(#{datetimeRange[1]}, ' 23:59:59')
</if>
LEFT JOIN inspection_project ip ON ip.id = iwn.project_id
-- LEFT JOIN (
-- SELECT DISTINCT sur.user_id
-- FROM system_user_role sur
-- JOIN system_role sr ON sur.role_id = sr.id
-- WHERE sr.service_package_id = 'jiance'
-- AND sr.CODE NOT IN ('jcyh', 'jcywjl')
-- ) valid_roles ON staff.user_id = valid_roles.user_id
LEFT JOIN (
SELECT DISTINCT sur.user_id
FROM system_user_role sur
JOIN system_role sr ON sur.role_id = sr.id
WHERE sr.service_package_id = 'jiance'
AND sr.CODE NOT IN ('jcyh', 'jcywjl')
) valid_roles ON staff.user_id = valid_roles.user_id
LEFT JOIN system_users su ON su.id = staff.user_id
<where>
staff.deleted = 0 AND su.deleted = 0
-- AND (valid_roles.user_id IS NOT NULL) -- 只保留有合格角色的用户
AND (valid_roles.user_id IS NOT NULL) -- 只保留有合格角色的用户
</where>
GROUP BY staff.user_id ,ip.id
@ -359,7 +359,7 @@
AND ii.customer_source = #{query.customerSource}
</if>
<if test="query.datetimeRange != null">
AND ii.create_time BETWEEN #{query.datetimeRange[0]} AND #{query.datetimeRange[1]}
AND ii.create_time BETWEEN CONCAT(#{query.datetimeRange[0]}, ' 00:00:00') AND CONCAT(#{query.datetimeRange[1]}, ' 23:59:59')
</if>
<if test="query.customSource != null">
AND ii.customer_source = #{query.customSource}

View File

@ -470,11 +470,11 @@ FROM
<!-- </select>-->
<select id="staticsTable1" resultType="java.util.Map">
SELECT ROUND(IFNULL(SUM(goods_price),0)/100) AS gsAmount,
-- ROUND(SUM(goods_price)/100) AS '应收款总和',
ROUND(IFNULL(SUM(CASE WHEN pay_money IS NOT NULL THEN pay_money ELSE goods_price END),0)/100) AS yskAmount,
ROUND(IFNULL(SUM(CASE
WHEN pay_type != 'sz' AND cashier_confirm = '1' THEN pay_money
ELSE 0 END),0)/100) AS yjsAmount,
ROUND(IFNULL(SUM(CASE WHEN pay_type = 'sz' OR cashier_confirm != '1' OR pay_money IS NULL THEN goods_price ELSE 0 END),0)/ 100) AS dsAmount
ROUND(IFNULL(SUM(CASE WHEN pay_type = 'sz' OR (cashier_confirm != '1' OR cashier_confirm IS NULL ) OR pay_money IS NULL THEN goods_price ELSE 0 END),0)/ 100) AS dsAmount
FROM order_info
WHERE deleted = 0
and create_time BETWEEN #{startTime} and #{endTime}
@ -580,8 +580,7 @@ FROM
FROM
order_info oi
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
WHERE oi.partner_id =#{partnerId}
and ii.create_time BETWEEN #{startTime} and #{endTime}
WHERE ii.create_time BETWEEN #{startTime} and #{endTime}
GROUP BY oi.goods_title
</select>
<select id="staticsTable5" resultType="java.util.Map">
@ -706,6 +705,7 @@ FROM
GROUP BY inspection_info_id
) iwn_agg
ON ii.id = iwn_agg.inspection_info_id
LEFT JOIN shop_user_car car on car.car_no = ii.car_num
<where>
<if test="query.payType!=null and query.payType!=''">
AND oi.pay_type = #{query.payType}
@ -745,8 +745,18 @@ FROM
AND ii.recheck_count != 0 AND ii.recheck_count IS NOT NULL
</if>
<if test="query.datetimeRange != null">
AND ii.create_time
BETWEEN CONCAT(#{query.datetimeRange[0]},' 00:00:00') AND CONCAT(#{query.datetimeRange[1]},' 23:59:59')
<if test="query.dateType != null and query.dateType.equals('jcTime')">
and ii.create_time BETWEEN CONCAT(#{query.datetimeRange[0]},' 00:00:00') AND CONCAT(#{query.datetimeRange[1]},' 23:59:59')
</if>
<if test="query.dateType != null and query.dateType.equals('bxTime')">
and car.insurance_expiry_date BETWEEN CONCAT(#{query.datetimeRange[0]},' 00:00:00') AND CONCAT(#{query.datetimeRange[1]},' 23:59:59')
</if>
<if test="query.dateType != null and query.dateType.equals('bxVehicleTime')">
and car.vehicle_insurance_expiry_date BETWEEN CONCAT(#{query.datetimeRange[0]},' 00:00:00') AND CONCAT(#{query.datetimeRange[1]},' 23:59:59')
</if>
<if test="query.dateType != null and query.dateType.equals('nextInspectionTime')">
and car.next_inspection_date BETWEEN CONCAT(#{query.datetimeRange[0]},' 00:00:00') AND CONCAT(#{query.datetimeRange[1]},' 23:59:59')
</if>
</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

View File

@ -179,4 +179,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where ip.deleted=0 and ip.user_id = #{userId}
order by ip.create_time desc
</select>
<select id="getAppointmentListNew"
resultType="cn.iocoder.yudao.module.inspection.entity.InspectionAppointment">
SELECT * FROM (
-- 部分1预约表
SELECT
ip.id AS id,
ip.appointment_day AS appointmentDay,
CONVERT(ip.goods_title USING utf8mb4) COLLATE utf8mb4_general_ci AS goodsTitle,
CONVERT(su.mobile USING utf8mb4) COLLATE utf8mb4_general_ci AS buyPhoneNum,
CONVERT(su.nickname USING utf8mb4) COLLATE utf8mb4_general_ci AS buyName,
CONVERT(suc.car_nature USING utf8mb4) COLLATE utf8mb4_general_ci AS car_nature,
CONVERT(suc.car_brand USING utf8mb4) COLLATE utf8mb4_general_ci AS car_brand,
CONVERT(suc.car_model USING utf8mb4) COLLATE utf8mb4_general_ci AS car_model,
CONVERT(suc.car_no USING utf8mb4) COLLATE utf8mb4_general_ci AS car_no,
CONVERT(igs.sku_name USING utf8mb4) COLLATE utf8mb4_general_ci AS sku_name,
CONVERT(ip.customer_source USING utf8mb4) COLLATE utf8mb4_general_ci AS customerSource,
ip.create_time AS createTime,
CONVERT('appointment' USING utf8mb4) COLLATE utf8mb4_general_ci AS sourceType
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>
<if test="vo.deleted == null ">
AND ip.deleted = 0 AND oi.validation_time IS NULL
</if>
<if test="vo.phoneNum!=null and vo.phoneNum!=''">
AND (su.mobile LIKE concat('%',#{vo.phoneNum},'%') OR ip.car_no LIKE concat('%',#{vo.phoneNum},'%'))
</if>
<if test="vo.carNo != null and vo.carNo != ''">
AND ip.car_no LIKE concat('%',#{vo.carNo},'%')
</if>
<if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
AND ip.appointment_day BETWEEN #{vo.startTime} AND #{vo.endTime}
</if>
</where>
UNION ALL
-- 部分2接车表
SELECT
imco.id AS id,
imco.appointment_day AS appointmentDay,
CONVERT(imco.goods_title USING utf8mb4) COLLATE utf8mb4_general_ci AS goodsTitle,
CONVERT(imco.buy_phone USING utf8mb4) COLLATE utf8mb4_general_ci AS buyPhoneNum,
CONVERT(imco.buy_name USING utf8mb4) COLLATE utf8mb4_general_ci AS buyName,
CONVERT(imco.car_nature USING utf8mb4) COLLATE utf8mb4_general_ci AS car_nature,
CONVERT(imco.car_model USING utf8mb4) COLLATE utf8mb4_general_ci AS car_brand,
CONVERT(imco.car_model USING utf8mb4) COLLATE utf8mb4_general_ci AS car_model,
CONVERT(imco.car_num USING utf8mb4) COLLATE utf8mb4_general_ci AS car_no,
CONVERT(imco.sku_name USING utf8mb4) COLLATE utf8mb4_general_ci AS sku_name,
CONVERT(imco.customer_source USING utf8mb4) COLLATE utf8mb4_general_ci AS customerSource,
imco.create_time AS createTime,
CONVERT('meetcar' USING utf8mb4) COLLATE utf8mb4_general_ci AS sourceType
FROM inspection_meet_car_order imco
<where>
<if test="vo.deleted == null ">
AND imco.deleted=0 AND (imco.is_meet = 0 OR (imco.is_pick_car = 0 AND imco.is_meet_pick_car = 0))
</if>
<if test="vo.phoneNum!=null and vo.phoneNum!=''">
AND (imco.buy_phone LIKE concat('%',#{vo.phoneNum},'%') OR imco.car_num LIKE concat('%',#{vo.phoneNum},'%'))
</if>
<if test="vo.carNo != null and vo.carNo != ''">
AND imco.car_num LIKE concat('%',#{vo.carNo},'%')
</if>
<if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != ''">
AND imco.appointment_day BETWEEN #{vo.startTime} AND #{vo.endTime}
</if>
</where>
) t
ORDER BY t.createTime DESC
</select>
</mapper>

View File

@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteInspectionInfoById" parameterType="Long">
delete from inspection_info where id = #{id}
UPDATE inspection_info SET deleted = 1 WHERE id = #{id}
</delete>
<delete id="deleteInspectionInfoByIds" parameterType="String">
@ -662,17 +662,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
FROM inspection_meet_car_order imco
JOIN inspection_business_channel ibc ON imco.customer_source_id = ibc.id
LEFT JOIN inspection_business_channel ibc ON imco.customer_source_id = ibc.id
LEFT JOIN system_users su
ON su.username COLLATE utf8mb4_general_ci = imco.other_phone COLLATE utf8mb4_general_ci
<if test="info.status != 1">
INNER JOIN inspection_info ii ON imco.inspection_info_id = ii.id AND ii.deleted = 0
LEFT JOIN inspection_info ii ON imco.inspection_info_id = ii.id AND ii.deleted = 0
LEFT JOIN order_info oi ON ii.inspection_order_id = oi.id AND oi.deleted = 0
</if>
WHERE imco.deleted = 0 AND ibc.deleted = 0
<if test="info.userId != null and info.userId != ''">
AND FIND_IN_SET(#{info.userId}, ibc.user_ids)
AND (FIND_IN_SET(#{info.userId}, ibc.user_ids) OR su.id = #{info.userId})
</if>
<if test="info.carNum != null and info.carNum != ''">
@ -704,14 +706,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select distinct ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as
realPayMoney
,oi.pay_type,oi.order_status as
orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,oi.cashier_confirm,oi.cashier_confirm_remark,oi.cashier_confirm_time ,oi.accounting_confirm,oi.accounting_confirm_remark
orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,oi.cashier_confirm,oi.cashier_confirm_remark,oi.cashier_confirm_time
,oi.accounting_confirm,oi.accounting_confirm_remark,
car.next_inspection_date,car.insurance_company_name,car.insurance_expiry_date,car.vehicle_insurance_expiry_date
from inspection_info ins
left join order_info oi on oi.id = ins.inspection_order_id
left join system_users su on su.id = ins.user_id
left join system_user_role sur on sur.user_id = su.id
where 1=1
LEFT JOIN shop_user_car car on car.car_no = ins.car_num
where 1=1 AND ins.deleted = 0
<if test="query.carModelOrCarYear!=null and query.carModelOrCarYear!=''">
and ins.car_num like concat('%',#{query.carModelOrCarYear},'%')
and (ins.car_num like concat('%',#{query.carModelOrCarYear},'%')
OR ins.certificate_num like concat('%',#{query.carModelOrCarYear},'%'))
</if>
<if test="query.skuName!=null and query.skuName!=''">
and oi.sku_name like concat('%',#{query.skuName},'%')
@ -733,7 +739,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ins.start_time between #{query.startTime} and #{query.endTime}
</if>
<if test="query.datetimeRange != null">
and ins.start_time between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
<if test="query.dateType != null and query.dateType.equals('jcTime')">
and ins.start_time between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
</if>
<if test="query.dateType != null and query.dateType.equals('bxTime')">
and car.insurance_expiry_date between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
</if>
<if test="query.dateType != null and query.dateType.equals('bxVehicleTime')">
and car.vehicle_insurance_expiry_date between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
</if>
<if test="query.dateType != null and query.dateType.equals('nextInspectionTime')">
and car.next_inspection_date between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
</if>
</if>
<if test="query.payStatus == 0">
and (oi.pay_money is null OR oi.pay_type = 'sz')
@ -748,15 +766,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by ins.start_time desc
</select>
<select id="workOrderDataNew" resultType="java.util.Map">
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
,ifnull(sum(oi.goods_price),0) goodsPriceSum
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
,IFNULL(SUM(CASE WHEN NOT (ins.status = '1' AND ins.is_pass = '0') THEN oi.goods_price ELSE 0 END), 0) goodsPriceSum
from inspection_info ins
left join order_info oi on oi.id = ins.inspection_order_id
left join system_users su on su.id = ins.user_id
left join system_user_role sur on sur.user_id = su.id
where 1=1
where 1=1 AND ins.deleted = 0
<if test="query.carModelOrCarYear!=null and query.carModelOrCarYear!=''">
and ins.car_num like concat('%',#{query.carModelOrCarYear},'%')
and (ins.car_num like concat('%',#{query.carModelOrCarYear},'%')
OR ins.certificate_num like concat('%',#{query.carModelOrCarYear},'%'))
</if>
<if test="query.skuName!=null and query.skuName!=''">
and oi.sku_name like concat('%',#{query.skuName},'%')

View File

@ -355,6 +355,7 @@ yudao:
- dl_base_notice
- base_user_car
- base_car_brand
- shop_user_car
ignore-caches:
- permission_menu_ids
- oauth_client