Commit 87ae9fa7 by 徐高华

企微托管

parent ac8fa7bb
...@@ -117,11 +117,21 @@ public class OpenStaffDTO implements Serializable { ...@@ -117,11 +117,21 @@ public class OpenStaffDTO implements Serializable {
*/ */
private String loginRemark ; private String loginRemark ;
private String qrcodeData ;
/** /**
* tab_haoban_open_staff * tab_haoban_open_staff
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getQrcodeData() {
return qrcodeData;
}
public void setQrcodeData(String qrcodeData) {
this.qrcodeData = qrcodeData;
}
public String getStaffName() { public String getStaffName() {
return staffName; return staffName;
} }
......
...@@ -16,7 +16,7 @@ public interface OpenStaffApiService { ...@@ -16,7 +16,7 @@ public interface OpenStaffApiService {
* @param qdto * @param qdto
* @return * @return
*/ */
public ServiceResponse<Long> init(OpenStaffInitQDTO qdto) ; public ServiceResponse<OpenStaffDTO> init(OpenStaffInitQDTO qdto) ;
/** /**
* id查询 * id查询
......
...@@ -10,6 +10,16 @@ public class QwOpenResultInitBO implements Serializable { ...@@ -10,6 +10,16 @@ public class QwOpenResultInitBO implements Serializable {
private String Key ; private String Key ;
private String qrcode_data ;
public String getQrcode_data() {
return qrcode_data;
}
public void setQrcode_data(String qrcode_data) {
this.qrcode_data = qrcode_data;
}
public String getUuid() { public String getUuid() {
return uuid; return uuid;
} }
......
...@@ -73,15 +73,18 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -73,15 +73,18 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
return ServiceResponse.failure("9999","登录错误") ; return ServiceResponse.failure("9999","登录错误") ;
} }
ServiceResponse<QwOpenResultInitBO> resp = OpenUtils.getQrcode(openStaff.getUuid(),null,2) ; ServiceResponse<QwOpenResultInitBO> resp = OpenUtils.getQrcode(openStaff.getUuid(),null,2) ;
String qrcodeData = null ;
if(resp.isSuccess()) { if(resp.isSuccess()) {
String qrcode= resp.getResult().getQrcode() ; String qrcode= resp.getResult().getQrcode() ;
String key = resp.getResult().getKey() ; String key = resp.getResult().getKey() ;
this.openStaffMapper.update2Qrcode(openStaff.getOpenStaffId(),qrcode,key); this.openStaffMapper.update2Qrcode(openStaff.getOpenStaffId(),qrcode,key);
openStaff.setQrCode2(qrcode); openStaff.setQrCode2(qrcode);
qrcodeData = resp.getResult().getQrcode_data() ;
}else { }else {
return ServiceResponse.failure("9999",resp.getMessage()) ; return ServiceResponse.failure("9999",resp.getMessage()) ;
} }
OpenStaffDTO dto = EntityUtil.changeEntityByJSON(OpenStaffDTO.class,openStaff) ; OpenStaffDTO dto = EntityUtil.changeEntityByJSON(OpenStaffDTO.class,openStaff) ;
dto.setQrcodeData(qrcodeData);
return ServiceResponse.success(dto); return ServiceResponse.success(dto);
} }
...@@ -164,7 +167,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -164,7 +167,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
} }
@Override @Override
public ServiceResponse<Long> init(OpenStaffInitQDTO qdto) { public ServiceResponse<OpenStaffDTO> init(OpenStaffInitQDTO qdto) {
String staffId = qdto.getStaffId(); String staffId = qdto.getStaffId();
if(StringUtils.isBlank(staffId)) { if(StringUtils.isBlank(staffId)) {
log.info("staffId is null"); log.info("staffId is null");
...@@ -202,7 +205,9 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -202,7 +205,9 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
openStaff.setQrCode2(null); openStaff.setQrCode2(null);
openStaff.setKey2(null); openStaff.setKey2(null);
openStaff = this.openStaffService.save(openStaff); openStaff = this.openStaffService.save(openStaff);
return ServiceResponse.success(openStaff.getOpenStaffId()) ; OpenStaffDTO dto = EntityUtil.changeEntityByJSON(OpenStaffDTO.class,openStaff) ;
dto.setQrcodeData(init.getQrcode_data()) ;
return ServiceResponse.success(dto) ;
}catch (Exception e) { }catch (Exception e) {
log.info("异常",e); log.info("异常",e);
} }
......
...@@ -91,6 +91,7 @@ public class OpenUtils { ...@@ -91,6 +91,7 @@ public class OpenUtils {
} }
initBO.setQrcode(backBO.getQrcode()); initBO.setQrcode(backBO.getQrcode());
initBO.setKey(backBO.getKey()); initBO.setKey(backBO.getKey());
initBO.setQrcode_data(backBO.getQrcode_data());
return ServiceResponse.success(initBO) ; return ServiceResponse.success(initBO) ;
} }
......
...@@ -165,12 +165,11 @@ public class QywxOpenController { ...@@ -165,12 +165,11 @@ public class QywxOpenController {
initQDTO.setEnterpriseId(enterpriseId); initQDTO.setEnterpriseId(enterpriseId);
initQDTO.setStaffId(staffId); initQDTO.setStaffId(staffId);
initQDTO.setLoginAgainFlag(loginAgainFlag); initQDTO.setLoginAgainFlag(loginAgainFlag);
ServiceResponse<Long> resp = this.openStaffApiService.init(initQDTO) ; ServiceResponse<OpenStaffDTO> resp = this.openStaffApiService.init(initQDTO) ;
if(!resp.isSuccess()) { if(!resp.isSuccess()) {
return RestResponse.failure("9999",resp.getMessage()) ; return RestResponse.failure("9999",resp.getMessage()) ;
} }
Long openStaffId = resp.getResult() ; OpenStaffDTO openStaffDTO = resp.getResult() ;
OpenStaffDTO openStaffDTO = this.openStaffApiService.getById(openStaffId).getResult() ;
openStaffDTO.setStaffHeadImg(staff.getHeadImg()); openStaffDTO.setStaffHeadImg(staff.getHeadImg());
openStaffDTO.setStaffName(staff.getStaffName()); openStaffDTO.setStaffName(staff.getStaffName());
return RestResponse.successResult(openStaffDTO); return RestResponse.successResult(openStaffDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment