From ab040585e6c8a6ebeb55bfec976b14c8fddbdfcb Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 10 六月 2025 11:00:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 317 insertions(+), 31 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
index 8a287bf..501af50 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncVisitServiceImpl.java
@@ -4,22 +4,21 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
-import com.doumee.core.constants.ResponseStatus;
-import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.param.BaseListPageResponse;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.request.*;
-import com.doumee.core.haikang.model.param.request.event.visit.EventVisitInfoRequest;
import com.doumee.core.haikang.model.param.respose.*;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DESUtil;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.ImageBase64Util;
+import com.doumee.core.wx.wxPlat.WxPlatConstants;
import com.doumee.core.wx.wxPlat.WxPlatNotice;
import com.doumee.dao.business.DeviceRoleMapper;
import com.doumee.dao.business.RetentionMapper;
+import com.doumee.dao.business.WxNoticeConfigMapper;
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.DeviceRole;
import com.doumee.dao.business.model.Member;
@@ -43,16 +42,21 @@
public class HkSyncVisitServiceImpl extends HkSyncBaseServiceImpl {
@Autowired
private VisitsJoinMapper visitsMapper;
+
+
+
+ @Autowired
+ private WxPlatNotice wxPlatNotice;
+ @Autowired
+ private WxNoticeConfigMapper wxNoticeConfigMapper;
@Autowired
private RetentionMapper retentionMapper;
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@Autowired
private DeviceRoleMapper deviceRoleMapper;
- @Autowired
- private WxPlatNotice wxPlatNotice;
/**
- * 鍚屾娴峰悍璁垮淇℃伅,鏍规嵁erp鍚屾缁勭粐缁撴灉锛屽畾鏃舵鏌ラ渶瑕佷笅鍙戝埌娴峰悍鐨勭粍缁囦俊鎭�
+ * 鍚屾娴峰悍璁垮淇℃伅鏄惁宸茬绂荤姸鎬�
*/
@Override
public void getOutTimeVisitRecord(){
@@ -73,14 +77,6 @@
AppointmentInfoResponse model = getVisitRecord(c.getHkId());
if(model == null){
continue;
- /* Visits update = new Visits();
- //宸插け鏁�
- update.setStatus(Constants.VisitStatus.invalid);
- update.setEditDate(date);
- update.setId(c.getId());
- update.setRemark("棰勭害宸茶娓呴櫎");
- visitsMapper.updateById(update);
- continue;*/
}
/**
* * 0锛氬緟瀹℃牳锛堥绾﹀緟瀹℃壒锛夈��
@@ -123,7 +119,7 @@
//鍏堝垹闄ゅ師鏈夌殑鍦ㄥ満浜哄憳(鏅�氳瀹級
retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
- .eq(Retention::getType,Constants.memberType.visitor)
+ .eq(Retention::getType,Constants.RetentionMemberType.fk)
.eq(Retention::getMemberId,c.getMemberId()));
}
}
@@ -141,7 +137,94 @@
visitsMapper.updateById(update);
//鍏堝垹闄ゅ師鏈夌殑鍦ㄥ満浜哄憳(鏅�氳瀹級
retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
- .eq(Retention::getType,Constants.memberType.visitor)
+ .eq(Retention::getType,Constants.RetentionMemberType.fk)
+ .eq(Retention::getMemberId,c.getMemberId()));
+ //鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
+ retentionMapper.insert(getRetentionModelByVisitRequest(c,update.getInDate()));
+ }
+ }
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }finally {
+ Constants.DEALING_HK_VISIT_EXPIRE =false;
+ }
+ }
+
+ /**
+ * 鏌ヨICCM璁垮鏁版嵁鐘舵��
+ */
+ @Override
+ public void getOutTimeVisitRecordIccm(){
+ if(Constants.DEALING_HK_VISIT_EXPIRE){
+ return ;
+ }
+ Constants.DEALING_HK_VISIT_EXPIRE =true;
+ try {
+ //鏌ヨ鎵�鏈夐渶瑕佸悓姝ョ殑鏁版嵁
+ List<Visits> list = getExpireVisitList();
+ //鎸夌収鐖剁骇鐢宠鍒嗘壒澶勭悊姣忔鐢宠鏁版嵁
+ if(list ==null || list.size()==0){
+ return;
+ }
+ Date date = new Date();
+ for(Visits c : list) {
+ //鍙戣捣娴峰悍棰勭害鎺ュ彛锛堥渶瑕佺櫥璁帮級锛屾牴鎹绾﹁繑鍥炴帴鍙e皝瑁呯敵璇疯褰曟洿鏂板瓧娈�
+ IccmAppointmentListResponse data = getVisitRecordIccm(c.getHkId());
+ if(data == null || data.getVisitorList() ==null || data.getVisitorList().size()==0){
+ continue;
+ }
+ /**
+ * 璁垮鐘舵��(0:鏈鍒�,1:宸茬鍒�,2:宸茬閫�,3:婊炵暀,4:鏈闂�,5:鑷姩绛剧,6:鏈閫�)
+ */
+ IccmAppointmentVisitorResponse model = data.getVisitorList().get(0);
+ if (model.getVisitorStatus()!=null && ",4,".contains( "," +model.getVisitorStatus()+"," )){
+ //瀵圭浉搴旂姸鎬佷笅鐨勬暟鎹繘琛屻�愬凡澶辨晥銆戝鐞�
+ Visits update = new Visits();
+ //宸插け鏁�
+ update.setStatus(Constants.VisitStatus.invalid);
+ update.setEditDate(date);
+ update.setId(c.getId());
+ update.setInDate(DateUtil.getISO8601DateByStr2(data.getVisitStartTime()));
+ update.setOutDate(DateUtil.getISO8601DateByStr2(data.getVisitEndTime()));
+ update.setRemark("瓒呮椂鏈櫥璁�");
+ visitsMapper.updateById(update);
+ }
+ if (model.getVisitorStatus()!=null && ",2,5,".contains( "," +model.getVisitorStatus()+"," )){
+ // 瀵圭浉搴旂姸鎬佷笅鐨勬暟鎹繘琛屻�愬凡绛剧銆戝鐞�
+ if(!Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.signout)){
+ Visits update = new Visits();
+ //宸茬绂�
+ update.setStatus(Constants.VisitStatus.signout);
+ update.setEditDate(date);
+ update.setId(c.getId());
+ update.setInDate(DateUtil.getISO8601DateByStr2(data.getVisitStartTime()));
+ update.setOutDate(DateUtil.getISO8601DateByStr2(data.getVisitEndTime()));
+ update.setOutInfo(model.getVisitorStatus().equals(5)?"杩囨湡鑷姩绛剧":"鏌ヨ宸茬绂�");
+ update.setRemark("宸茬绂�");
+ visitsMapper.updateById(update);
+
+ //鍏堝垹闄ゅ師鏈夌殑鍦ㄥ満浜哄憳(鏅�氳瀹級
+ retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
+ .eq(Retention::getType,Constants.RetentionMemberType.fk)
+ .eq(Retention::getMemberId,c.getMemberId()));
+ }
+ }
+ if (model.getVisitorStatus()!=null&& ",1,3,6,".contains( "," +model.getVisitorStatus()+"," )){
+ //濡傛灉宸茬櫥璁�
+ if(!Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.signin)){
+ Visits update = new Visits();
+ //宸插け鏁�
+ update.setStatus(Constants.VisitStatus.signin);
+ update.setEditDate(date);
+ update.setId(c.getId());
+ update.setInDate(DateUtil.getISO8601DateByStr2(data.getVisitStartTime()));
+ update.setOutDate(DateUtil.getISO8601DateByStr2(data.getVisitEndTime()));
+ update.setRemark("宸茬鍒�");
+ visitsMapper.updateById(update);
+ //鍏堝垹闄ゅ師鏈夌殑鍦ㄥ満浜哄憳(鏅�氳瀹級
+ retentionMapper.delete(new UpdateWrapper<Retention>().lambda()
+ .eq(Retention::getType,Constants.RetentionMemberType.fk)
.eq(Retention::getMemberId,c.getMemberId()));
//鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
retentionMapper.insert(getRetentionModelByVisitRequest(c,update.getInDate()));
@@ -195,36 +278,53 @@
}
return response.getData().getList().get(0);
}
+ public IccmAppointmentListResponse getVisitRecordIccm(String orderId){
+ //鍒嗛〉閬嶅巻寰幆鏌ヨ鎵�鏈夐棬绂佽澶囨暟鎹�
+ if(StringUtils.isBlank(orderId)){
+ return null;
+ }
+ IccmAppointmentListRequest param = new IccmAppointmentListRequest();
+ param.setPageNo(1);
+ param.setPageSize(1);
+ param.setOrderId(orderId);
+ BaseResponse<BaseListPageResponse<IccmAppointmentListResponse>> response = HKService.iccmAppointmentRecords(param);
+ if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) ){
+ return null;
+ }
+ if(response.getData() == null || response.getData().getList() == null|| response.getData().getList().size() ==0){
+ return null;
+ }
+ return response.getData().getList().get(0);
+ }
@Override
public void syncVisitData(){
if(Constants.DEALING_HK_VISIT){
return ;
}
Constants.DEALING_HK_VISIT =true;
- String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
+ String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode()
+systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode();
List<DeviceRole> roleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda()
.eq(DeviceRole::getType, Constants.ONE));
//鏍囪鏄惁璧板厤鐧昏棰勭害
-// 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();
- //鎸夌収鐖剁骇鐢宠鍒嗘壒澶勭悊姣忔鐢宠鏁版嵁
-// List<Visits> list = getParentList(alllist);
if(list ==null || list.size()==0){
return;
}
Date date = new Date();
for(Visits c : list) {
//鍙戣捣娴峰悍棰勭害鎺ュ彛锛堥渶瑕佺櫥璁帮級锛屾牴鎹绾﹁繑鍥炴帴鍙e皝瑁呯敵璇疯褰曟洿鏂板瓧娈�
- getUpdateModelByResponse(c,date,roleList,path);
+// getUpdateModelByResponse(c,date,roleList,path);
+ getUpdateModelByResponseIccm(c,date,roleList,path);
visitsMapper.updateById(c);
- if(Objects.isNull(c.getParentId())){
- wxPlatNotice.sendVisitAuditTemplateNotice(c,
- systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_PREFIX).getCode(),
- systemDictDataBiz.queryByCode(Constants.WX_PLATFORM,Constants.WX_PLATFORM_AUDIT_VISIT).getCode());
+ //缁欑敵璇蜂汉鍙戦�佸井淇″叕浼楀彿 涓嬪彂鏉冮檺澶辫触
+ if(StringUtils.isNotBlank(c.getOpenid()) && Constants.equalsInteger(c.getStatus(),Constants.VisitStatus.xfFail)){
+ wxPlatNotice.sendVisitTemplateNotice(systemDictDataBiz,
+ wxNoticeConfigMapper,c, WxPlatConstants.visitContent.visitApplyHkFail,
+ Arrays.asList(c.getOpenid().split(","))
+ );
}
}
}catch (Exception e){
@@ -266,11 +366,11 @@
* @param c
* @param date
* @param date
- * @param type 0闇�瑕佺櫥璁� 1鍏嶇櫥璁�
*/
private void getUpdateModelByResponse( Visits c,Date date, List<DeviceRole> roleList,String path ) {
String code = null;
String id = null;
+ String recordid = null;
String qrcode = null;
String reson = "";
//鍙戣捣娴峰悍棰勭害鎺ュ彛
@@ -292,7 +392,8 @@
&& response.getData().getAppointmentInfoList() !=null
&& response.getData().getAppointmentInfoList().size()>0)){
id =response.getData().getAppointmentInfoList().get(0).getOrderId();
- qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode();
+ qrcode =response.getData().getAppointmentInfoList().get(0).getVerificationCode();
+// qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode();
}
reson = response!=null?JSONObject.toJSONString(response):"";
}else{
@@ -311,18 +412,85 @@
code =response!=null ?response.getCode():null;
if(response!=null && response.getData()!=null){
id = response.getData().getOrderId();
+ recordid = response.getData().getAppointRecordId();
qrcode =response.getData().getQRCode();
}
reson = response!=null?JSONObject.toJSONString(response):"";
}
-
if (code!= null && id!=null) {
//娴峰悍涓嬪彂鎴愬姛
c.setHkId( id);//棰勭害鏍囪瘑
+ c.setHkRecordId(recordid);//璁垮棰勭害璁板綍鏍囪瘑锛堢敤鎴峰彇娑堥绾︼級
c.setQrcode(qrcode);
c.setRemark("涓嬪彂娴峰悍鎴愬姛锛�");
c.setStatus(Constants.VisitStatus.xfSuccess);//涓嬪彂娴峰悍鎴愬姛
} else {
+ //娴峰悍涓嬪彂澶辫触
+ c.setRemark("涓嬪彂娴峰悍澶辫触,鍘熷洜锛�"+ reson);
+ c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
+ }
+ c.setHkStatus(Constants.ONE);
+ c.setHkDate(date);
+ }
+ public static void getUpdateModelByResponseIccm( Visits c,Date date, List<DeviceRole> roleList,String path ) {
+ String code = null;
+ String id = null;
+ String recordId = null;
+ String qrcode = null;
+ String reson = "";
+ //鍙戣捣娴峰悍棰勭害鎺ュ彛
+ if(Constants.equalsInteger(c.getVisitType(),Constants.ZERO)){
+ //锛堥渶瑕佺櫥璁帮級
+ c.setVisitType(Constants.ZERO);
+ IccmAppointmentRequest request = getHkRequestParaIccm(c,roleList,path);
+ if(request == null){
+ //娴峰悍涓嬪彂鎴愬姛
+ c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
+ c.setRemark("涓嬪彂娴峰悍鍙傛暟涓嶆纭紒");
+ c.setHkStatus(Constants.ONE);
+ c.setHkDate(date);
+ return;
+ }
+ BaseResponse<IccmAppointmentResponse> response = HKService.iccmAppointment(request);
+ code =response!=null ?response.getCode():null;
+ if((response!=null && response.getData()!=null
+ && response.getData().getAppointmentInfoList() !=null
+ && response.getData().getAppointmentInfoList().size()>0)){
+ id =response.getData().getOrderId();
+ recordId = response.getData().getAppointRecordId();
+// qrcode =response.getData().getAppointmentInfoList().get(0).getQRCode();
+ qrcode =response.getData().getAppointmentInfoList().get(0).getVerificationCode();
+ }
+ reson = response!=null?JSONObject.toJSONString(response):"";
+ }else{
+ //鍏嶇櫥璁�
+ c.setVisitType(Constants.ONE);
+ IccmAppointmentMDJRequest request =getHkMDJRequestParamIccm(c,roleList,path);
+ if(request == null){
+ //娴峰悍涓嬪彂鎴愬姛
+ c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
+ c.setRemark("涓嬪彂娴峰悍鍏嶇櫥璁板弬鏁颁笉姝g‘锛�");
+ c.setHkStatus(Constants.ONE);
+ c.setHkDate(date);
+ return;
+ }
+ BaseResponse<IccmAppointmentMDJResponse> response = HKService.iccmAppiontmentMDJ(request );
+ code =response!=null ?response.getCode():null;
+ if(response!=null && response.getData()!=null){
+ id = response.getData().getOrderId();
+ recordId = response.getData().getAppointRecordId();
+ qrcode =response.getData().getQRCode();
+ }
+ reson = response!=null?JSONObject.toJSONString(response):"";
+ }
+ if (code!= null && id!=null) {
+ //娴峰悍涓嬪彂鎴愬姛
+ c.setHkId( id);//棰勭害鏍囪瘑
+ c.setHkRecordId(recordId);
+ c.setQrcode(qrcode);
+ c.setRemark("涓嬪彂娴峰悍鎴愬姛锛�");
+ c.setStatus(Constants.VisitStatus.xfSuccess);//涓嬪彂娴峰悍鎴愬姛
+ }else {
//娴峰悍涓嬪彂澶辫触
c.setRemark("涓嬪彂娴峰悍澶辫触,鍘熷洜锛�"+ reson);
c.setStatus(Constants.VisitStatus.xfFail);//涓嬪彂娴峰悍澶辫触
@@ -359,6 +527,29 @@
request.setVisitorPermissionSet(getVisitPermissonRequest(roleList,c));
return request;
}
+ public static IccmAppointmentMDJRequest getHkMDJRequestParamIccm(Visits c,List<DeviceRole> roleList,String path) {
+ IccmAppointmentMDJRequest request = new IccmAppointmentMDJRequest();
+ IccmAppointmentVistorRequest info =getRequestInfoByVisitIccm(c,path);
+ if(info == null ){
+ //浜鸿劯涓虹┖锛屼笉鑳借繘琛屾帹閫�
+ return null;
+ }
+ request.setVisitStartTime(DateUtil.getISO8601Timestamp2(c.getStarttime()));
+ request.setVisitEndTime(DateUtil.getISO8601Timestamp2(c.getEndtime()));
+ request.setReceptionistId(c.getReceptMemberHkId());//琚浜烘捣搴风紪鐮�
+ /* 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(getVisitPermissonRequestIccm(roleList,c));
+ return request;
+ }
/**
* 璁垮鏉冮檺缁�
@@ -368,6 +559,20 @@
*/
private VisitAppointmentPermissonRequest getVisitPermissonRequest(List<DeviceRole> roleList, Visits c) {
VisitAppointmentPermissonRequest p = new VisitAppointmentPermissonRequest();
+ //鑾峰彇鏉冮檺缁勯泦鍚�
+ String[] roles = getHkRoles(c.getDoors(),roleList);
+ if(roles==null || roles.length ==0){
+ //浣跨敤榛樿璁垮鏉冮檺缁�
+ p.setDefaultPrivilegeGroupFlag(Constants.ONE+"");
+ }else{
+ //鎸囧畾鏈夋晥娴峰悍璁垮鏉冮檺缁勬暟鎹�
+ p.setDefaultPrivilegeGroupFlag(Constants.ZERO+"");
+ p.setPrivilegeGroupIds(roles);
+ }
+ return p;
+ }
+ public static IccmPermissionSetRequest getVisitPermissonRequestIccm(List<DeviceRole> roleList, Visits c) {
+ IccmPermissionSetRequest p = new IccmPermissionSetRequest();
//鑾峰彇鏉冮檺缁勯泦鍚�
String[] roles = getHkRoles(c.getDoors(),roleList);
if(roles==null || roles.length ==0){
@@ -409,6 +614,34 @@
request.setVisitorInfoList(infolist);
return request;
}
+ public static IccmAppointmentRequest getHkRequestParaIccm(Visits c,List<DeviceRole> roleList,String path ) {
+ IccmAppointmentRequest request = new IccmAppointmentRequest();
+ //鐢宠浜轰俊鎭�
+ IccmAppointmentVistorRequest info =getRequestInfoByVisitIccm(c,path);
+ if(info == null ){
+ //浜鸿劯涓虹┖锛屼笉鑳借繘琛屾帹閫�
+ return null;
+ }
+ request.setVisitStartTime(DateUtil.getISO8601Timestamp2(c.getStarttime()));
+ request.setVisitEndTime(DateUtil.getISO8601Timestamp2(c.getEndtime()));
+ request.setReceptionistId(c.getReceptMemberHkId());//琚浜烘捣搴风紪鐮�
+
+ /* 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(getVisitPermissonRequestIccm(roleList,c));
+ List<IccmAppointmentVistorRequest> infolist = new ArrayList<>();
+ infolist.add(info);
+ request.setVisitorInfoList(infolist);
+ return request;
+ }
private VisitAppointmentVistorRequest getRequestInfoByVisit(Visits c,String path) {
VisitAppointmentVistorRequest info = new VisitAppointmentVistorRequest();
@@ -445,7 +678,10 @@
}
info.setPhoneNo(c.getPhone());
info.setPlateNo(c.getCarNos());
- info.setGender(c.getSex()+"");
+ info.setGender( "1" );
+ if(Constants.equalsInteger(c.getSex(),Constants.ONE) ||Constants.equalsInteger(c.getSex(),Constants.TWO) ){
+ info.setGender( c.getSex()+"");
+ }
if(Constants.equalsInteger(c.getIdcardType(),Constants.ZERO)){
info.setCertificateType(HKConstants.CertificateType.SHENFENZHENG.getKey()+"");
info.setCertificateNo(DESUtil.decrypt(Constants.EDS_PWD, c.getIdcardNo()));
@@ -456,8 +692,58 @@
return info;
}
+ public static IccmAppointmentVistorRequest getRequestInfoByVisitIccm(Visits c,String path) {
+ IccmAppointmentVistorRequest info = new IccmAppointmentVistorRequest();
+ //浜鸿劯鏁版嵁
+ if(StringUtils.isBlank(c.getName())
+ ||StringUtils.isBlank(c.getPhone())
+ || StringUtils.isBlank(c.getFaceImg()) ){
+ return null;
+ }
+ if(StringUtils.isNotBlank(c.getFaceImg())){
+ log.info("===================================="+path+c.getFaceImg()+"======start====");
+ info.setVisitorPhoto(ImageBase64Util.Image2Base64(path+c.getFaceImg()));
+ log.info("===================================="+path+c.getFaceImg()+"========end===");
+ }
+ if(info.getVisitorPhoto() == null){
+ log.info("===================================="+path+c.getFaceImg()+"======imgerror=====");
+ return null;
+ }
+ 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( "1");
+ if(Constants.equalsInteger(c.getSex(),Constants.ONE) ||Constants.equalsInteger(c.getSex(),Constants.TWO) ){
+ info.setGender( c.getSex()+"");
+ }
+ if(Constants.equalsInteger(c.getIdcardType(),Constants.ZERO)){
+ info.setCertificateType(HKConstants.CertificateType.SHENFENZHENG.getKey()+"");
+ info.setCertificateNo(DESUtil.decrypt(Constants.EDS_PWD, c.getIdcardNo()));
+ } else if(Constants.equalsInteger(c.getIdcardType(),Constants.TWO)){
+ info.setCertificateType(HKConstants.CertificateType.HUZHAO.getKey()+"");
+ info.setCertificateNo(DESUtil.decrypt(Constants.EDS_PWD, c.getIdcardNo()));
+ }
+ return info;
+ }
- private String[] getHkRoles(String doors, List<DeviceRole> roleList) {
+ public static String[] getHkRoles(String doors, List<DeviceRole> roleList) {
if(StringUtils.isBlank(doors) || roleList.size()==0|| roleList.size()==0){
return null;
}
--
Gitblit v1.9.3