Commit 87ae9fa7 by 徐高华

企微托管

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