| | |
| | | hql.append(" and c.endTime < sysdate() "); |
| | | } |
| | | // System.out.println("vvvvv"+ClientUtils.getOrgId()+"333333333"+ClientUtils.getUserId()); |
| | | List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword_ + "%","40288a1261d106ba0161d1072e260000"); |
| | | List<Object> args = CollectionUtils.newList(ClientUtils.getOrgId(),keyword_ + "%",ClientUtils.getUserId()); |
| | | // System.out.println(args); |
| | | if (!StringUtils.isEmpty(teacherId)) { |
| | | hql.append(" and exists( select 1 from ClsClassReSubject r,Subject t where r.subjectId=t.subjectId and c.classId= r.classId and t.teacherId=? and r.deleteFlag is false and t.deleteFlag is false)"); |
| | |
| | | StuStudent stuStudent = findUnique(hql.toString(), args, StuStudent.class); |
| | | |
| | | if(stuStudent!=null && classId!=null){ |
| | | StringBuffer ClaHql=new StringBuffer("from ClsClass where classId=? and deleteFlag is false"); |
| | | |
| | | List<Object> claArgs = CollectionUtils.newList(classId); |
| | | |
| | | ClsClass cLaClass = findUnique(ClaHql.toString(), claArgs, ClsClass.class); |
| | | |
| | | cLaClass.setStudentCount(cLaClass.getStudentCount()+1); |
| | | |
| | | stuStudent.setClassId(classId); |
| | | |
| | | save(stuStudent); |
| | | }else { |
| | | return new Result(false,"班级不存在或学生不存在"); |
| | | } |
| | | } |
| | | |
| | | return new Result(true); |
| | | return new Result(true,"分班成功"); |
| | | |
| | | } |
| | | |
| | |
| | | * @since JDK1.6 |
| | | * @history 2010-07-28 夏德虎 新建 |
| | | */ |
| | | @Transactional(readOnly=false) |
| | | public class BaseDAO extends HibernateDaoSupport { |
| | | |
| | | /** 注释 rawtypes */ |
| | |
| | | */ |
| | | @ApiOperation(value = "删除创建的直播") |
| | | @PostMapping(value = "delete") |
| | | public Result delete(String videoLiveIds) { |
| | | return liveService.delete(videoLiveIds.split(",")); |
| | | public Result delete(String videoLiveIds,String courseIds) throws Exception { |
| | | return liveService.delete(videoLiveIds.split(","),courseIds.split(",")); |
| | | } |
| | | |
| | | |
| | |
| | | ResFile resFile = this.read(ResFile.class, fileId); |
| | | exerciseCompleteInfo.setFileId(fileId); |
| | | exerciseCompleteInfo.setFilePath(filePath); |
| | | exerciseCompleteInfo.setOrgiFileName(resFile.getFileName()); |
| | | exerciseCompleteInfo.setOrgiFileName(ClientUtils.getUserName()+"的作业"); |
| | | } |
| | | |
| | | exerciseCompleteInfo.setUploadDesc(content); |
| | |
| | | @Value("${wx.secret}") |
| | | private String secret; |
| | | |
| | | /** |
| | | * 公众号appID |
| | | */ |
| | | @Value("${wx.app.appId}") |
| | | private String wxappId; |
| | | |
| | | |
| | | /** |
| | | * 公众号secret |
| | | */ |
| | | @Value("${wx.app.secret}") |
| | | private String wxsecret; |
| | | |
| | | public static String UUNUMBER="QXYUUNUMBER"; |
| | | |
| | |
| | | * @throws IOException |
| | | */ |
| | | |
| | | @PostMapping("/wxAccountsLogin") |
| | | @ApiOperation("微信公众号登录") |
| | | @ResponseBody |
| | | public Result wxAccountsLogin(String code) { |
| | | JSONObject gettoken = wechatService.gettoken(wxappId, wxsecret); |
| | | JSONObject OpenId = wechatService.getSessionKeyOrOpenId(code); |
| | | JSONObject user = wechatService.getUser(gettoken.get("access_token").toString(), OpenId.get("openid").toString()); |
| | | return new Result(true,"成功",user); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/wxlogin") |
| | | @ApiOperation("微信登录") |
| | | @ApiOperation("微信小程序登录") |
| | | @ResponseBody |
| | | public Result wechatLogin(String code,String number) { |
| | | JSONObject sessionKeyOrOpenId = wechatService.getSessionKeyOrOpenId(code); |
| | |
| | | String studentSql = "from StuStudent where deleteFlag is false and userId = ? "; |
| | | List<Object> stuParams = CollectionUtils.newList(user.getUserId()); |
| | | StuStudent stuStudent = commonDAO.findUnique(studentSql, stuParams, StuStudent.class); |
| | | CacheParamters param = new CacheParamters(); |
| | | param.setUserId(user.getUserId()); |
| | | param.setCustomRoleValue(user.getEmail()); |
| | | param.setCustomOrgId(user.getImei()); |
| | | param.setCacheIpFlag(true); |
| | | // 缓存到请求线程 |
| | | UserInfoWrapper wrapper = cacheUserInfo(param, null); |
| | | // 存到redis |
| | | redisTemplate.opsForValue().set(UserInfoWrapper.SESSION_USER_INFO_KEY, wrapper); |
| | | return new Result(true,"授权成功",CollectionUtils.newObjectMap("user",user,"ClassId",stuStudent.getClassId())); |
| | | } |
| | | return phone; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "登入接口", notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "account", value = "账号", required = true, paramType="query", dataType = "String"), |
| | |
| | | */ |
| | | MediaVideoLive read(String liveId); |
| | | |
| | | MediaVideoLive revamp(int courseId); |
| | | |
| | | /** |
| | | * 查询直播 |
| | | * @param noticeId 直播Id |
| | |
| | | * @param liveId 直播ID数组 |
| | | * @return |
| | | */ |
| | | Result delete(String[] liveIds); |
| | | Result delete(String[] liveIds,String [] courseIds) throws Exception; |
| | | |
| | | /** |
| | | * 发布直播 |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result delete(String[] liveIds) { |
| | | public Result delete(String[] liveIds,String [] courseIds) throws Exception { |
| | | for(String liveId:liveIds) { |
| | | delete(liveId); |
| | | for(String courseId:courseIds) { |
| | | MTCloud client = new MTCloud(); |
| | | String s = client.courseDelete(courseId); |
| | | } |
| | | } |
| | | return Result.SUCCESS; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result doIssue(String liveId) { |
| | |
| | | return read(MediaVideoLive.class,liveId); |
| | | } |
| | | |
| | | @Override |
| | | public MediaVideoLive revamp(int courseId) { |
| | | String hql = "from MediaVideoLive where deleteFlag is false and courseId=?"; |
| | | MediaVideoLive unique = findUnique(hql, CollectionUtils.newList(courseId), MediaVideoLive.class); |
| | | return unique ; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public List<MediaVideoLive> readByStatus(List<String> liveIdLst,short[] status) { |
| | |
| | | Result getNumber(String tonken, String number); |
| | | |
| | | JSONObject gettoken(String appid,String secret); |
| | | |
| | | JSONObject getUser(String token,String openId); |
| | | // Result isBindWx(String userId); |
| | | |
| | | // Result getSignature(String url); |
| | |
| | | |
| | | return s; |
| | | } |
| | | @Override |
| | | public JSONObject getUser(String token, String openId) { |
| | | String requestUrl = "https://api.weixin.qq.com/sns/userinfo"; |
| | | |
| | | Map<String, String> requestUrlParam = new HashMap<>(); |
| | | |
| | | requestUrlParam.put("access_token", token); |
| | | |
| | | requestUrlParam.put("openid", openId); |
| | | |
| | | requestUrlParam.put("lang", "zh_CN"); |
| | | |
| | | JSONObject s = JSON.parseObject(HttpClientUtil.doGet(requestUrl, requestUrlParam)); |
| | | |
| | | return s; |
| | | } |
| | | // private String getWechatHeadImgUrl(String unionId) { |
| | | // WechatUserDO wxUser = this.template.findOne(Query.query(condition().and("unionId").is(unionId)), WechatUserDO.class); |
| | | // return wxUser.getHeadImgUrl(); |
| | |
| | | wx.appId=wx953bf2ed18e7836b |
| | | wx.secret=1d8b00beaddf5c8f36d1fedc14ef7973 |
| | | |
| | | |
| | | wx.app.appId=wx5a7c0d4798fbfdc2 |
| | | wx.app.secret=95c5470a52a2c4e037741f82246f4d86 |
| | | |
| | | logging.config=classpath:log4j2.xml |