From af6dd48ed508df2ff33f62cd5c40db3f51f9d2a8 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期三, 20 三月 2024 11:38:13 +0800
Subject: [PATCH] 整理
---
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java | 65 ++++++++++++++++++++++++++------
1 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
index 4c5b975..827a7fc 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
@@ -1,5 +1,6 @@
package com.doumee.service.business.impl.hksync;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
@@ -111,7 +112,7 @@
if(!Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.signout)){
Visits update = new Visits();
//宸插け鏁�
- update.setStatus(Constants.VisitStatus.invalid);
+ update.setStatus(Constants.VisitStatus.signout);
update.setEditDate(date);
update.setId(c.getId());
update.setInDate(DateUtil.getISO8601DateByStr2(model.getVisitStartTime()));
@@ -204,8 +205,8 @@
List<DeviceRole> roleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda()
.eq(DeviceRole::getType, Constants.ONE));
//鏍囪鏄惁璧板厤鐧昏棰勭害
- String applyType =systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.MDJ_VISIT_REQUIRED).getCode();
- String applyLwType =systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.MDJ_LW_REQUIRED).getCode();
+// String applyType =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_VISIT_REQUIRED).getCode();
+// String applyLwType =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_LW_REQUIRED).getCode();
try {
//鏌ヨ鎵�鏈夐渶瑕佸悓姝ョ殑鏁版嵁
List<Visits> list = getVisitList();
@@ -217,8 +218,7 @@
Date date = new Date();
for(Visits c : list) {
//鍙戣捣娴峰悍棰勭害鎺ュ彛锛堥渶瑕佺櫥璁帮級锛屾牴鎹绾﹁繑鍥炴帴鍙e皝瑁呯敵璇疯褰曟洿鏂板瓧娈�
- String type = Constants.equalsInteger(c.getType(),Constants.ONE)?applyType:applyLwType;
- getUpdateModelByResponse(c,date,type,roleList,path);
+ getUpdateModelByResponse(c,date,roleList,path);
visitsMapper.updateById(c);
if(Objects.isNull(c.getParentId())){
wxPlatNotice.sendVisitAuditTemplateNotice(c,
@@ -267,13 +267,15 @@
* @param date
* @param type 0闇�瑕佺櫥璁� 1鍏嶇櫥璁�
*/
- private void getUpdateModelByResponse( Visits c,Date date,String type,List<DeviceRole> roleList,String path ) {
+ private void getUpdateModelByResponse( Visits c,Date date, List<DeviceRole> roleList,String path ) {
String code = null;
String id = null;
String qrcode = null;
+ String reson = "";
//鍙戣捣娴峰悍棰勭害鎺ュ彛
- if(StringUtils.equals(type,"0")){
+ if(Constants.equalsInteger(c.getVisitType(),Constants.ZERO)){
//锛堥渶瑕佺櫥璁帮級
+ c.setVisitType(Constants.ZERO);
VisitAppointmentRequest request = getHkRequestPara(c,roleList,path);
if(request == null){
//娴峰悍涓嬪彂鎴愬姛
@@ -291,8 +293,10 @@
id =response.getData().getAppointmentInfoList().get(0).getOrderId();
qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode();
}
+ reson = response!=null?JSONObject.toJSONString(response):"";
}else{
//鍏嶇櫥璁�
+ c.setVisitType(Constants.ONE);
VisitAppointmentMDJRequest request =getHkMDJRequestPara(c,roleList,path);
if(request == null){
//娴峰悍涓嬪彂鎴愬姛
@@ -308,17 +312,18 @@
id = response.getData().getOrderId();
qrcode =response.getData().getQRCode();
}
+ reson = response!=null?JSONObject.toJSONString(response):"";
}
if (code!= null && id!=null) {
//娴峰悍涓嬪彂鎴愬姛
c.setHkId( id);//棰勭害鏍囪瘑
c.setQrcode(qrcode);
- c.setRemark("涓嬪彂娴峰悍鎴愬姛锛併��"+type+"銆�");
+ c.setRemark("涓嬪彂娴峰悍鎴愬姛锛�");
c.setStatus(Constants.VisitStatus.xfSuccess);//涓嬪彂娴峰悍鎴愬姛
} else {
//娴峰悍涓嬪彂澶辫触
- c.setRemark("涓嬪彂娴峰悍澶辫触锛併��"+type+"銆�");
+ c.setRemark("涓嬪彂娴峰悍澶辫触,鍘熷洜锛�"+ reson);
c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
}
c.setHkStatus(Constants.ONE);
@@ -340,7 +345,15 @@
request.setVisitStartTime(DateUtil.getISO8601Timestamp2(c.getStarttime()));
request.setVisitEndTime(DateUtil.getISO8601Timestamp2(c.getEndtime()));
request.setReceptionistId(c.getReceptMemberHkId());//琚浜烘捣搴风紪鐮�
- request.setVisitPurpose(c.getReason());
+ if(StringUtils.isNotBlank(c.getReason())){
+ char[] charArray = c.getReason().toCharArray();
+ int length = charArray.length;
+ if(length>32){
+ request.setVisitPurpose(c.getReason().substring(0,32));
+ }else{
+ request.setVisitPurpose(c.getReason());
+ }
+ }
request.setVisitorInfo(info);
request.setVisitorPermissionSet(getVisitPermissonRequest(roleList,c));
return request;
@@ -378,7 +391,16 @@
request.setVisitStartTime(DateUtil.getISO8601Timestamp(c.getStarttime()));
request.setVisitEndTime(DateUtil.getISO8601Timestamp(c.getEndtime()));
request.setReceptionistId(c.getReceptMemberHkId());//琚浜烘捣搴风紪鐮�
- request.setVisitPurpose(c.getReason());
+
+ if(StringUtils.isNotBlank(c.getReason())){
+ char[] charArray = c.getReason().toCharArray();
+ int length = charArray.length;
+ if(length>32){
+ request.setVisitPurpose(c.getReason().substring(0,32));
+ }else{
+ request.setVisitPurpose(c.getReason());
+ }
+ }
//鑾峰彇鏉冮檺缁勯泦鍚�
request.setVisitorPermissionSet(getVisitPermissonRequest(roleList,c));
List<VisitAppointmentVistorRequest> infolist = new ArrayList<>();
@@ -401,8 +423,25 @@
if(info.getVisitorPhoto() == null){
return null;
}
- info.setVisitorName(c.getName());
- info.setVisitorWorkUnit(c.getCompanyName());
+ if(StringUtils.isNotBlank(c.getName())){
+ char[] charArray = c.getName().toCharArray();
+ int length = charArray.length;
+ if(length>32){
+ info.setVisitorName(c.getName().substring(0,32));
+ }else{
+ info.setVisitorName(c.getName());
+ }
+ }
+
+ if(StringUtils.isNotBlank(c.getCompanyName())){
+ char[] charArray = c.getCompanyName().toCharArray();
+ int length = charArray.length;
+ if(length>32){
+ info.setVisitorWorkUnit(c.getCompanyName().substring(0,32));
+ }else{
+ info.setVisitorWorkUnit(c.getCompanyName());
+ }
+ }
info.setPhoneNo(c.getPhone());
info.setPlateNo(c.getCarNos());
info.setGender(c.getSex()+"");
--
Gitblit v1.9.3