|
@@ -15,20 +15,27 @@ package vip.xiaonuo.biz.modular.bizappointmentrecord.service.impl;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollStreamUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.PhoneUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fhs.trans.service.impl.TransService;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
+import vip.xiaonuo.biz.modular.api.param.WxUserMsgParam;
|
|
|
+import vip.xiaonuo.biz.modular.api.service.ApiService;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.param.*;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.entity.BizAppointmentTime;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
@@ -45,8 +52,13 @@ import vip.xiaonuo.biz.modular.goods.entity.BizGoods;
|
|
|
import vip.xiaonuo.biz.modular.goods.service.BizGoodsService;
|
|
|
import vip.xiaonuo.biz.modular.goodsConf.entity.BizGoodsConf;
|
|
|
import vip.xiaonuo.biz.modular.goodsConf.service.BizGoodsConfService;
|
|
|
+import vip.xiaonuo.biz.modular.oawxsendlog.entity.OaWxSendLog;
|
|
|
+import vip.xiaonuo.biz.modular.officialinfo.entity.OfficialInfo;
|
|
|
+import vip.xiaonuo.biz.modular.officialinfo.service.OfficialInfoService;
|
|
|
import vip.xiaonuo.biz.modular.record.entity.BizRecord;
|
|
|
import vip.xiaonuo.biz.modular.record.service.BizRecordService;
|
|
|
+import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
|
|
+import vip.xiaonuo.biz.modular.user.service.BizUserService;
|
|
|
import vip.xiaonuo.biz.modular.utils.CommonExportUtil;
|
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
@@ -54,10 +66,14 @@ import vip.xiaonuo.common.page.CommonPageRequest;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.mapper.BizAppointmentRecordMapper;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecordService;
|
|
|
+import vip.xiaonuo.common.prop.CommonProperties;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.concurrent.locks.ReentrantLock;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
@@ -66,9 +82,11 @@ import java.util.regex.Pattern;
|
|
|
* @author fanzherong
|
|
|
* @date 2025/03/24 14:47
|
|
|
**/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentRecordMapper, BizAppointmentRecord> implements BizAppointmentRecordService {
|
|
|
|
|
|
+ private final ReentrantLock lock = new ReentrantLock();
|
|
|
@Resource
|
|
|
private BizConfigService bizConfigService;
|
|
|
@Resource
|
|
@@ -87,6 +105,14 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
private BizGoodsConfService bizGoodsConfService;
|
|
|
@Resource
|
|
|
private BizOrderConfigService bizOrderConfigService;
|
|
|
+ @Resource
|
|
|
+ private BizUserService bizUserService;
|
|
|
+ @Resource
|
|
|
+ private OfficialInfoService officialInfoService;
|
|
|
+ @Resource
|
|
|
+ private CommonProperties commonProperties;
|
|
|
+ @Resource
|
|
|
+ private ApiService apiService;
|
|
|
|
|
|
@Override
|
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
@@ -103,7 +129,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
queryWrapper.like("bo.order_number",bizAppointmentRecordPageParam.getOrderNumber());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getCustomerName())){
|
|
|
- queryWrapper.like("bc.customer_name",bizAppointmentRecordPageParam.getCustomerName());
|
|
|
+ queryWrapper.like("bc.name",bizAppointmentRecordPageParam.getCustomerName());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getDriverName())){
|
|
|
queryWrapper.like("bar.driver_name",bizAppointmentRecordPageParam.getDriverName());
|
|
@@ -112,7 +138,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
queryWrapper.like("bar.driver_mobile",bizAppointmentRecordPageParam.getDriverMobile());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getGoodsName())){
|
|
|
- queryWrapper.like("bg.NAME",bizAppointmentRecordPageParam.getGoodsName());
|
|
|
+ queryWrapper.like("bg.GOODS_NAME",bizAppointmentRecordPageParam.getGoodsName());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getLicenseNumber())){
|
|
|
queryWrapper.like("bar.license_number",bizAppointmentRecordPageParam.getLicenseNumber());
|
|
@@ -151,7 +177,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
bizAppointmentRecord.setStatus("3");
|
|
|
}
|
|
|
}
|
|
|
- this.save(bizAppointmentRecord);
|
|
|
+ //this.save(bizAppointmentRecord);
|
|
|
+ saveRecord(bizAppointmentRecord);
|
|
|
|
|
|
BizOrder bizOrder = bizOrderService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
|
bizOrder.setOrderStatus("4");
|
|
@@ -165,20 +192,45 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()+1);
|
|
|
bizOrderConfigService.updateById(bizAppointmentTime);
|
|
|
}
|
|
|
+
|
|
|
+ /*if(StringUtils.equals(bizAppointmentRecord.getStatus(),"3")){
|
|
|
+ sendAccount(bizAppointmentRecord,null);
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+
|
|
|
+ public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
|
+ //排队中
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ //查询当天预约记录条数
|
|
|
+ String format = DateUtil.format(DateUtil.date(), "yyyy-MM-dd");
|
|
|
+ BizGoodsConf bizGoodsConf = bizGoodsConfService.getById(bizAppointmentRecord.getTimeId());
|
|
|
+ if(ObjectUtil.isNotNull(bizGoodsConf)){
|
|
|
+ format = DateUtil.format(bizGoodsConf.getConfStartTime(),"yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
+ between(BizAppointmentRecord::getCreateTime, format + " 00:00:00", format + " 23:59:59"));
|
|
|
+ bizAppointmentRecord.setQueueNumber((int) (count+1));
|
|
|
+ this.save(bizAppointmentRecord);
|
|
|
+ } finally {
|
|
|
+ lock.unlock(); // 释放锁
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public void checkParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam){
|
|
|
//校验车牌号
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getLicenseNumber())){
|
|
|
- if(!isCarNumber(bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim())){
|
|
|
- throw new CommonException("车牌号:{}格式错误",bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ bizAppointmentRecordAddParam.setLicenseNumber(bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ if(!isCarNumber(bizAppointmentRecordAddParam.getLicenseNumber())){
|
|
|
+ //throw new CommonException("车牌号:{}格式错误",bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
|
|
|
}
|
|
|
//校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核 、 14:已取消
|
|
|
long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
- eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim()).
|
|
|
- notIn(BizAppointmentRecord::getStatus, "11", "13", "14","15"));
|
|
|
+ eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordAddParam.getLicenseNumber()).
|
|
|
+ notIn(BizAppointmentRecord::getStatus, "10","11","12", "13", "14","15"));
|
|
|
if(count>0){
|
|
|
- throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordAddParam.getLicenseNumber());
|
|
|
}
|
|
|
}
|
|
|
//校验手机号
|
|
@@ -203,6 +255,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())){
|
|
|
+ bizAppointmentRecordAddParam.setTimeId(bizOrderService.queryEntity(bizAppointmentRecordAddParam.getOrderId()).getDeliveryTimeId());
|
|
|
//查询预约时间段内可预约次数
|
|
|
//BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecordAddParam.getTimeId());
|
|
|
BizOrderConfig bizOrderConfig = bizOrderConfigService.getOne(new QueryWrapper<BizOrderConfig>().lambda().
|
|
@@ -225,17 +278,18 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
public void checkParam(BizAppointmentRecordEditParam bizAppointmentRecordEditParam,BizAppointmentRecord bizAppointmentRecord){
|
|
|
//校验车牌号
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getLicenseNumber())){
|
|
|
- if(!StringUtils.equals(bizAppointmentRecord.getLicenseNumber(),bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim())){
|
|
|
+ bizAppointmentRecordEditParam.setLicenseNumber(bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ if(!StringUtils.equals(bizAppointmentRecord.getLicenseNumber(),bizAppointmentRecordEditParam.getLicenseNumber())){
|
|
|
//车牌号修改过
|
|
|
- if(!isCarNumber(bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim())){
|
|
|
- throw new CommonException("车牌号:{}格式错误",bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ if(!isCarNumber(bizAppointmentRecordEditParam.getLicenseNumber())){
|
|
|
+ //throw new CommonException("车牌号:{}格式错误",bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
|
|
|
}
|
|
|
//校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核 、 14:已取消
|
|
|
long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
- eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim()).
|
|
|
- notIn(BizAppointmentRecord::getStatus, "11", "13", "14","15"));
|
|
|
+ eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordEditParam.getLicenseNumber()).
|
|
|
+ notIn(BizAppointmentRecord::getStatus, "10","11", "12", "13", "14","15"));
|
|
|
if(count>0){
|
|
|
- throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
|
|
|
+ throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordEditParam.getLicenseNumber());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -261,6 +315,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())){
|
|
|
+ bizAppointmentRecordEditParam.setTimeId(bizOrderService.queryEntity(bizAppointmentRecordEditParam.getOrderId()).getDeliveryTimeId());
|
|
|
//查询预约时间段内可预约次数
|
|
|
//BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecordAddParam.getTimeId());
|
|
|
BizOrderConfig bizOrderConfig = bizOrderConfigService.getOne(new QueryWrapper<BizOrderConfig>().lambda().
|
|
@@ -272,7 +327,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
eq(BizAppointmentRecord::getTimeId, bizAppointmentRecordEditParam.getTimeId()).
|
|
|
notIn(BizAppointmentRecord::getStatus, "10", "11", "12", "13", "14","15"));
|
|
|
- if(count>=bizOrderConfig.getApplyNumber()){
|
|
|
+ if(count>=bizOrderConfig.getApplyNumber()+1){
|
|
|
throw new CommonException("该订单已经预约满!");
|
|
|
}
|
|
|
}
|
|
@@ -284,6 +339,9 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
@Override
|
|
|
public void edit(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
|
+ if(ObjectUtil.isEmpty(bizAppointmentRecordEditParam.getStatus())){
|
|
|
+ bizAppointmentRecordEditParam.setStatus(bizAppointmentRecord.getStatus());
|
|
|
+ }
|
|
|
checkParam(bizAppointmentRecordEditParam,bizAppointmentRecord);
|
|
|
if(!StringUtils.equals(bizAppointmentRecord.getOrderId(),bizAppointmentRecordEditParam.getOrderId())){
|
|
|
//调整了预约时段,释放之前预约时段的预约次数
|
|
@@ -353,14 +411,26 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
@Override
|
|
|
public void auditRecord(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
|
+ UpdateWrapper<BizAppointmentRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id",bizAppointmentRecord.getId());
|
|
|
+ String status = null;
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getAuditFlag())){
|
|
|
if(StringUtils.equals(bizAppointmentRecordEditParam.getAuditFlag(),"true")){
|
|
|
- bizAppointmentRecord.setStatus("2");
|
|
|
+ //bizAppointmentRecord.setStatus("2");
|
|
|
+ status = "2";
|
|
|
}else{
|
|
|
- bizAppointmentRecord.setStatus("3");
|
|
|
+ //bizAppointmentRecord.setStatus("3");
|
|
|
+ status = "3";
|
|
|
}
|
|
|
- bizAppointmentRecord.setAppointmentReason(bizAppointmentRecordEditParam.getAppointmentReason());
|
|
|
- this.updateById(bizAppointmentRecord);
|
|
|
+ //bizAppointmentRecord.setAppointmentReason(bizAppointmentRecordEditParam.getAppointmentReason());
|
|
|
+ updateWrapper.set("status",status);
|
|
|
+ updateWrapper.set("appointment_reason",bizAppointmentRecordEditParam.getAppointmentReason());
|
|
|
+ //this.updateById(bizAppointmentRecord);
|
|
|
+ this.update(updateWrapper);
|
|
|
+
|
|
|
+ /*if(StringUtils.equals(status,"3")){
|
|
|
+ sendAccount(bizAppointmentRecord,null);
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -375,7 +445,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
BizAppointmentExportResult bizAppointmentExportResult = new BizAppointmentExportResult();
|
|
|
BeanUtil.copyProperties(bizAppointmentRecord, bizAppointmentExportResult);
|
|
|
bizAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
|
|
|
- bizAppointmentExportResult.setTimeInfo(bizAppointmentRecord.getBeginTime()+"~"+bizAppointmentRecord.getEndTime());
|
|
|
+ bizAppointmentExportResult.setAxleNumber(bizAppointmentRecord.getAxleNumber()+"轴");
|
|
|
list.add(bizAppointmentExportResult);
|
|
|
}
|
|
|
CommonExportUtil.export(fileName, BizAppointmentExportResult.class,list,response,"预约报表");
|
|
@@ -451,12 +521,12 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
BizOrder bizOrder = bizOrderService.getById(bizAppointmentRecordEditParam.getOrderId());
|
|
|
if(ObjectUtil.isNotNull(bizOrder)){
|
|
|
if(!StringUtils.equals(bizOrder.getOrderStatus(),"3") && !StringUtils.equals(bizOrder.getOrderStatus(),"4")){
|
|
|
- throw new CommonException("当前订单不可预约!");
|
|
|
+ throw new CommonException("当前订单不可调度!");
|
|
|
}
|
|
|
BizGoodsConf bizGoodsConf = bizGoodsConfService.getById(bizOrder.getDeliveryTimeId());
|
|
|
if(ObjectUtil.isNotNull(bizGoodsConf)){
|
|
|
if(new Date().getTime() > bizGoodsConf.getConfEndTime().getTime()){
|
|
|
- throw new CommonException("提货时间段已过,不可预约!");
|
|
|
+ throw new CommonException("提货时间段已过,不可调度!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -525,6 +595,24 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> gerVehicleTotal(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
|
+ String beginTime = null;
|
|
|
+ String endTime = null;
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getBeginTime())){
|
|
|
+ beginTime = bizAppointmentRecordPageParam.getBeginTime()+" 00:00:00";
|
|
|
+ }else{
|
|
|
+ //beginTime = DateUtil.format(DateUtil.date(),"yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getEndTime())){
|
|
|
+ endTime = bizAppointmentRecordPageParam.getEndTime()+" 23:59:59";
|
|
|
+ }else{
|
|
|
+ //endTime = DateUtil.format(DateUtil.date(),"yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = this.getBaseMapper().gerVehicleTotal(beginTime, endTime);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
public BizAppointmentRecord setBizAppointmentRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
|
bizAppointmentRecord.setIsFlag("1");
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecord.getOrderId())){
|
|
@@ -540,6 +628,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ log.info("地磅端对接:overId:"+bizAppointmentRecord.getOverId());
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecord.getOverId())){
|
|
|
BizExcessConfig excessConfig = bizExcessConfigService.getById(bizAppointmentRecord.getOverId());
|
|
|
if(ObjectUtil.isNotNull(excessConfig)){
|
|
@@ -562,4 +651,41 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
String carNumberPattern = "([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}(([A-HJ-Z]{1}[A-HJ-NP-Z0-9]{5})|([A-HJ-Z]{1}(([DF]{1}[A-HJ-NP-Z0-9]{1}[0-9]{4})|([0-9]{5}[DF]{1})))|([A-HJ-Z]{1}[A-D0-9]{1}[0-9]{3}警)))|([0-9]{6}使)|((([沪粤川云桂鄂陕蒙藏黑辽渝]{1}A)|鲁B|闽D|蒙E|蒙H)[0-9]{4}领)|(WJ[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼·•]{1}[0-9]{4}[TDSHBXJ0-9]{1})|([VKHBSLJNGCE]{1}[A-DJ-PR-TVY]{1}[0-9]{5})";
|
|
|
return Pattern.matches(carNumberPattern, carNumber);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /** 发送微信公众号推送消息*/
|
|
|
+ public void sendAccount(BizAppointmentRecord bizAppointmentRecord){
|
|
|
+ BizUser bizUser = bizUserService.queryEntity(bizAppointmentRecord.getCreateUser());
|
|
|
+ if(ObjectUtil.isNotEmpty(bizUser.getUnionId())){
|
|
|
+ log.info("当前用户:"+bizUser.getName()+"存在unionId");
|
|
|
+ //根据unionId查询微信公众号openId
|
|
|
+ OfficialInfo officialInfo = officialInfoService.getOne(new QueryWrapper<OfficialInfo>().lambda().
|
|
|
+ eq(OfficialInfo::getUnionId, bizUser.getUnionId()).
|
|
|
+ eq(OfficialInfo::getStatus, "1").last("limit 1"));
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotNull(officialInfo)){
|
|
|
+ log.info("当前用户:"+bizUser.getName()+"存在openId");
|
|
|
+ OaWxSendLog oaWxSendLog = new OaWxSendLog();
|
|
|
+ oaWxSendLog.setSendUserId(bizUser.getId());
|
|
|
+ oaWxSendLog.setSendUserName(bizUser.getName());
|
|
|
+ WxUserMsgParam wxUserMsgParam = new WxUserMsgParam();
|
|
|
+ wxUserMsgParam.setTemplateId(commonProperties.getOfficialTemplete());
|
|
|
+ wxUserMsgParam.setOpenId(officialInfo.getOfficialOpenId());
|
|
|
+ wxUserMsgParam.setParam1("car_number9");
|
|
|
+ wxUserMsgParam.setParamData1(bizAppointmentRecord.getLicenseNumber());
|
|
|
+ wxUserMsgParam.setParam2("time6");
|
|
|
+ String time = null;
|
|
|
+ BizGoodsConf bizGoodsConf = bizGoodsConfService.getById(bizAppointmentRecord.getTimeId());
|
|
|
+ if(ObjectUtil.isNotNull(bizGoodsConf)){
|
|
|
+ time = DateUtil.format(bizGoodsConf.getConfStartTime(),"yyyy-MM-dd HH:mm:ss")+"~"+DateUtil.format(bizGoodsConf.getConfEndTime(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ }
|
|
|
+ wxUserMsgParam.setParamData2(time);
|
|
|
+ wxUserMsgParam.setParam3("thing2");
|
|
|
+ wxUserMsgParam.setParamData3(bizAppointmentRecord.getQueueNumber().toString());
|
|
|
+ apiService.sendProjectExpireMsg(oaWxSendLog,wxUserMsgParam);
|
|
|
+ }else{
|
|
|
+ log.info("为查询到用户"+bizUser.getName()+"的关注公众号信息!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|