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 id="selectTopTen" resultType="com.ccsens.game.bean.vo.ScreenVo$TopUsers">
select user_id, avatar_url as headImgUrl, nickname, score, score/100 as times select user_id, avatar_url as headImgUrl, nickname, score, score/100 as times
from t_game_user_join 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 ORDER BY score DESC
limit 10 limit 10
</select> </select>
@ -33,7 +33,7 @@
FROM FROM
t_game_user_join t_game_user_join
WHERE WHERE
record_id = #{recordId} record_id = #{recordId} and rec_status = 0
</select> </select>
<select id="getRanking" resultType="int"> <select id="getRanking" resultType="int">
@ -49,11 +49,11 @@ WHERE c.user_id= #{userId,jdbcType=BIGINT} limit 1
</select> </select>
<select id="gameCount" resultType="com.ccsens.game.bean.dto.message.ChangeStatusMessageDto$CompletedData"> <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>
<select id="overNum" resultType="Integer"> <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>
<select id="getAllRanking" resultType="com.ccsens.game.bean.vo.ClientVo$MemberInfo"> <select id="getAllRanking" resultType="com.ccsens.game.bean.vo.ClientVo$MemberInfo">
SELECT a.*,(@rowNum:=@rowNum+1) AS sort 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; package com.ccsens.ht.api;
import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.annotation.DoctorAudit; import com.ccsens.ht.annotation.DoctorAudit;
import com.ccsens.cloudutil.annotation.MustLogin; import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ht.bean.dto.PatientDto; import com.ccsens.ht.bean.dto.PatientDto;
@ -144,7 +145,9 @@ public class PatientController {
@RequestMapping(value="/editPatientOtherMsg", method = RequestMethod.POST) @RequestMapping(value="/editPatientOtherMsg", method = RequestMethod.POST)
public JsonResponse editPatientOtherMsg(@RequestBody @ApiParam @Valid QueryDto<PatientDto.EditOtherMsg> params) { public JsonResponse editPatientOtherMsg(@RequestBody @ApiParam @Valid QueryDto<PatientDto.EditOtherMsg> params) {
log.info("查询其他信息请求参数:{}", params); log.info("查询其他信息请求参数:{}", params);
CodeEnum codeEnum = patientService.editPatientOtherMsg(params.getParam(), params.getUserId()); long id = patientService.editPatientOtherMsg(params.getParam(), params.getUserId());
return JsonResponse.newInstance().ok(codeEnum); 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 edit
* @param userId * @param userId
*@return: com.ccsens.ptpro.util.CodeEnum *@return:
*@Author: wuHuiJuan *@Author: wuHuiJuan
*@date: 2019/11/20 11:33 *@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 @Override
public CodeEnum editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId) { public long editPatientOtherMsg(PatientDto.EditOtherMsg edit, Long userId) {
String type = edit.getEditType(); String type = edit.getEditType();
JSONObject json = edit.getModel(); JSONObject json = edit.getModel();
@ -230,6 +230,7 @@ public class PatientService implements IPatientService {
String id = "id"; String id = "id";
if (json.getLong(id) == null || json.getLong(id) == 0 ) { if (json.getLong(id) == null || json.getLong(id) == 0 ) {
methodName = "insertSelective"; methodName = "insertSelective";
json.put("isDel", 0);
json.put(id, snowflake.nextId()); json.put(id, snowflake.nextId());
} else { } else {
methodName = "updateByPrimaryKey"; methodName = "updateByPrimaryKey";
@ -243,6 +244,7 @@ public class PatientService implements IPatientService {
Method method = bean.getClass().getMethod(methodName, modelClass); Method method = bean.getClass().getMethod(methodName, modelClass);
//方法调用(保存/修改) //方法调用(保存/修改)
method.invoke(bean, model); method.invoke(bean, model);
return json.getLong("id");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
log.error("编辑病人其他信息反射异常",e); log.error("编辑病人其他信息反射异常",e);
throw new BaseException(CodeEnum.PARAM_ERROR); throw new BaseException(CodeEnum.PARAM_ERROR);
@ -256,6 +258,5 @@ public class PatientService implements IPatientService {
log.error("编辑病人其他信息反射异常",e); log.error("编辑病人其他信息反射异常",e);
throw new BaseException(CodeEnum.PARAM_ERROR); 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 @Override
public void addCorsMappings(CorsRegistry registry) { 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