| | |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.UserAddRequest; |
| | | import com.doumee.core.haikang.model.param.request.UserDelRequest; |
| | |
| | | if(dealHkUserBiz(insert)){ |
| | | memberMapper.insert(insert); |
| | | //创建系统登陆账号(默认无任何角色) |
| | | if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){ |
| | | // if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){ |
| | | //如果是内部组织人员,新增系统登陆账号 |
| | | systemUserMapper.insert(createSystemUser(insert,systemDictDataBiz)); |
| | | //处理培训有效期业务 |
| | | dealTrainTIme(member,0,loginUserInfo); |
| | | } |
| | | // } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息同步安防平台失败,请稍后重试!"); |
| | | } |
| | | }catch (Exception e){ |
| | | //如果发生异常,删除已经创建的人员信息 |
| | | e.printStackTrace(); |
| | | deleteHkUserBiz(new String[]{insert.getHkId()}); |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息新建失败,请稍后重试!"); |
| | | } |
| | |
| | | } |
| | | //处理新增数据 |
| | | BaseResponse<UserAddResponse> result = HKService.addUser(hkAddRequest); |
| | | if(result!=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE) && result.getData()!=null){ |
| | | if(result!=null && StringUtils.equals(result.getCode(), HKConstants.RESPONSE_SUCCEE) && result.getData()!=null){ |
| | | insert.setHkId(hkAddRequest.getPersonId()); |
| | | insert.setFaceId(result.getData().getFaceId()); |
| | | if(StringUtils.isNotBlank(insert.getFaceId())){ |
| | |
| | | List<SystemUser> userList = new ArrayList<>(); |
| | | for(Member insert: newList){ |
| | | //创建系统登陆账号(默认无任何角色) |
| | | if(Constants.equalsInteger(insert.getCompanyType(),Constants.ONE)){ |
| | | // if(Constants.equalsInteger(insert.getCompanyType(),Constants.ONE)){ |
| | | //如果是内部组织人员,新增系统登陆账号 |
| | | userList.add(createSystemUser(insert,systemDictDataBiz)); |
| | | } |
| | | // } |
| | | } |
| | | if(userList.size()>0){ |
| | | systemUserMapper.insert(userList); |