| | |
| | | import com.doumee.config.DataSyncConfig; |
| | | 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.OrgAddRequest; |
| | | import com.doumee.core.haikang.model.param.request.OrgDelRequest; |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,组织类型不正确,请按要求填写~"); |
| | | } |
| | | //查询名称不能重复 |
| | | if(companyMapper.selectCount(new QueryWrapper<Company>().lambda() |
| | | /* if(companyMapper.selectCount(new QueryWrapper<Company>().lambda() |
| | | .eq(Company::getName,company.getName()) |
| | | .eq(Company::getIsdeleted,Constants.ZERO)) >0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,组织名称不能重复~"); |
| | | } |
| | | }*/ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user ==null){ |
| | | user = company.getLoginUserInfo(); |
| | |
| | | List<OrgAddRequest> addList = new ArrayList<>(); |
| | | addList.add(getOrgAddModel(company)); |
| | | BaseResponse<OrgOrUserAddResponse> result = HKService.addBatchOrg(addList); |
| | | if(result !=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE)){ |
| | | if(result !=null && StringUtils.equals(result.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | OrgOrUserAddResponse data = result.getData(); |
| | | if(data.getSuccesses()!=null && data.getSuccesses().size()>0){ |
| | | //处理新增成功的数据,修改海康同步状态 |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,组织类型不正确,请按要求填写~"); |
| | | } |
| | | //查询名称不能重复 |
| | | if(companyMapper.selectCount(new QueryWrapper<Company>().lambda() |
| | | /* if(companyMapper.selectCount(new QueryWrapper<Company>().lambda() |
| | | .eq(Company::getName,company.getName()) |
| | | .ne(Company::getId,company.getId()) |
| | | .eq(Company::getIsdeleted,Constants.ZERO)) >0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,组织名称不能重复~"); |
| | | } |
| | | }*/ |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user == null){ |
| | | user = company.getLoginUserInfo(); |