Browse Source

Merge branch 'master' of gitee.com:ccsens_s/ccsenscloud

master
zhangye 6 years ago
parent
commit
ffe0c356e8
  1. 8
      game/src/main/resources/mapper_dao/GameUserJoinDao.xml
  2. 7
      ht/src/main/java/com/ccsens/ht/api/PatientController.java
  3. 4
      ht/src/main/java/com/ccsens/ht/service/IPatientService.java
  4. 5
      ht/src/main/java/com/ccsens/ht/service/PatientService.java
  5. 8
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

8
game/src/main/resources/mapper_dao/GameUserJoinDao.xml

@ -18,7 +18,7 @@
<select id="selectTopTen" resultType="com.ccsens.game.bean.vo.ScreenVo$TopUsers">
select user_id, avatar_url as headImgUrl, nickname, score, score/100 as times
from t_game_user_join
where record_id = #{recordId,jdbcType=BIGINT}
where record_id = #{recordId,jdbcType=BIGINT} and rec_status = 0
ORDER BY score DESC
limit 10
</select>
@ -33,7 +33,7 @@
FROM
t_game_user_join
WHERE
record_id = #{recordId}
record_id = #{recordId} and rec_status = 0
</select>
<select id="getRanking" resultType="int">
@ -49,11 +49,11 @@ WHERE c.user_id= #{userId,jdbcType=BIGINT} limit 1
</select>
<select id="gameCount" resultType="com.ccsens.game.bean.dto.message.ChangeStatusMessageDto$CompletedData">
select count(*) as totalMembers, sum(score) as totalScore, AVG(score) as averageTimes from t_game_user_join where record_id = #{recordId,jdbcType=BIGINT}
select count(*) as totalMembers, sum(score) as totalScore, AVG(score) as averageTimes from t_game_user_join where record_id = #{recordId,jdbcType=BIGINT} and rec_status = 0
</select>
<select id="overNum" resultType="Integer">
select count(*) from t_game_user_join where record_id = #{recordId,jdbcType=BIGINT} and score &lt; #{score,jdbcType=INTEGER}
select count(*) from t_game_user_join where record_id = #{recordId,jdbcType=BIGINT} and score &lt; #{score,jdbcType=INTEGER} and rec_status = 0
</select>
<select id="getAllRanking" resultType="com.ccsens.game.bean.vo.ClientVo$MemberInfo">
SELECT a.*,(@rowNum:=@rowNum+1) AS sort

7
ht/src/main/java/com/ccsens/ht/api/PatientController.java

@ -1,6 +1,7 @@
package com.ccsens.ht.api;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.annotation.DoctorAudit;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ht.bean.dto.PatientDto;
@ -144,7 +145,9 @@ public class PatientController {
@RequestMapping(value="/editPatientOtherMsg", method = RequestMethod.POST)
public JsonResponse editPatientOtherMsg(@RequestBody @ApiParam @Valid QueryDto<PatientDto.EditOtherMsg> params) {
log.info("查询其他信息请求参数:{}", params);
CodeEnum codeEnum = patientService.editPatientOtherMsg(params.getParam(), params.getUserId());
return JsonResponse.newInstance().ok(codeEnum);
long id = patientService.editPatientOtherMsg(params.getParam(), params.getUserId());
JSONObject json = new JSONObject();
json.put("id", id);
return JsonResponse.newInstance().ok(CodeEnum.SUCCESS, json);
}
}

4
ht/src/main/java/com/ccsens/ht/service/IPatientService.java

@ -41,11 +41,11 @@ public interface IPatientService {
* 编辑病友其他信息
* @param edit
* @param userId
*@return: com.ccsens.ptpro.util.CodeEnum
*@return:
*@Author: wuHuiJuan
*@date: 2019/11/20 11:33
*/
CodeEnum editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId);
long editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId);
/**
* 根据记录人查询病人信息

5
ht/src/main/java/com/ccsens/ht/service/PatientService.java

@ -220,7 +220,7 @@ public class PatientService implements IPatientService {
}
@Override
public CodeEnum editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId) {
public long editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId) {
String type = edit.getEditType();
JSONObject json = edit.getModel();
@ -230,6 +230,7 @@ public class PatientService implements IPatientService {
String id = "id";
if (json.getLong(id) == null || json.getLong(id) == 0 ) {
methodName = "insertSelective";
json.put("isDel", 0);
json.put(id, snowflake.nextId());
} else {
methodName = "updateByPrimaryKey";
@ -243,6 +244,7 @@ public class PatientService implements IPatientService {
Method method = bean.getClass().getMethod(methodName, modelClass);
//方法调用(保存/修改)
method.invoke(bean, model);
return json.getLong("id");
} catch (ClassNotFoundException e) {
log.error("编辑病人其他信息反射异常",e);
throw new BaseException(CodeEnum.PARAM_ERROR);
@ -256,6 +258,5 @@ public class PatientService implements IPatientService {
log.error("编辑病人其他信息反射异常",e);
throw new BaseException(CodeEnum.PARAM_ERROR);
}
return CodeEnum.SUCCESS;
}
}

8
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -79,7 +79,13 @@ public class SpringConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS");
// registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS");
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.allowCredentials(true)
.maxAge(3600)
.allowedHeaders("*");
}
/**

Loading…
Cancel
Save