|
@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import static com.dgtly.common.utils.bean.EnDecoderUtil.DESdecode;
|
|
import static com.dgtly.common.utils.bean.EnDecoderUtil.DESdecode;
|
|
@@ -492,37 +493,44 @@ public class WxController extends ApiBaseController {
|
|
|
@ApiImplicitParam(name = "params" , paramType = "body")
|
|
@ApiImplicitParam(name = "params" , paramType = "body")
|
|
|
})
|
|
})
|
|
|
@PostMapping("/getUserByPassWord")
|
|
@PostMapping("/getUserByPassWord")
|
|
|
- public Object getUserByPassWord(){
|
|
|
|
|
- ParameterObject obj = getParameterObject();
|
|
|
|
|
|
|
+ public Object getUserByPassWord() {
|
|
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
obj.checkParameterNotNull("username,password");
|
|
obj.checkParameterNotNull("username,password");
|
|
|
String username = obj.getString("username");
|
|
String username = obj.getString("username");
|
|
|
String password = obj.getString("password");
|
|
String password = obj.getString("password");
|
|
|
- String logintype=obj.getString("logintype");
|
|
|
|
|
SysUser user = sysUserService.selectUserByLoginName(username);
|
|
SysUser user = sysUserService.selectUserByLoginName(username);
|
|
|
- //通过字典判断 logintype 查询客户需要传值类型
|
|
|
|
|
- if(StringUtils.isNotBlank(logintype)){
|
|
|
|
|
- List<Map<String,Object>> loginType= jdbcTemplate.queryForList("select dict_value from sys_dict_data where dict_type='' and ",);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(user==null){
|
|
|
|
|
- return AjaxResult.error(302,"查无此人");
|
|
|
|
|
|
|
+ if (user == null) {
|
|
|
|
|
+ return AjaxResult.error(302, "查无此人");
|
|
|
}
|
|
}
|
|
|
- String pass = EncryptPassWordClass.encryptPassword(user.getLoginName(),password,user.getSalt());
|
|
|
|
|
- if(pass.equals(user.getPassword())){
|
|
|
|
|
- List<Ztree> author = sysUserOrderAuthorService.userAuthorTreeDataFmt(user.getUserId());
|
|
|
|
|
- if (author.size() > 0 && author.get(0).getChildren().size() > 1) {
|
|
|
|
|
- user.setAuthorType("TUC");
|
|
|
|
|
- } else if (author.size() > 0 && author.get(0).getChildren().size() == 1) {//设置BUSINESS_UNIT
|
|
|
|
|
- user.setAuthorType(author.get(0).getChildren().get(0).getCode());
|
|
|
|
|
- }else{
|
|
|
|
|
- user.setAuthorType("DIY");//默认diy
|
|
|
|
|
|
|
+ String pass = EncryptPassWordClass.encryptPassword(user.getLoginName(), password, user.getSalt());
|
|
|
|
|
+ if (pass.equals(user.getPassword())) {
|
|
|
|
|
+ List<Map<String, Object>> loginTypeList = jdbcTemplate.queryForList("select dict_label,dict_value from sys_dict_data where dict_type='system_login_type' ");
|
|
|
|
|
+ if ("1".equals(user.getIsShopAccount())) {
|
|
|
|
|
+ List<Map<String, Object>> result = new ArrayList<>();
|
|
|
|
|
+ for (int i = 0; i < loginTypeList.size(); i++) {
|
|
|
|
|
+ ConcurrentHashMap m = new ConcurrentHashMap<>();
|
|
|
|
|
+ m.put("shopType", loginTypeList.get(i).get("dict_label"));
|
|
|
|
|
+ m.put("shopTypeValue", loginTypeList.get(i).get("dict_value"));
|
|
|
|
|
+ List<Map<String, Object>> shopList = jdbcTemplate.queryForList("select shop_code,shop_name,sales_level from sys_user_shop_ext where user_id=? and is_shop_type=? and del_flag='0'", user.getUserId(), loginTypeList.get(i).get("dict_value"));
|
|
|
|
|
+ m.put("shopList", shopList);
|
|
|
|
|
+ result.add(m);
|
|
|
|
|
+ }
|
|
|
|
|
+ user.setLoginTypeList(result);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Ztree> author = sysUserOrderAuthorService.userAuthorTreeDataFmt(user.getUserId());
|
|
|
|
|
+ if (author.size() > 0 && author.get(0).getChildren().size() > 1) {
|
|
|
|
|
+ user.setAuthorType("TUC");
|
|
|
|
|
+ } else if (author.size() > 0 && author.get(0).getChildren().size() == 1) {//设置BUSINESS_UNIT
|
|
|
|
|
+ user.setAuthorType(author.get(0).getChildren().get(0).getCode());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ user.setAuthorType("DIY");//默认diy
|
|
|
|
|
+ }
|
|
|
|
|
+ user.setAuthor(author);
|
|
|
|
|
+ return AjaxResult.success().putKV("sysUser", user);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return AjaxResult.error(301, "密码错误");
|
|
|
}
|
|
}
|
|
|
- user.setAuthor(author);
|
|
|
|
|
- return AjaxResult.success().putKV("sysUser",user);
|
|
|
|
|
- }else{
|
|
|
|
|
- return AjaxResult.error(301,"密码错误");
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "JS-SDK使用权限签名算法", notes = "参数:agent,非必填值为1获取应用签名, 否则获取企业签名")
|
|
@ApiOperation(value = "JS-SDK使用权限签名算法", notes = "参数:agent,非必填值为1获取应用签名, 否则获取企业签名")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|