zhizhi wu 6 years ago
parent
commit
fb9c7ec782
  1. 13
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
  2. 104
      mt/src/main/java/com/ccsens/mt/api/SigninController.java
  3. 20
      mt/src/main/java/com/ccsens/mt/bean/dto/SigninDto.java
  4. 4
      mt/src/main/java/com/ccsens/mt/bean/vo/SigninVo.java
  5. 4
      mt/src/main/java/com/ccsens/mt/service/ISigninService.java
  6. 56
      mt/src/main/java/com/ccsens/mt/service/SigninService.java
  7. 4
      mt/src/main/resources/application.yml
  8. 2
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  9. 2
      tall/src/main/java/com/ccsens/tall/persist/dao/SysPluginDao.java
  10. 2
      tall/src/main/java/com/ccsens/tall/service/ISysPluginService.java
  11. 4
      tall/src/main/java/com/ccsens/tall/service/IUserService.java
  12. 51
      tall/src/main/java/com/ccsens/tall/service/SysPluginService.java
  13. 156
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  14. 196
      tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java
  15. 25
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  16. 31
      tall/src/main/java/com/ccsens/tall/web/UserController.java
  17. 13
      tall/src/main/resources/mapper_dao/SysPluginDao.xml
  18. 3
      util/src/main/java/com/ccsens/util/CodeEnum.java

13
cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java

@ -114,7 +114,13 @@ public interface TallFeignClient {
* 通过插件id获取签到字段和详细信息
*/
@GetMapping("/plugins/sign")
List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(Long taskPluginId);
List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(@RequestParam( name = "taskPluginId")Long taskPluginId);
/**
* 模糊查询
*/
@GetMapping("/plugins/fuzzy")
List<String> getSignFuzzy(@RequestParam( name = "taskPluginId")Long taskPluginId,@RequestParam( name = "signinName")String signinName,@RequestParam( name = "key")String key);
}
@ -183,6 +189,11 @@ class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> {
public List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(Long taskPluginId){
return null;
}
@Override
public List<String> getSignFuzzy(Long taskPluginId, String signinName, String key) {
return null;
}
};
}

104
mt/src/main/java/com/ccsens/mt/api/SigninController.java

@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(tags = "签到" , description = "")
@Api(tags = "签到", description = "")
@RestController
@RequestMapping("/signin")
@Slf4j
@ -31,27 +31,43 @@ public class SigninController {
})
@RequestMapping(value = "info", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SigninVo.SignInfoVo> getSignField(HttpServletRequest request,
@ApiParam @Validated @RequestBody Long taskPluginId) throws Exception {
@RequestParam Long taskPluginId) throws Exception {
log.info("{}:查看签到需要填的信息");
//获取userId
Long userId = userService.getUserIdByToken(request);
SigninVo.SignInfoVo signInfoVo = signinService.getSignField(taskPluginId,userId);
SigninVo.SignInfoVo signInfoVo = signinService.getSignField(taskPluginId, userId);
return JsonResponse.newInstance().ok(signInfoVo);
}
// @ApiOperation(value = "模糊查询签到信息", notes = "")
// @ApiImplicitParams({
// })
// @RequestMapping(value = "fuzzy", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<SigninVo.SignInfoVo> getSignByFuzzy(HttpServletRequest request,
// @ApiParam @Validated @RequestBody Long projectId,String signinName,String key) throws Exception {
// log.info("{}:查看签到需要填的信息");
// //获取userId
// Long userId = userService.getUserIdByToken(request);
//
// return JsonResponse.newInstance().ok(signInfoVo);
// }
@ApiOperation(value = "签到(保存签到的信息)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SigninVo.SigninVoInfo> signin(HttpServletRequest request,
@ApiParam @Validated @RequestBody SigninDto.SaveSign saveSign) throws Exception {
log.info("{}:签到");
//获取userId
Long userId = userService.getUserIdByToken(request);
SigninVo.SignInfoVo signInfoVo = signinService.saveSignInfo(saveSign, userId);
return JsonResponse.newInstance().ok(saveSign);
}
@ApiOperation(value = "模糊查询签到信息", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "fuzzy", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<String>> getSignByFuzzy(HttpServletRequest request,
@RequestParam Long taskPluginId,String signinName,String key) throws Exception {
log.info("{}:查看签到需要填的信息");
//获取userId
Long userId = userService.getUserIdByToken(request);
List<String> keys = signinService.getFuzzyKey(userId,taskPluginId,signinName,key);
return JsonResponse.newInstance().ok(keys);
}
// @ApiOperation(value = "签到", notes = "")
// @ApiImplicitParams({
@ -67,33 +83,33 @@ public class SigninController {
// return JsonResponse.newInstance().ok(signinVoInfo);
// }
@ApiOperation(value = "查看自己的签到信息", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "签到任务的id", required = true, paramType = ""),
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SigninVo.SigninVoInfo> getSignByTaskId(HttpServletRequest request,
@RequestParam(required = true) Long taskId) throws Exception {
log.info("查看自己的签到信息");
//获取userId
Long userId = userService.getUserIdByToken(request);
SigninVo.SigninVoInfo signinVoInfo = signinService.getSignByTaskId(taskId,userId);
return JsonResponse.newInstance().ok(signinVoInfo);
}
@ApiOperation(value = "查看所有人的签到信息", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "签到任务的id", required = true, paramType = ""),
})
@RequestMapping(value = "all", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<SigninVo.SigninVoInfo>> getSignAllByTaskId(HttpServletRequest request,
@RequestParam(required = true) Long taskId) throws Exception {
log.info("查看所有人的签到信息");
//获取userId
Long userId = userService.getUserIdByToken(request);
List<SigninVo.SigninVoInfo> signinVoInfo = signinService.getSignAllByTaskId(taskId,userId);
return JsonResponse.newInstance().ok(signinVoInfo);
}
// @ApiOperation(value = "查看自己的签到信息", notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "taskId", value = "签到任务的id", required = true, paramType = ""),
// })
// @RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<SigninVo.SigninVoInfo> getSignByTaskId(HttpServletRequest request,
// @RequestParam(required = true) Long taskId) throws Exception {
// log.info("查看自己的签到信息");
// //获取userId
// Long userId = userService.getUserIdByToken(request);
// SigninVo.SigninVoInfo signinVoInfo = signinService.getSignByTaskId(taskId,userId);
//
// return JsonResponse.newInstance().ok(signinVoInfo);
// }
//
// @ApiOperation(value = "查看所有人的签到信息", notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "taskId", value = "签到任务的id", required = true, paramType = ""),
// })
// @RequestMapping(value = "all", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<SigninVo.SigninVoInfo>> getSignAllByTaskId(HttpServletRequest request,
// @RequestParam(required = true) Long taskId) throws Exception {
// log.info("查看所有人的签到信息");
// //获取userId
// Long userId = userService.getUserIdByToken(request);
// List<SigninVo.SigninVoInfo> signinVoInfo = signinService.getSignAllByTaskId(taskId,userId);
//
// return JsonResponse.newInstance().ok(signinVoInfo);
// }
}

20
mt/src/main/java/com/ccsens/mt/bean/dto/SigninDto.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class SigninDto {
@Data
@ -16,4 +18,22 @@ public class SigninDto {
@ApiModelProperty("手机号")
private String phone;
}
@Data
@ApiModel
public static class SaveSign{
@ApiModelProperty("任务插件id")
private Long taskPluginId;
@ApiModelProperty("签到信息")
private List<SaveSignInfo> signInfoList;
}
@Data
@ApiModel
public static class SaveSignInfo{
@ApiModelProperty("签到字段")
private String key;
@ApiModelProperty("内容")
private String value;
}
}

4
mt/src/main/java/com/ccsens/mt/bean/vo/SigninVo.java

@ -36,8 +36,10 @@ public class SigninVo {
@Data
@ApiModel
public static class SignField{
@ApiModelProperty("字段名")
@ApiModelProperty("变量名")
private String name;
@ApiModelProperty("展示名")
private String description;
@ApiModelProperty("内容")
private String value;
@ApiModelProperty("类型 0文本,1文本框,2单选,3多选")

4
mt/src/main/java/com/ccsens/mt/service/ISigninService.java

@ -13,4 +13,8 @@ public interface ISigninService {
List<SigninVo.SigninVoInfo> getSignAllByTaskId(Long taskId, Long userId);
SigninVo.SignInfoVo getSignField(Long taskPluginId, Long userId);
List<String> getFuzzyKey(Long userId, Long taskPluginId, String signinName, String key);
SigninVo.SignInfoVo saveSignInfo(SigninDto.SaveSign saveSign, Long userId);
}

56
mt/src/main/java/com/ccsens/mt/service/SigninService.java

@ -73,7 +73,8 @@ public class SigninService implements ISigninService{
if(CollectionUtil.isNotEmpty(pluginSignFieldList)){
for(PluginVo.PluginSignField pluginSignField : pluginSignFieldList) {
SigninVo.SignField signField = new SigninVo.SignField();
signField.setName(pluginSignField.getDescription());
signField.setName(pluginSignField.getName());
signField.setDescription(pluginSignField.getDescription());
signField.setField(pluginSignField.getFieldValue());
signField.setIsFuzzy(pluginSignField.getIsFuzzy());
signField.setIsRequired(pluginSignField.getIsRequired());
@ -88,8 +89,61 @@ public class SigninService implements ISigninService{
return signInfoVo;
}
/**
* 模糊查询签到字段的内容
* @param userId
* @param taskPluginId
* @param signinName
* @param key
* @return
*/
@Override
public List<String> getFuzzyKey(Long userId, Long taskPluginId, String signinName, String key) {
List<String> keys = tallFeignClient.getSignFuzzy(taskPluginId,signinName,key);
return keys;
}
@Override
public SigninVo.SignInfoVo saveSignInfo(SigninDto.SaveSign saveSign, Long userId) {
//判断用户是否有签到权限
//判断用户是否签到
MtSigninBasicExample signinBasicExample = new MtSigninBasicExample();
signinBasicExample.createCriteria().andUserIdEqualTo(userId).andTaskPluginIdEqualTo(saveSign.getTaskPluginId());
List<MtSigninBasic> signinBasicList = signinBasicDao.selectByExample(signinBasicExample);
if(CollectionUtil.isNotEmpty(signinBasicList)){
throw new BaseException(CodeEnum.ALREADY_SIGN);
}
//获取签到的序号(之前签到的人数加一)
MtSigninBasicExample BasicExample = new MtSigninBasicExample();
BasicExample.createCriteria().andTaskPluginIdEqualTo(saveSign.getTaskPluginId());
int count = (int) signinBasicDao.countByExample(BasicExample);
//保存签到信息
MtSigninBasic signinBasic = new MtSigninBasic();
signinBasic.setId(snowflake.nextId());
signinBasic.setUserId(userId);
signinBasic.setTaskPluginId(saveSign.getTaskPluginId());
signinBasic.setSigninTime(System.currentTimeMillis());
signinBasic.setIsSign((byte) 1);
signinBasic.setSequence(count + 1);
signinBasicDao.insertSelective(signinBasic);
if(CollectionUtil.isNotEmpty(saveSign.getSignInfoList())){
for(SigninDto.SaveSignInfo signinVoInfo:saveSign.getSignInfoList()){
MtSigninOther signinOther = new MtSigninOther();
signinOther.setId(snowflake.nextId());
signinOther.setSigninBasicId(signinBasic.getId());
signinOther.setKey(signinVoInfo.getKey());
signinOther.setValue(signinVoInfo.getValue());
signinOtherDao.insertSelective(signinOther);
}
}
//返回
SigninVo.SignInfoVo signInfoVo = new SigninVo.SignInfoVo();
signInfoVo.setIsSign(1);
signInfoVo.setSequence(signinBasic.getSequence());
signInfoVo.setSignTime(signinBasic.getSigninTime());
return signInfoVo;
}
/*=====================================================================================================*/

4
mt/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

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

@ -137,6 +137,8 @@ public class SpringConfig implements WebMvcConfigurer {
.excludePathPatterns("/users/member")
.excludePathPatterns("/users/allMemberAll")
.addPathPatterns("/plugins/**")
.excludePathPatterns("/plugins/sign")
.excludePathPatterns("/plugins/fuzzy")
.addPathPatterns("/delivers/**")
.addPathPatterns("/tasks/**")
.excludePathPatterns("/tasks/projectId")

2
tall/src/main/java/com/ccsens/tall/persist/dao/SysPluginDao.java

@ -13,4 +13,6 @@ public interface SysPluginDao extends SysPluginMapper{
List<PluginVo.PluginInfo> selectPluginAll();
List<TaskVo.PluginVo> getPluginByTask(@Param("taskId") Long taskId);
List<String> selectSignFuzzy(@Param("projectId") Long projectId, @Param("signFieldId") Long signFieldId, @Param("key") String key);
}

2
tall/src/main/java/com/ccsens/tall/service/ISysPluginService.java

@ -8,4 +8,6 @@ public interface ISysPluginService {
List<PluginVo.PluginInfo> getPluginAll();
List<PluginVo.PluginSignField> getSignByPlugin(Long taskPluginId);
List<String> getSignFuzzy(Long taskPluginId, String signinName, String key);
}

4
tall/src/main/java/com/ccsens/tall/service/IUserService.java

@ -64,4 +64,8 @@ public interface IUserService {
UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone);
UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo);
void relievePhone(Long userId,String phone);
UserVo.UserSign changePhoneNotPassword(Long userId,UserDto.WxBindingPhone phoneInfo) throws Exception;
}

51
tall/src/main/java/com/ccsens/tall/service/SysPluginService.java

@ -2,18 +2,15 @@ package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.po.ProPluginSignin;
import com.ccsens.tall.bean.po.ProPluginSigninExample;
import com.ccsens.tall.bean.po.SigninField;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.persist.dao.ProPluginSigninDao;
import com.ccsens.tall.persist.dao.SigninFieldDao;
import com.ccsens.tall.persist.dao.SysPluginDao;
import com.ccsens.tall.persist.dao.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.ContextLoaderListener;
import java.util.ArrayList;
import java.util.List;
@ -25,6 +22,10 @@ public class SysPluginService implements ISysPluginService{
@Autowired
private SysPluginDao sysPluginDao;
@Autowired
private TaskPluginDao taskPluginDao;
@Autowired
private TaskDetailDao taskDetailDao;
@Autowired
private ProPluginSigninDao pluginSigninDao;
@Autowired
private SigninFieldDao signinFieldDao;
@ -66,4 +67,42 @@ public class SysPluginService implements ISysPluginService{
return pluginSignFieldList;
}
/**
* 模糊查询签到的信息
*/
@Override
public List<String> getSignFuzzy(Long taskPluginId, String signinName, String key) {
List<String> keys = null;
//查找签到的字段id
Long signFieldId = null;
SigninFieldExample signinFieldExample = new SigninFieldExample();
signinFieldExample.createCriteria().andNameEqualTo(signinName);
List<SigninField> signinFieldList = signinFieldDao.selectByExample(signinFieldExample);
if(CollectionUtil.isNotEmpty(signinFieldList)){
SigninField signinField = signinFieldList.get(0);
ProPluginSigninExample pluginSigninExample = new ProPluginSigninExample();
pluginSigninExample.createCriteria().andSigninFieldIdEqualTo(signinField.getId());
List<ProPluginSignin> pluginSigninList = pluginSigninDao.selectByExample(pluginSigninExample);
if(CollectionUtil.isNotEmpty(pluginSigninList)){
ProPluginSignin pluginSignin = pluginSigninList.get(0);
if(pluginSignin.getIsFuzzy() == 0){
return null;
}
}
signFieldId = signinField.getId();
}
//查找项目id
Long projectId = null;
ProTaskPlugin proTaskPlugin = taskPluginDao.selectByPrimaryKey(taskPluginId);
if(ObjectUtil.isNotNull(proTaskPlugin)){
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(proTaskPlugin.getTaskDetailId());
if(ObjectUtil.isNotNull(taskDetail)){
projectId = taskDetail.getProjectId();
}
}
if(ObjectUtil.isNotNull(signFieldId) && ObjectUtil.isNotNull(projectId)){
keys = sysPluginDao.selectSignFuzzy(projectId,signFieldId,key);
}
return keys;
}
}

156
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -134,7 +134,7 @@ public class UserService implements IUserService {
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andCredentialEqualTo(wxOauth2UserInfo.getUnionId());
List<SysAuth> sysAuthList = authDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(sysAuthList)){
if (CollectionUtil.isNotEmpty(sysAuthList)) {
//添加认证方式
theAuth = new SysAuth();
theAuth.setId(snowflake.nextId());
@ -143,7 +143,7 @@ public class UserService implements IUserService {
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
authDao.insertSelective(theAuth);
}else {
} else {
//新建用户并保存微信信息
SysUser user = new SysUser();
user.setId(snowflake.nextId());
@ -195,7 +195,7 @@ public class UserService implements IUserService {
private UserVo.UserSign wxLogin(WebConstant.IDENTIFY_TYPE identifyType, String code) throws Exception {
UserVo.UserSign userSignVo = null;
//获取微信信息并保存
log.info("公众号登陆,{}",code);
log.info("公众号登陆,{}", code);
WxOauth2UserInfo wxOauth2UserInfo = WxGzhUtil.getOauth2UserInfo(identifyType, code);
SysAuth theAuth = null;
@ -210,7 +210,7 @@ public class UserService implements IUserService {
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andCredentialEqualTo(wxOauth2UserInfo.getUnionId());
List<SysAuth> sysAuthList = authDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(sysAuthList)){
if (CollectionUtil.isNotEmpty(sysAuthList)) {
// SysAuth sysAuth = sysAuthList.get(0);
//添加认证方式
theAuth = new SysAuth();
@ -220,7 +220,7 @@ public class UserService implements IUserService {
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
authDao.insertSelective(theAuth);
}else {
} else {
//新建用户并保存微信信息
SysUser user = new SysUser();
user.setId(snowflake.nextId());
@ -294,7 +294,7 @@ public class UserService implements IUserService {
theAuth = authList.get(0);
} else {
// throw new BaseException(CodeEnum.NOT_REGISTER);
theAuth = wxRegist(phone,null,WebConstant.IDENTIFY_TYPE.Phone);
theAuth = wxRegist(phone, null, WebConstant.IDENTIFY_TYPE.Phone);
}
userSignVo = new UserVo.UserSign();
userSignVo.setUserId(theAuth.getUserId());
@ -346,7 +346,7 @@ public class UserService implements IUserService {
WxXcxUtil.WechatUser wechatUser = WxXcxUtil.getUserInfo(code);
String openId = wechatUser.openid;
String unionId = wechatUser.unionid;
log.info("小程序登录,openid:{} ,unionId:{}",openId,unionId);
log.info("小程序登录,openid:{} ,unionId:{}", openId, unionId);
//1.查找对应账户,不存在则注册
List<SysAuth> authList = null;
SysAuth theAuth = null;
@ -358,7 +358,7 @@ public class UserService implements IUserService {
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andCredentialEqualTo(unionId);
List<SysAuth> sysAuthList = authDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(sysAuthList)){
if (CollectionUtil.isNotEmpty(sysAuthList)) {
// SysAuth sysAuth = sysAuthList.get(0);
//添加认证方式
theAuth = new SysAuth();
@ -368,7 +368,7 @@ public class UserService implements IUserService {
theAuth.setIdentifier(openId);
theAuth.setCredential(unionId);
authDao.insertSelective(theAuth);
}else {
} else {
//新建用户并保存微信信息
SysUser user = new SysUser();
user.setId(snowflake.nextId());
@ -408,7 +408,7 @@ public class UserService implements IUserService {
*
* @return
*/
private SysAuth wxRegist(String identifier, String credential,WebConstant.IDENTIFY_TYPE identifyType) {
private SysAuth wxRegist(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType) {
//1.添加user
SysUser user = new SysUser();
user.setId(snowflake.nextId());
@ -519,8 +519,8 @@ public class UserService implements IUserService {
}
//2.生成随机验证码
String verifyCode = RandomUtil.randomNumbers(4);
// String verifyCode = "1111";
// String verifyCode = RandomUtil.randomNumbers(4);
String verifyCode = "1111";
//3.保存到redis中
Integer codeValidInSeconds = WebConstant.Expired_Verify_Code_In_Seconds;
@ -529,7 +529,7 @@ public class UserService implements IUserService {
redisUtil.set(RedisKeyManager.getSigninSmsExistKey(phone), verifyCode, codeExistINSeconds);
//5.发送验证码
SmsUtil.sendSms(phone, verifyCode, client_type.phase, codeValidInSeconds);
// SmsUtil.sendSms(phone, verifyCode, client_type.phase, codeValidInSeconds);
//6.返回
smsCodeVo = new UserVo.SmsCode();
@ -629,7 +629,7 @@ public class UserService implements IUserService {
List<ProMember> proMemberList = memberDao.selectByExample(memberExample);
if (CollectionUtil.isNotEmpty(proMemberList)) {
SysUser user = userDao.selectByPrimaryKey(userId);
if(ObjectUtil.isNotNull(user)) {
if (ObjectUtil.isNotNull(user)) {
for (ProMember member : proMemberList) {
if (ObjectUtil.isNull(member.getUserId()) || member.getUserId() == 0) {
member.setUserId(userId);
@ -729,10 +729,10 @@ public class UserService implements IUserService {
List<SysAuth> phoneList = null;
SysAuth theAuth = null;
SysAuthExample phoneExample = new SysAuthExample();
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
phoneExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
.andIdentifierEqualTo(wxPhone.getPhone());
phoneList = authDao.selectByExample(phoneExample);
if (CollectionUtil.isNotEmpty(phoneList)) {//已被注册 提示
if (CollectionUtil.isNotEmpty(phoneList)) {
throw new BaseException(CodeEnum.MERGE_WX_PHONE);
} else {
// throw new BaseException(CodeEnum.NOT_REGISTER);
@ -745,7 +745,7 @@ public class UserService implements IUserService {
authDao.insertSelective(auth);
//给手机号一样的所有项目内的成员添加userId
memberHandler(currentUserId,wxPhone.getPhone());
memberHandler(currentUserId, wxPhone.getPhone());
}
}
} else {
@ -757,7 +757,7 @@ public class UserService implements IUserService {
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
.andIdentifierEqualTo(wxPhone.getPhone());
List<SysAuth> authList = authDao.selectByExample(authExample);
if(CollectionUtil.isNotEmpty(authList)) {
if (CollectionUtil.isNotEmpty(authList)) {
userSignVo = new UserVo.UserSign();
userSignVo.setAuthId(authList.get(0).getId());
userSignVo.setUserId(authList.get(0).getUserId());
@ -982,7 +982,7 @@ public class UserService implements IUserService {
//获取用户的基本信息、
UserVo.WxInfo wxInfo = null;
SysUser user = userDao.selectByPrimaryKey(userSignVo.getUserId());
if(ObjectUtil.isNotNull(user)) {
if (ObjectUtil.isNotNull(user)) {
wxInfo = new UserVo.WxInfo();
BeanUtil.copyProperties(user, wxInfo);
wxInfo.setSex(user.getGender());
@ -1009,6 +1009,7 @@ public class UserService implements IUserService {
/**
* 合并账号
*
* @param currentUserId
* @param wxPhone
* @return
@ -1019,36 +1020,36 @@ public class UserService implements IUserService {
//直接合并
//1.查找手机号原来的userId
Long userId = selectUserIdByPhone(wxPhone.getPhone());
if(ObjectUtil.isNotNull(userId)){
if (ObjectUtil.isNotNull(userId)) {
//处理账号认证信息,保留手机号的账号,删除现在的账号
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value)
.andUserIdEqualTo(currentUserId);
List<SysAuth> authList = authDao.selectByExample(authExample);
if(CollectionUtil.isNotEmpty(authList)){
for(SysAuth auth : authList){
if (CollectionUtil.isNotEmpty(authList)) {
for (SysAuth auth : authList) {
auth.setRecStatus((byte) 2);
authDao.updateByPrimaryKeySelective(auth);
}
}
userDao.replaceAuth(userId,currentUserId);
userDao.replaceAuth(userId, currentUserId);
//查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表
//依次将查出的数据的旧userId 替换成新的userId
userDao.replaceAttention(userId,currentUserId);
userDao.replaceBalance(userId,currentUserId);
userDao.replaceProject(userId,currentUserId);
userDao.replaceMember(userId,currentUserId);
userDao.replaceDeliverPostLog(userId,currentUserId);
userDao.replaceProLog(userId,currentUserId);
userDao.replaceAttention(userId, currentUserId);
userDao.replaceBalance(userId, currentUserId);
userDao.replaceProject(userId, currentUserId);
userDao.replaceMember(userId, currentUserId);
userDao.replaceDeliverPostLog(userId, currentUserId);
userDao.replaceProLog(userId, currentUserId);
//将以前的余额添加至此账号
SysUser oldUser = userDao.selectByPrimaryKey(userId);
SysUser newUser = userDao.selectByPrimaryKey(currentUserId);
updateBalance(oldUser,newUser);
updateBalance(oldUser, newUser);
//将以前的user删除
oldUser.setRecStatus((byte) 2);
userDao.updateByPrimaryKeySelective(oldUser);
}else {
} else {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
} else {
@ -1057,7 +1058,7 @@ public class UserService implements IUserService {
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
.andIdentifierEqualTo(wxPhone.getPhone());
List<SysAuth> authList = authDao.selectByExample(authExample);
if(CollectionUtil.isNotEmpty(authList)){
if (CollectionUtil.isNotEmpty(authList)) {
SysAuth auth = authList.get(0);
auth.setUserId(currentUserId);
authDao.updateByPrimaryKeySelective(auth);
@ -1069,7 +1070,7 @@ public class UserService implements IUserService {
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
.andIdentifierEqualTo(wxPhone.getPhone());
List<SysAuth> authList = authDao.selectByExample(authExample);
if(CollectionUtil.isNotEmpty(authList)) {
if (CollectionUtil.isNotEmpty(authList)) {
userSignVo = new UserVo.UserSign();
userSignVo.setAuthId(authList.get(0).getId());
userSignVo.setUserId(authList.get(0).getUserId());
@ -1077,7 +1078,8 @@ public class UserService implements IUserService {
return userSignVo;
}
private void updateBalance(SysUser oldUser,SysUser newUser){
private void updateBalance(SysUser oldUser, SysUser newUser) {
newUser.setBalance(newUser.getBalance() + oldUser.getBalance());
userDao.updateByPrimaryKeySelective(newUser);
//添加一条余额变更记录
@ -1092,6 +1094,7 @@ public class UserService implements IUserService {
/**
* 修改用户信息添加微信信息
*
* @return
*/
@Override
@ -1099,33 +1102,102 @@ public class UserService implements IUserService {
//通过userid查找到用户
SysUser user = userDao.selectByPrimaryKey(currentUserId);
if(StrUtil.isNotEmpty(userInfo.getNickname())){
if (StrUtil.isNotEmpty(userInfo.getNickname())) {
user.setNickname(userInfo.getNickname());
}
if(StrUtil.isNotEmpty(userInfo.getHeadImgUrl())){
if (StrUtil.isNotEmpty(userInfo.getHeadImgUrl())) {
user.setAvatarUrl(userInfo.getHeadImgUrl());
}
if(ObjectUtil.isNotNull(userInfo.getSex())){
if (ObjectUtil.isNotNull(userInfo.getSex())) {
user.setGender(userInfo.getSex());
}
if(StrUtil.isNotEmpty(userInfo.getCountry())){
if (StrUtil.isNotEmpty(userInfo.getCountry())) {
user.setCountry(userInfo.getCountry());
}
if(StrUtil.isNotEmpty(userInfo.getProvince())){
if (StrUtil.isNotEmpty(userInfo.getProvince())) {
user.setProvince(userInfo.getProvince());
}
if(StrUtil.isNotEmpty(userInfo.getCity())){
if (StrUtil.isNotEmpty(userInfo.getCity())) {
user.setCity(userInfo.getCity());
}
if(StrUtil.isNotEmpty(userInfo.getLanguage())){
if (StrUtil.isNotEmpty(userInfo.getLanguage())) {
user.setLanguage(userInfo.getLanguage());
}
userDao.updateByPrimaryKeySelective(user);
UserVo.WxInfo wxInfo = new UserVo.WxInfo();
BeanUtil.copyProperties(user,wxInfo);
BeanUtil.copyProperties(user, wxInfo);
wxInfo.setHeadImgUrl(user.getAvatarUrl());
wxInfo.setSex(user.getGender());
return wxInfo;
}
/**
* 解除已绑定的手机号
*/
@Override
public void relievePhone(Long userId, String phone) {
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andUserIdEqualTo(userId)
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
.andIdentifierEqualTo(phone);
List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) {
SysAuth auth = authList.get(0);
auth.setRecStatus((byte) 2);
authDao.updateByPrimaryKeySelective(auth);
}
}
/**
* 更改绑定手机号不要密码
* @param userId
* @param phoneInfo
* @throws Exception
*/
@Override
public UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) throws Exception {
UserVo.UserSign userSign = null;
if (isSmsCodeCorrect(phoneInfo.getPhone(), phoneInfo.getSmsCode())) {
//查找新手机号的的绑定信息
Long newPhoneUserId = selectUserIdByPhone(phoneInfo.getPhone());
if (ObjectUtil.isNull(newPhoneUserId)) {
//查找此用户的的手机号
SysAuthExample phoneExample = new SysAuthExample();
phoneExample.createCriteria().andUserIdEqualTo(userId)
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
List<SysAuth> phoneAuthList = authDao.selectByExample(phoneExample);
if (CollectionUtil.isNotEmpty(phoneAuthList)) {
//修改
SysAuth phoneAuth = phoneAuthList.get(0);
phoneAuth.setIdentifier(phoneInfo.getPhone());
authDao.updateByPrimaryKeySelective(phoneAuth);
userSign = new UserVo.UserSign();
userSign.setUserId(phoneAuth.getUserId());
userSign.setAuthId(phoneAuth.getId());
}else {
//添加一条手机号认证信息
SysAuth sysAuth = new SysAuth();
sysAuth.setId(snowflake.nextId());
sysAuth.setUserId(userId);
sysAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
sysAuth.setIdentifier(phoneInfo.getPhone());
authDao.insertSelective(sysAuth);
userSign = new UserVo.UserSign();
userSign.setUserId(sysAuth.getUserId());
userSign.setAuthId(sysAuth.getId());
}
} else {
throw new BaseException(CodeEnum.MERGE_WX_PHONE);
}
} else {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
return userSign;
}
}

196
tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java

@ -226,112 +226,114 @@ public class WbsSubSheetService implements IWbsSubSheetService {
@Override
public void getSigninSheet(Long projectId,XSSFWorkbook xssfWorkbook, List<ProTaskDetail> taskDetails) {
XSSFSheet signSheet = xssfWorkbook.getSheet("签到信息表");
int fuzzyStart = 0;
for (int i = 0; i <= signSheet.getLastRowNum(); i++) {
XSSFRow xssfRow = signSheet.getRow(i);
if (xssfRow == null) {
continue;
}
XSSFCell xssfCell = xssfRow.getCell(0);
if (xssfCell == null) {
continue;
}
String s = ExcelUtil.getCellValue(xssfCell);
if (ObjectUtil.isNotNull(signSheet)) {
int fuzzyStart = 0;
for (int i = 0; i <= signSheet.getLastRowNum(); i++) {
XSSFRow xssfRow = signSheet.getRow(i);
if (xssfRow == null) {
continue;
}
XSSFCell xssfCell = xssfRow.getCell(0);
if (xssfCell == null) {
continue;
}
String s = ExcelUtil.getCellValue(xssfCell);
if (s.indexOf("需要模糊查询的信息") == 0) {
fuzzyStart = i + 1;
}
}
Long taskPluginId = null;
String taskName = null;
String pluginName = null;
List<ProPluginSignin> proPluginSigninList = new ArrayList<>();
for (int i = 2; i < fuzzyStart; i++) {
if(StrUtil.isNotEmpty(ExcelUtil.getCellValue(signSheet.getRow(i).getCell(1)))){
taskName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(1));
}
if(StrUtil.isNotEmpty(ExcelUtil.getCellValue(signSheet.getRow(i).getCell(2)))){
pluginName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(2));
}
String signName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(3));
String isRequired = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(4));
//任务下插件的id
if(StrUtil.isNotEmpty(taskName) && StrUtil.isNotEmpty(pluginName)) {
if (ObjectUtil.isNotNull(getTaskPluginId(taskName, pluginName, taskDetails))) {
taskPluginId = getTaskPluginId(taskName, pluginName, taskDetails);
if (s.indexOf("需要模糊查询的信息") == 0) {
fuzzyStart = i + 1;
}
}
//签到字段的id
Long signFieldId = null;
if (StrUtil.isNotEmpty(signName)) {
SigninFieldExample signinFieldExample = new SigninFieldExample();
signinFieldExample.createCriteria().andDescriptionEqualTo(signName);
List<SigninField> fieldList = signinFieldDao.selectByExample(signinFieldExample);
if (CollectionUtil.isNotEmpty(fieldList)) {
signFieldId = fieldList.get(0).getId();
Long taskPluginId = null;
String taskName = null;
String pluginName = null;
List<ProPluginSignin> proPluginSigninList = new ArrayList<>();
for (int i = 2; i < fuzzyStart; i++) {
if (StrUtil.isNotEmpty(ExcelUtil.getCellValue(signSheet.getRow(i).getCell(1)))) {
taskName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(1));
}
}else {
break;
}
if (ObjectUtil.isNull(taskPluginId)) {
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN);
}
if (ObjectUtil.isNull(signFieldId)) {
throw new BaseException(CodeEnum.NOT_SIGN_FIELD);
}
//新建签到字段和插件的关联表
ProPluginSignin proPluginSignin = new ProPluginSignin();
proPluginSignin.setId(snowflake.nextId());
proPluginSignin.setTaskPluginId(taskPluginId);
proPluginSignin.setSigninFieldId(signFieldId);
if(StrUtil.isNotEmpty(isRequired)){
if("是".equalsIgnoreCase(isRequired)){
proPluginSignin.setIsRequired((byte) 1);
}else if("否".equalsIgnoreCase(isRequired)){
proPluginSignin.setIsRequired((byte) 0);
if (StrUtil.isNotEmpty(ExcelUtil.getCellValue(signSheet.getRow(i).getCell(2)))) {
pluginName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(2));
}
}
proPluginSigninList.add(proPluginSignin);
proPluginSigninDao.insertSelective(proPluginSignin);
}
//读取模糊查询的信息
XSSFRow fuzzy = signSheet.getRow(fuzzyStart);
for(int i = 0 ; i<fuzzy.getLastCellNum();i++){
String fieldCell = ExcelUtil.getCellValue(fuzzy.getCell(i));
//获取字段的id
Long signFieldId = null;
if(StrUtil.isNotEmpty(fieldCell)){
SigninFieldExample signinFieldExample = new SigninFieldExample();
signinFieldExample.createCriteria().andDescriptionEqualTo(fieldCell);
List<SigninField> fieldList = signinFieldDao.selectByExample(signinFieldExample);
if (CollectionUtil.isNotEmpty(fieldList)) {
signFieldId = fieldList.get(0).getId();
String signName = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(3));
String isRequired = ExcelUtil.getCellValue(signSheet.getRow(i).getCell(4));
//任务下插件的id
if (StrUtil.isNotEmpty(taskName) && StrUtil.isNotEmpty(pluginName)) {
if (ObjectUtil.isNotNull(getTaskPluginId(taskName, pluginName, taskDetails))) {
taskPluginId = getTaskPluginId(taskName, pluginName, taskDetails);
}
}
//签到字段的id
Long signFieldId = null;
if (StrUtil.isNotEmpty(signName)) {
SigninFieldExample signinFieldExample = new SigninFieldExample();
signinFieldExample.createCriteria().andDescriptionEqualTo(signName);
List<SigninField> fieldList = signinFieldDao.selectByExample(signinFieldExample);
if (CollectionUtil.isNotEmpty(fieldList)) {
signFieldId = fieldList.get(0).getId();
}
} else {
break;
}
if (ObjectUtil.isNull(taskPluginId)) {
throw new BaseException(CodeEnum.WBS_NOT_PLUGIN);
}
if (ObjectUtil.isNull(signFieldId)) {
throw new BaseException(CodeEnum.NOT_SIGN_FIELD);
}
}else {
break;
//新建签到字段和插件的关联表
ProPluginSignin proPluginSignin = new ProPluginSignin();
proPluginSignin.setId(snowflake.nextId());
proPluginSignin.setTaskPluginId(taskPluginId);
proPluginSignin.setSigninFieldId(signFieldId);
if (StrUtil.isNotEmpty(isRequired)) {
if ("是".equalsIgnoreCase(isRequired)) {
proPluginSignin.setIsRequired((byte) 1);
} else if ("否".equalsIgnoreCase(isRequired)) {
proPluginSignin.setIsRequired((byte) 0);
}
}
proPluginSigninList.add(proPluginSignin);
proPluginSigninDao.insertSelective(proPluginSignin);
}
//添加内容
if(ObjectUtil.isNotNull(signFieldId)) {
//修改关联表,将是否模糊搜索改成“是”
for(ProPluginSignin pluginSignin : proPluginSigninList){
if(signFieldId.longValue() == pluginSignin.getSigninFieldId().longValue()){
pluginSignin.setIsFuzzy((byte) 1);
proPluginSigninDao.updateByPrimaryKeySelective(pluginSignin);
break;
//读取模糊查询的信息
XSSFRow fuzzy = signSheet.getRow(fuzzyStart);
for (int i = 0; i < fuzzy.getLastCellNum(); i++) {
String fieldCell = ExcelUtil.getCellValue(fuzzy.getCell(i));
//获取字段的id
Long signFieldId = null;
if (StrUtil.isNotEmpty(fieldCell)) {
SigninFieldExample signinFieldExample = new SigninFieldExample();
signinFieldExample.createCriteria().andDescriptionEqualTo(fieldCell);
List<SigninField> fieldList = signinFieldDao.selectByExample(signinFieldExample);
if (CollectionUtil.isNotEmpty(fieldList)) {
signFieldId = fieldList.get(0).getId();
}
} else {
break;
}
//添加模糊查询内容
for (int j = fuzzyStart + 1; j < signSheet.getLastRowNum(); j++) {
String description = ExcelUtil.getCellValue(signSheet.getRow(j).getCell(i));
if (StrUtil.isNotEmpty(description)) {
ProPluginSigninFuzzy signinFuzzy = new ProPluginSigninFuzzy();
signinFuzzy.setId(snowflake.nextId());
signinFuzzy.setProjectId(projectId);
signinFuzzy.setSigninFieldId(signFieldId);
signinFuzzy.setDescription(description);
pluginSigninFuzzyDao.insertSelective(signinFuzzy);
}else {
break;
//添加内容
if (ObjectUtil.isNotNull(signFieldId)) {
//修改关联表,将是否模糊搜索改成“是”
for (ProPluginSignin pluginSignin : proPluginSigninList) {
if (signFieldId.longValue() == pluginSignin.getSigninFieldId().longValue()) {
pluginSignin.setIsFuzzy((byte) 1);
proPluginSigninDao.updateByPrimaryKeySelective(pluginSignin);
break;
}
}
//添加模糊查询内容
for (int j = fuzzyStart + 1; j < signSheet.getLastRowNum(); j++) {
String description = ExcelUtil.getCellValue(signSheet.getRow(j).getCell(i));
if (StrUtil.isNotEmpty(description)) {
ProPluginSigninFuzzy signinFuzzy = new ProPluginSigninFuzzy();
signinFuzzy.setId(snowflake.nextId());
signinFuzzy.setProjectId(projectId);
signinFuzzy.setSigninFieldId(signFieldId);
signinFuzzy.setDescription(description);
pluginSigninFuzzyDao.insertSelective(signinFuzzy);
} else {
break;
}
}
}
}

25
tall/src/main/java/com/ccsens/tall/web/PluginController.java

@ -17,19 +17,19 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(tags = "插件相关" , description = "")
@Api(tags = "插件相关", description = "")
@RestController
@RequestMapping("/plugins")
public class PluginController {
@Autowired
private ISysPluginService sysPluginService;
@ApiOperation(value = "查询所有插件",notes = "按照优先级倒序+时间正序排序")
@ApiOperation(value = "查询所有插件", notes = "按照优先级倒序+时间正序排序")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PluginVo.PluginInfo>> haveProjectDay(HttpServletRequest request) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<PluginVo.PluginInfo> pluginInfo = sysPluginService.getPluginAll();
return JsonResponse.newInstance().ok(pluginInfo);
@ -37,13 +37,24 @@ public class PluginController {
/**
* 过插件id查询签到的信息
* 过插件id查询签到的信息
*/
@RequestMapping(value = "sign", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PluginVo.PluginSignField> getSignByPlugin( Long taskPluginId) throws Exception {
@RequestMapping(value = "/sign", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public List<PluginVo.PluginSignField> getSignByPlugin(Long taskPluginId) throws Exception {
List<PluginVo.PluginSignField> pluginSignFieldList = sysPluginService.getSignByPlugin(taskPluginId);
return JsonResponse.newInstance().ok(pluginSignFieldList);
return pluginSignFieldList;
}
/**
* 模糊搜索签到字段的信息
*/
@RequestMapping(value = "/fuzzy", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public List<String> getSignFuzzy(Long taskPluginId,String signinName,String key) throws Exception {
List<String> keys = sysPluginService.getSignFuzzy(taskPluginId,signinName,key);
return keys;
}
}

31
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -244,6 +244,36 @@ public class UserController {
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "解绑手机号", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/relievePhone", method = RequestMethod.DELETE, produces = {"application/json;charset=UTF-8"})
public JsonResponse relievePhone(HttpServletRequest request,
@RequestParam String phone) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userService.relievePhone(currentUserId,phone);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "直接更改手机号(不用输入密码)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/changePhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse changePhone(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.WxBindingPhone phoneInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.UserSign userSignVo = userService.changePhoneNotPassword(currentUserId,phoneInfo);
UserVo.TokenBean tokenBean = null;
if (ObjectUtil.isNotNull(userSignVo)) {
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1);
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
tokenBean = userService.getUserInfoAndToken(clientType, userSignVo, theMap);
}
return JsonResponse.newInstance().ok(tokenBean);
}
/*===============================================================================================*/
@ApiOperation(value = "根据token获取userId",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="token",value = "token",required = true,paramType = "query")
@ -273,6 +303,7 @@ public class UserController {
return userId;
}
@ApiOperation(value = "根据token字符串获取userId",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="token",value = "token",required = true,paramType = "query")

13
tall/src/main/resources/mapper_dao/SysPluginDao.xml

@ -31,4 +31,17 @@
WHERE
t.id = #{taskId}
</select>
<select id="selectSignFuzzy" parameterType="java.util.Map" resultType="java.lang.String">
SELECT
description
FROM
`t_pro_plugin_signin_fuzzy`
where
project_id = #{projectId}
and
signin_field_id = #{signFieldId}
and
description like concat('%',#{key},'%')
</select>
</mapper>

3
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -91,7 +91,8 @@ public enum CodeEnum {
ALREADY_BINDING_PHONE(74,"您已绑定过手机号,请勿重复绑定",true),
MERGE_WX_PHONE(75,"该手机号已经注册过账号,是否将账号合并",true),
ALREADY_EXIST_ACCOUNT(76,"该账号已存在",true),
NOT_SIGN_FIELD(77,"签到的字段不可用",true)
NOT_SIGN_FIELD(77,"签到的字段不可用",true),
ALREADY_SIGN(78,"您已经签到过了,请勿重复签到",true)
;
public CodeEnum addMsg(String msg){

Loading…
Cancel
Save