|
@@ -26,12 +26,15 @@ import com.fhs.trans.service.impl.TransService;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.compress.utils.Lists;
|
|
import org.apache.commons.compress.utils.Lists;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
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.bizappointmentrecord.param.*;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.entity.BizAppointmentTime;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.entity.BizAppointmentTime;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
@@ -48,8 +51,13 @@ import vip.xiaonuo.biz.modular.goods.entity.BizGoods;
|
|
import vip.xiaonuo.biz.modular.goods.service.BizGoodsService;
|
|
import vip.xiaonuo.biz.modular.goods.service.BizGoodsService;
|
|
import vip.xiaonuo.biz.modular.goodsConf.entity.BizGoodsConf;
|
|
import vip.xiaonuo.biz.modular.goodsConf.entity.BizGoodsConf;
|
|
import vip.xiaonuo.biz.modular.goodsConf.service.BizGoodsConfService;
|
|
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.entity.BizRecord;
|
|
import vip.xiaonuo.biz.modular.record.service.BizRecordService;
|
|
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.biz.modular.utils.CommonExportUtil;
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
@@ -57,8 +65,10 @@ import vip.xiaonuo.common.page.CommonPageRequest;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.mapper.BizAppointmentRecordMapper;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.mapper.BizAppointmentRecordMapper;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecordService;
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecordService;
|
|
|
|
+import vip.xiaonuo.common.prop.CommonProperties;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -71,6 +81,7 @@ import java.util.regex.Pattern;
|
|
* @author fanzherong
|
|
* @author fanzherong
|
|
* @date 2025/03/24 14:47
|
|
* @date 2025/03/24 14:47
|
|
**/
|
|
**/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentRecordMapper, BizAppointmentRecord> implements BizAppointmentRecordService {
|
|
public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentRecordMapper, BizAppointmentRecord> implements BizAppointmentRecordService {
|
|
|
|
|
|
@@ -93,6 +104,14 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
private BizGoodsConfService bizGoodsConfService;
|
|
private BizGoodsConfService bizGoodsConfService;
|
|
@Resource
|
|
@Resource
|
|
private BizOrderConfigService bizOrderConfigService;
|
|
private BizOrderConfigService bizOrderConfigService;
|
|
|
|
+ @Resource
|
|
|
|
+ private BizUserService bizUserService;
|
|
|
|
+ @Resource
|
|
|
|
+ private OfficialInfoService officialInfoService;
|
|
|
|
+ @Resource
|
|
|
|
+ private CommonProperties commonProperties;
|
|
|
|
+ @Resource
|
|
|
|
+ private ApiService apiService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
@@ -172,6 +191,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()+1);
|
|
bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()+1);
|
|
bizOrderConfigService.updateById(bizAppointmentTime);
|
|
bizOrderConfigService.updateById(bizAppointmentTime);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getStatus(),"3")){
|
|
|
|
+ sendAccount(bizAppointmentRecord,null);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
@@ -390,6 +413,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
}
|
|
}
|
|
bizAppointmentRecord.setAppointmentReason(bizAppointmentRecordEditParam.getAppointmentReason());
|
|
bizAppointmentRecord.setAppointmentReason(bizAppointmentRecordEditParam.getAppointmentReason());
|
|
this.updateById(bizAppointmentRecord);
|
|
this.updateById(bizAppointmentRecord);
|
|
|
|
+
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getStatus(),"3")){
|
|
|
|
+ sendAccount(bizAppointmentRecord,null);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -609,4 +636,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})";
|
|
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);
|
|
return Pattern.matches(carNumberPattern, carNumber);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /** 发送微信公众号推送消息*/
|
|
|
|
+ public void sendAccount(BizAppointmentRecord bizAppointmentRecord,String accountSwitch){
|
|
|
|
+ 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()+"的关注公众号信息!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|