| | |
| | | public static final String OWNER_APP_APP_ID = "992020061440050003"; // app微信支付 |
| | | public static final String JOB_APP_ID = "992021061746360004"; // 定时任务应用 |
| | | |
| | | public static final String PROPERTY_APP = "992020022270580001";// 物业员工app |
| | | |
| | | |
| | | private String appId; |
| | | private String[] appIds; |
| | |
| | | |
| | | private String storeName; |
| | | |
| | | private String storeTypeCd; |
| | | |
| | | |
| | | |
| | | public String getUserId() { |
| | |
| | | public void setStoreName(String storeName) { |
| | | this.storeName = storeName; |
| | | } |
| | | |
| | | public String getStoreTypeCd() { |
| | | return storeTypeCd; |
| | | } |
| | | |
| | | public void setStoreTypeCd(String storeTypeCd) { |
| | | this.storeTypeCd = storeTypeCd; |
| | | } |
| | | } |
| | |
| | | <select id="getStaffs" parameterType="Map" resultType="Map"> |
| | | select u.user_id, u.user_id userId,u.name,u.name |
| | | userName,u.email,u.address,u.location_cd,u.location_cd locationCd, |
| | | u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,su.rel_cd relCd,td.name relCdName,ua.value idCard,s.name storeName |
| | | u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,su.rel_cd relCd,td.name relCdName,ua.value idCard, |
| | | s.name storeName,s.store_type_cd storeTypeCd |
| | | <if test="orgId !=null and orgId != ''"> |
| | | ,uo.org_id orgId,uo.org_name,uo.org_name orgName,uosr.store_id storeId,uosr.rel_id relId |
| | | </if> |
| | |
| | | and uosr.status_cd =0 |
| | | GROUP BY u.user_id,u.name,u.email,u.address,u.location_cd, |
| | | u.age,u.sex,u.tel,u.level_cd ,u.b_id,su.rel_cd ,td.name |
| | | ,uo.org_id,uo.org_name,uosr.store_id,uosr.rel_id,ua.value,s.name |
| | | ,uo.org_id,uo.org_name,uosr.store_id,uosr.rel_id,ua.value, |
| | | s.name,s.store_type_cd |
| | | </if> |
| | | order by u.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | |
| | | // } |
| | | String authorization = request.getHeader("Authorization"); |
| | | |
| | | if(StringUtil.isEmpty(token) && !StringUtil.isEmpty(authorization)){ |
| | | if( StringUtil.isEmpty(authorization)){ |
| | | return token; |
| | | } |
| | | if(authorization.length()> 7) { |
| | | token = authorization.substring("Bearer ".length()); |
| | | } |
| | | |
| | | return token; |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.app.AppDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.dto.user.UserLoginDto; |
| | |
| | | Assert.hasKeyAndValue(reqJson, "passwd", "用户登录,未包含passwd节点,请检查"); |
| | | |
| | | AuthenticationFactory.checkLoginErrorCount(reqJson.getString("username")); |
| | | |
| | | String appId = CmdContextUtils.getAppId(cmdDataFlowContext); |
| | | if(AppDto.PROPERTY_APP.equals(appId)){ |
| | | reqJson.put("passwd", AuthenticationFactory.passwdMd5(reqJson.getString("passwd"))); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | ResponseEntity responseEntity = null; |
| | | JSONObject paramInJson = JSONObject.parseObject(cmdDataFlowContext.getReqData()); |
| | | //根据AppId 查询 是否有登录的服务,查询登录地址调用 |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setName(paramInJson.getString("username")); |
| | | userDto.setPassword(paramInJson.getString("passwd")); |
| | | userDto.setName(reqJson.getString("username")); |
| | | userDto.setPassword(reqJson.getString("passwd")); |
| | | userDto.setLevelCds(new String[]{UserDto.LEVEL_CD_ADMIN, UserDto.LEVEL_CD_STAFF}); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | if (ListUtil.isNull(userDtos)) { |
| | | userDto.setName(""); |
| | | userDto.setTel(paramInJson.getString("username")); |
| | | userDto.setTel(reqJson.getString("username")); |
| | | userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | } |
| | | if (ListUtil.isNull(userDtos)) { |
| | | responseEntity = new ResponseEntity<String>("用户或密码错误", HttpStatus.UNAUTHORIZED); |
| | | AuthenticationFactory.userLoginError(paramInJson.getString("username")); |
| | | AuthenticationFactory.userLoginError(reqJson.getString("username")); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | return; |
| | | } |