Commit 4c9e28eb authored by libin's avatar libin

Merge remote-tracking branch 'origin/dev' into dev

parents 509d2f0f d5ae965d
...@@ -174,6 +174,13 @@ public class AuthController { ...@@ -174,6 +174,13 @@ public class AuthController {
return data; return data;
} }
@RequestMapping(value = "other/sendsms", method = RequestMethod.GET)
public JSONObject otherSendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type)throws Exception{
log.info(username+"----require sendsms...");
return appAuthService.sendsms(username,type);
}
@RequestMapping(value = "/otherLogin", method = RequestMethod.POST) @RequestMapping(value = "/otherLogin", method = RequestMethod.POST)
public JSONObject otherLogin(@RequestBody Map<String,Object> params)throws Exception{ public JSONObject otherLogin(@RequestBody Map<String,Object> params)throws Exception{
log.info("----require otherLogin..."); log.info("----require otherLogin...");
...@@ -188,8 +195,14 @@ public class AuthController { ...@@ -188,8 +195,14 @@ public class AuthController {
if(result==null){ if(result==null){
data.put("status",1001); data.put("status",1001);
}else { }else {
Integer positionId=result.getInteger("positionId")==null?0:result.getInteger("positionId");
if (positionId==4 || positionId==1 || positionId==2 || positionId==3){
String token=appAuthService.getToken(username,result.getInteger("userId")); String token=appAuthService.getToken(username,result.getInteger("userId"));
data.put("token",token); data.put("token",token);
}else {
data.put("status",ResultCode.FAILED_CODE);
data.put("message","登录失败");
}
} }
} }
return data; return data;
......
...@@ -50,7 +50,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro ...@@ -50,7 +50,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation("修改") @ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT) @RequestMapping(value = "/{id}",method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public ObjectRestResponse<Entity> update(@RequestBody Entity entity){ public ObjectRestResponse<Entity> update(@RequestBody Entity entity) throws Exception {
baseBiz.updateSelectiveById(entity); baseBiz.updateSelectiveById(entity);
return new ObjectRestResponse<Entity>(); return new ObjectRestResponse<Entity>();
} }
......
...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; ...@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -13,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -48,9 +48,12 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -48,9 +48,12 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
@PostMapping(value = "") @PostMapping(value = "")
public ObjectRestResponse<AppStaffUser> add(@RequestBody AppStaffUser appStaffUser) throws Exception { public ObjectRestResponse<AppStaffUser> add(@RequestBody AppStaffUser appStaffUser) throws Exception {
AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData(); AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData();
if (appStaffUser.getPhone().equals(userDTO.getUsername())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"不能绑定本人为客户");
}
appStaffUser.setSuId(userDTO.getUserid()); appStaffUser.setSuId(userDTO.getUserid());
baseBiz.insertSelective(appStaffUser); baseBiz.insertSelective(appStaffUser);
return new ObjectRestResponse<AppStaffUser>(); return ObjectRestResponse.succ();
} }
@ApiOperation("查询一条") @ApiOperation("查询一条")
...@@ -74,4 +77,17 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS ...@@ -74,4 +77,17 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
@Override
@ApiOperation("修改")
@RequestMapping(value = "/{id}",method = RequestMethod.PUT)
@ResponseBody
public ObjectRestResponse update(@RequestBody AppStaffUser appStaffUser) throws Exception {
AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData();
if (appStaffUser.getPhone().equals(userDTO.getUsername())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"不能绑定本人为客户");
}
baseBiz.updateSelectiveById(appStaffUser);
return ObjectRestResponse.succ();
}
} }
...@@ -194,7 +194,7 @@ public class AppPermissionService { ...@@ -194,7 +194,7 @@ public class AppPermissionService {
} }
// String sms = PassportUtil.SendSMS(phone, SystemConfig.SENDSMS_TITLE); // String sms = PassportUtil.SendSMS(phone, SystemConfig.SENDSMS_TITLE);
String mobilecode = null; String mobilecode = null;
JSONObject data = thirdFeign.send("13265487972"); JSONObject data = thirdFeign.send(phone);
if (data != null && data.getInteger("status") == ResultCode.SUCCESS_CODE) { if (data != null && data.getInteger("status") == ResultCode.SUCCESS_CODE) {
mobilecode = data.getString("data"); mobilecode = data.getString("data");
} }
...@@ -444,6 +444,7 @@ public class AppPermissionService { ...@@ -444,6 +444,7 @@ public class AppPermissionService {
data.put("userId", userid); data.put("userId", userid);
data.put("imUserId", userVo.getImUserid()); data.put("imUserId", userVo.getImUserid());
data.put("code", userVo.getCode()); data.put("code", userVo.getCode());
data.put("positionId", userVo.getPositionId());
//更新登录时间 和 ip //更新登录时间 和 ip
String clientIp = getIp(); String clientIp = getIp();
appUserLoginBiz.updateLoginInfo(userid, clientIp); appUserLoginBiz.updateLoginInfo(userid, clientIp);
......
...@@ -150,7 +150,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act ...@@ -150,7 +150,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper, Act
activityPopularizeUser.setCurrentProgress(bigDecimal); activityPopularizeUser.setCurrentProgress(bigDecimal);
popularizeUserBiz.updateSelectiveById(activityPopularizeUser); popularizeUserBiz.updateSelectiveById(activityPopularizeUser);
//任务没有完成 //任务没有完成
if (SYS_TRUE.equals(activityPopularizeUser.getStatus())) { if (!SYS_TRUE.equals(activityPopularizeUser.getStatus())) {
// AwardDTO awardDTO = JSONUtil.toBean(activityPopularize.getValue(), AwardDTO.class); // AwardDTO awardDTO = JSONUtil.toBean(activityPopularize.getValue(), AwardDTO.class);
//检查是否满足奖励 //检查是否满足奖励
if (relationBiz.selectList(new ActivityPopularizeRelation() {{ if (relationBiz.selectList(new ActivityPopularizeRelation() {{
......
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