Commit 84c26650 authored by suhuiguang's avatar suhuiguang

1.机器人登录问题处理

parent b3a40168
......@@ -15,7 +15,6 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId>
<version>1.10.8-TZS</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
......
......@@ -97,11 +97,11 @@ public class ControllerAop {
urls.add("/tcm/flc-unit-info/region/tree");
urls.add("/tcm/reg-unit-info/management-unit/tree");
urls.add("/tcm/reg-unit-info/unit-type/list");
urls.add("^/tcm/flc-unit-info/hasExistPhone/[0-9]+$");
urls.add("^/tcm/flc-unit-info/sendTelCode/[0-9]+$");
urls.add("^/tcm/reg-unit-info/[A-Za-z0-9]+/check$");
urls.add("^/tcm/flc-unit-info/verifyTelCode/[A-Za-z0-9]+/[A-Za-z0-9]+");
urls.add("^/tcm/flc-unit-info/hasExistUser/[A-Za-z0-9_-]+");
urls.add("/tcm/flc-unit-info/hasExistPhone/[0-9]+$");
urls.add("/tcm/flc-unit-info/sendTelCode/[0-9]+$");
urls.add("/tcm/reg-unit-info/[A-Za-z0-9]+/check$");
urls.add("/tcm/flc-unit-info/verifyTelCode/[A-Za-z0-9]+/[A-Za-z0-9]+");
urls.add("/tcm/flc-unit-info/hasExistUser/.+");
urls.add("/tcm/reg-unit-info/save");
urls.add("/tcm/reg-unit-info/child-list");
urls.add("/tcm/reg-unit-info/management-unit/tree");
......
......@@ -181,7 +181,6 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId>
<version>${amos.version}</version>
</dependency>
</dependencies>
<build>
......
......@@ -10,7 +10,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.tcm.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tcm.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tcm.flc.api.dto.UnitInfoDto;
......@@ -30,13 +30,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -45,12 +39,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.*;
/**
* 企业信息表
......@@ -84,7 +73,7 @@ public class UnitInfoController extends BaseController {
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
private StartPlatformTokenService platformTokenService;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
......@@ -100,7 +89,7 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.ANONYMOUS, needAuth = false)
@GetMapping(value = "/region/tree")
@ApiOperation(httpMethod = "GET", value = "获取组织机构树", notes = "获取组织机构树")
public ResponseModel<Collection<RegionModel>> getRegionTree(@RequestParam(value = "parentId",required = false) Long parentId) {
public ResponseModel<Collection<RegionModel>> getRegionTree(@RequestParam(value = "parentId", required = false) Long parentId) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getRegionTree(parentId, null));
}
......@@ -118,12 +107,11 @@ public class UnitInfoController extends BaseController {
/**
* 获取全国行政区划树
*
*/
@TycloudOperation(ApiLevel = UserType.ANONYMOUS, needAuth = false)
@GetMapping(value = "/national/region/tree")
@ApiOperation(httpMethod = "GET", value = "获取全国行政区划树", notes = "获取全国行政区划树")
public ResponseModel<Collection<RegionModel>> getNationalRegionTree(@RequestParam(value = "parentId",required = false) Long parentId, @RequestParam(value = "isNationwide",required = false) String isNationwide) {
public ResponseModel<Collection<RegionModel>> getNationalRegionTree(@RequestParam(value = "parentId", required = false) Long parentId, @RequestParam(value = "isNationwide", required = false) String isNationwide) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getRegionTree(parentId, isNationwide));
}
......@@ -140,9 +128,9 @@ public class UnitInfoController extends BaseController {
result = Privilege.companyClient.companyTreeWithoutAuth().getResult();
// 隐藏company 数据
Iterator<CompanyModel> it = result.iterator();
while(it.hasNext()) {
while (it.hasNext()) {
CompanyModel temp = it.next();
if("emergencyCenter".equals(temp.getLevel()) || "company".equals(temp.getLevel())) {
if ("emergencyCenter".equals(temp.getLevel()) || "company".equals(temp.getLevel())) {
it.remove();
} else {
this.dealCompanyTree(temp);
......@@ -152,7 +140,6 @@ public class UnitInfoController extends BaseController {
}
/**
* 企业信息图片上传 无token
*
......@@ -161,18 +148,18 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@PostMapping(value = "/uploadFile")
@ApiOperation(httpMethod = "POST", value = "企业信息图片上传 无token", notes = "企业信息图片上传 无token")
public ResponseModel<String> uploadFile(@ApiParam(value = "文件", required = true)@RequestParam MultipartFile file) {
if (ValidationUtil.isEmpty(file)){
public ResponseModel<String> uploadFile(@ApiParam(value = "文件", required = true) @RequestParam MultipartFile file) {
if (ValidationUtil.isEmpty(file)) {
throw new BadRequest("参数校验失败.");
}
tzsAuthServiceImpl.setRequestContext();
platformTokenService.setRequestContext();
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
String urlString="";
String urlString = "";
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
urlString=it.next();
urlString = it.next();
}
}
return ResponseHelper.buildResponse(urlString);
......@@ -186,11 +173,11 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistUnit/{organizationCode}")
@ApiOperation(httpMethod = "GET", value = "判断组织机构是否存在", notes = "判断组织机构是否存在")
public ResponseModel<Boolean> hasExistUnit( @PathVariable(value = "organizationCode") String organizationCode) {
public ResponseModel<Boolean> hasExistUnit(@PathVariable(value = "organizationCode") String organizationCode) {
Boolean flag = false;
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode).eq(UnitInfo::getUnitStatus,"1").
or().eq(UnitInfo::getIsChange,true).eq(UnitInfo::getOrganizationCode,organizationCode));
if(temp != null) {
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete, false).eq(UnitInfo::getOrganizationCode, organizationCode).eq(UnitInfo::getUnitStatus, "1").
or().eq(UnitInfo::getIsChange, true).eq(UnitInfo::getOrganizationCode, organizationCode));
if (temp != null) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
......@@ -204,17 +191,16 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistUnit/{unitId}/{organizationCode}")
@ApiOperation(httpMethod = "GET", value = "判断组织机构是否存在-更新", notes = "判断组织机构是否存在-更新")
public ResponseModel<Boolean> hasExistUnitWithId( @PathVariable(value = "unitId") Long unitId,@PathVariable(value = "organizationCode") String organizationCode) {
public ResponseModel<Boolean> hasExistUnitWithId(@PathVariable(value = "unitId") Long unitId, @PathVariable(value = "organizationCode") String organizationCode) {
Boolean flag = false;
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode).ne(UnitInfo::getSequenceNbr,unitId).eq(UnitInfo::getUnitStatus,"1").or().eq(UnitInfo::getIsChange,true));
if(temp != null) {
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete, false).eq(UnitInfo::getOrganizationCode, organizationCode).ne(UnitInfo::getSequenceNbr, unitId).eq(UnitInfo::getUnitStatus, "1").or().eq(UnitInfo::getIsChange, true));
if (temp != null) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
}
/**
* 判断用户是否存在
*
......@@ -223,10 +209,10 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistUser/{userName}")
@ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在")
public ResponseModel<Boolean> hasExistUser( @PathVariable(value = "userName") String userName) {
public ResponseModel<Boolean> hasExistUser(@PathVariable(value = "userName") String userName) {
Boolean flag = false;
AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult();
if(user != null ) {
if (user != null) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
......@@ -240,7 +226,7 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/sendTelCode/{tel}")
@ApiOperation(httpMethod = "GET", value = "发送手机号验证码", notes = "发送手机号验证码")
public ResponseModel<Boolean> sendTelCode( @PathVariable(value = "tel") String tel,
public ResponseModel<Boolean> sendTelCode(@PathVariable(value = "tel") String tel,
@RequestParam(value = "type", required = false) String type) {
if (ValidationUtil.isEmpty(tel)) {
throw new BadRequest("参数校验失败.");
......@@ -248,8 +234,8 @@ public class UnitInfoController extends BaseController {
Boolean flag = false;
HashMap<String, String> params = new HashMap<>();
String code = this.getRandomCode();
params.put("code",code);
params.put("mobile",tel);
params.put("code", code);
params.put("mobile", tel);
params.put("smsCode", smsTempCode);
try {
Systemctl.smsClient.sendCommonSms(params).getResult();
......@@ -259,7 +245,7 @@ public class UnitInfoController extends BaseController {
}
String Key = ObjectUtils.isEmpty(type) ? RedisKey.FLC_USER_TEL : adminChange;
// code 保存到缓存中
redisUtils.set(Key + tel, code,time);
redisUtils.set(Key + tel, code, time);
return ResponseHelper.buildResponse(flag);
}
......@@ -279,9 +265,9 @@ public class UnitInfoController extends BaseController {
throw new BadRequest("参数校验失败.");
}
String Key = ObjectUtils.isEmpty(type) ? RedisKey.FLC_USER_TEL : adminChange;
if(redisUtils.hasKey(Key + tel)) {
if (redisUtils.hasKey(Key + tel)) {
String redisCode = redisUtils.get(Key + tel).toString();
if(code.equals(redisCode)) {
if (code.equals(redisCode)) {
flag = true;
}
}
......@@ -293,7 +279,6 @@ public class UnitInfoController extends BaseController {
}
/**
* 新增企业信息表
*
......@@ -315,9 +300,9 @@ public class UnitInfoController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个企业信息表", notes = "根据sequenceNbr查询单个企业信息表")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个企业信息表", notes = "根据sequenceNbr查询单个企业信息表")
public ResponseModel<UnitInfoDto> selectOne(@PathVariable Long sequenceNbr) {
if (ValidationUtil.isEmpty(sequenceNbr) ) {
if (ValidationUtil.isEmpty(sequenceNbr)) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(unitInfoServiceImpl.getUnitDtoById(sequenceNbr));
......@@ -348,7 +333,7 @@ public class UnitInfoController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = unitInfoServiceImpl.page(pageBean, unitInfoQueryWrapper);
int num= unitInfoServiceImpl.count(unitInfoQueryWrapper);
int num = unitInfoServiceImpl.count(unitInfoQueryWrapper);
pageBean.setTotal(num);
IPage<UnitInfoDto> unitInfoVoIPage = BeanDtoVoUtils.unitInfoIPageDto(page);
return ResponseHelper.buildResponse(unitInfoVoIPage);
......@@ -372,67 +357,66 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(ValidationUtil.isEmpty(orgName) ? null : unitInfoDto);
}
private QueryWrapper<UnitInfo> setQueryWrapper(QueryWrapper<UnitInfo> queryWrapper, UnitInfoDto unitInfoDto,String sort) {
private QueryWrapper<UnitInfo> setQueryWrapper(QueryWrapper<UnitInfo> queryWrapper, UnitInfoDto unitInfoDto, String sort) {
queryWrapper.eq("is_delete", false);
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
if (sort != null) { // 排序失效
String[] date = sort.split(",");
if (date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else {
} else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
}
}else {
} else {
queryWrapper.orderByDesc("submit_time");
}
if (!ValidationUtil.isEmpty(unitInfoDto.getIsChange())) { // 分类 注册 / 信息变更 0 注册 1 变更
queryWrapper.eq("is_change",unitInfoDto.getIsChange());
queryWrapper.eq("is_change", unitInfoDto.getIsChange());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeStart())) { // 提交时间
queryWrapper.ge("submit_time",unitInfoDto.getSubmitTimeStart());
if (!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeStart())) { // 提交时间
queryWrapper.ge("submit_time", unitInfoDto.getSubmitTimeStart());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeEnd())) { // 提交时间
queryWrapper.le("submit_time",unitInfoDto.getSubmitTimeEnd());
if (!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeEnd())) { // 提交时间
queryWrapper.le("submit_time", unitInfoDto.getSubmitTimeEnd());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getUnitTypeCode())) { // 单位类型
queryWrapper.like("unit_type_code",unitInfoDto.getUnitTypeCode());
if (!ValidationUtil.isEmpty(unitInfoDto.getUnitTypeCode())) { // 单位类型
queryWrapper.like("unit_type_code", unitInfoDto.getUnitTypeCode());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getOrgName())) { // 单位名称
queryWrapper.like("org_name",unitInfoDto.getOrgName());
if (!ValidationUtil.isEmpty(unitInfoDto.getOrgName())) { // 单位名称
queryWrapper.like("org_name", unitInfoDto.getOrgName());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getOrganizationCode())) { // 组织机构代码/统一信用代码
queryWrapper.like("organization_code",unitInfoDto.getOrganizationCode());
if (!ValidationUtil.isEmpty(unitInfoDto.getOrganizationCode())) { // 组织机构代码/统一信用代码
queryWrapper.like("organization_code", unitInfoDto.getOrganizationCode());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getAdminName())) { // 管理员
queryWrapper.like("admin_name",unitInfoDto.getAdminName());
if (!ValidationUtil.isEmpty(unitInfoDto.getAdminName())) { // 管理员
queryWrapper.like("admin_name", unitInfoDto.getAdminName());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getAdminTel())) { // 管理员电话
queryWrapper.like("admin_tel",unitInfoDto.getAdminTel());
if (!ValidationUtil.isEmpty(unitInfoDto.getAdminTel())) { // 管理员电话
queryWrapper.like("admin_tel", unitInfoDto.getAdminTel());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getUnitStatus())) { // 审核状态
queryWrapper.eq("unit_status",unitInfoDto.getUnitStatus());
if (!ValidationUtil.isEmpty(unitInfoDto.getUnitStatus())) { // 审核状态
queryWrapper.eq("unit_status", unitInfoDto.getUnitStatus());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getLegalPerson())) { // 法人
queryWrapper.like("legal_person",unitInfoDto.getLegalPerson());
if (!ValidationUtil.isEmpty(unitInfoDto.getLegalPerson())) { // 法人
queryWrapper.like("legal_person", unitInfoDto.getLegalPerson());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getLegalPersonTel())) { // 法人电话
queryWrapper.like("legal_person_tel",unitInfoDto.getLegalPersonTel());
if (!ValidationUtil.isEmpty(unitInfoDto.getLegalPersonTel())) { // 法人电话
queryWrapper.like("legal_person_tel", unitInfoDto.getLegalPersonTel());
}
return queryWrapper;
}
private String getRandomCode(){
private String getRandomCode() {
String code = "";
Random random = new Random();
for (int i = 0; i < 6; i++) {
......@@ -467,22 +451,23 @@ public class UnitInfoController extends BaseController {
/**
* 根据当前登录人获取企业信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserUnit")
@ApiOperation(httpMethod = "GET",value = "根据当前登录人获取企业信息", notes = "根据当前登录人获取企业信息")
@ApiOperation(httpMethod = "GET", value = "根据当前登录人获取企业信息", notes = "根据当前登录人获取企业信息")
public ResponseModel<UnitInfoDto> getUserUnit() {
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
List<CompanyModel> companys = user.getCompanys();
UnitInfoDto result = new UnitInfoDto();
for(CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getAmosOrgId,c.getSequenceNbr()));
if(temp != null) {
for (CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete, false).eq(OrgUsr::getAmosOrgId, c.getSequenceNbr()));
if (temp != null) {
// 企业信息查看判断是否变更 如果变更信息则返回变更中信息
result = unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr());
if(result.getIsChange() && result.getUnitStatus() == 0) {
if (result.getIsChange() && result.getUnitStatus() == 0) {
result = unitInfoChangeServiceImpl.findLastChangInfo(result.getSequenceNbr());
}
......@@ -517,9 +502,9 @@ public class UnitInfoController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/approve/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "查询审批数据", notes = "查询审批数据")
@ApiOperation(httpMethod = "GET", value = "查询审批数据", notes = "查询审批数据")
public ResponseModel<UnitInfoDto> getApproveInfo(@PathVariable Long sequenceNbr) {
if (ValidationUtil.isEmpty(sequenceNbr) ) {
if (ValidationUtil.isEmpty(sequenceNbr)) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoById(sequenceNbr));
......@@ -545,7 +530,7 @@ public class UnitInfoController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "获取使用单位列表", notes = "获取使用单位列表")
public ResponseModel<List<UnitInfoDto>> getUseUnit(@RequestBody UnitInfoDto model) {
List<UnitInfoDto> result = unitInfoServiceImpl.getUseUnit(model.getUnitType(),model.getAddress(),model.getOrgName(),model.getOrganizationCode());
List<UnitInfoDto> result = unitInfoServiceImpl.getUseUnit(model.getUnitType(), model.getAddress(), model.getOrgName(), model.getOrganizationCode());
return ResponseHelper.buildResponse(result);
}
......@@ -561,7 +546,6 @@ public class UnitInfoController extends BaseController {
}
/**
* 列表分页查询
*
......@@ -586,7 +570,7 @@ public class UnitInfoController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = unitInfoServiceImpl.page(pageBean, unitInfoQueryWrapper);
int num= unitInfoServiceImpl.count(unitInfoQueryWrapper);
int num = unitInfoServiceImpl.count(unitInfoQueryWrapper);
pageBean.setTotal(num);
IPage<UnitInfoDto> unitInfoVoIPage = BeanDtoVoUtils.unitInfoIPageDto(page);
return ResponseHelper.buildResponse(unitInfoVoIPage);
......@@ -600,7 +584,7 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistPhone/{phone}")
@ApiOperation(httpMethod = "GET", value = "判断用户号码是否存在", notes = "判断用户号码是否存在")
public ResponseModel hasExistPhone( @PathVariable(value = "phone") String phone) {
public ResponseModel hasExistPhone(@PathVariable(value = "phone") String phone) {
try {
return CommonResponseUtil.success(Privilege.agencyUserClient.checkLoginId(phone).getResult());
} catch (Exception e) {
......@@ -623,21 +607,21 @@ public class UnitInfoController extends BaseController {
}
/**
* 根据当前登录人获取企业信息--编辑
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserUnitEdit")
@ApiOperation(httpMethod = "GET",value = "根据当前登录人获取企业信息--编辑", notes = "根据当前登录人获取企业信息--编辑")
@ApiOperation(httpMethod = "GET", value = "根据当前登录人获取企业信息--编辑", notes = "根据当前登录人获取企业信息--编辑")
public ResponseModel<UnitInfoDto> getUserUnitEdit() {
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
List<CompanyModel> companys = user.getCompanys();
UnitInfoDto result = new UnitInfoDto();
for(CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getAmosOrgId,c.getSequenceNbr()));
if(temp != null) {
for (CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete, false).eq(OrgUsr::getAmosOrgId, c.getSequenceNbr()));
if (temp != null) {
// 企业信息查看判断是否变更 如果变更信息则返回变更中信息
result = unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr());
return ResponseHelper.buildResponse(result);
......@@ -654,9 +638,9 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUnitInfo/{uuid}")
@ApiOperation(httpMethod = "GET", value = "根据uuid 获取注册信息", notes = "根据uuid 获取注册信息")
public ResponseModel hasExistUnitWithId( @PathVariable String uuid) {
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getCallbackId,uuid).eq(UnitInfo::getUnitStatus,"2"));
if(temp != null) {
public ResponseModel hasExistUnitWithId(@PathVariable String uuid) {
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete, false).eq(UnitInfo::getCallbackId, uuid).eq(UnitInfo::getUnitStatus, "2"));
if (temp != null) {
return CommonResponseUtil.success(temp);
} else {
return CommonResponseUtil.failure("未找到该企业信息单,请确认链接地址或该单据已重新提交");
......@@ -665,14 +649,14 @@ public class UnitInfoController extends BaseController {
private void dealCompanyTree(CompanyModel company) {
if(!"emergencyCenter".equals(company.getLevel()) && !"company".equals(company.getLevel())) {
if (!"emergencyCenter".equals(company.getLevel()) && !"company".equals(company.getLevel())) {
// 判断子节点是否是headquarter
Collection children = company.getChildren();
if (!ValidationUtil.isEmpty(children)) {
Iterator<Map> it = children.iterator();
while(it.hasNext()) {
while (it.hasNext()) {
Map temp = it.next();
if("emergencyCenter".equals(company.getLevel()) || "company".equals(company.getLevel())) {
if ("emergencyCenter".equals(company.getLevel()) || "company".equals(company.getLevel())) {
it.remove();
} else {
this.dealCompanyTree(temp);
......@@ -681,14 +665,15 @@ public class UnitInfoController extends BaseController {
}
}
}
private void dealCompanyTree(Map company) {
// 判断子节点是否是headquarter
Collection children = (Collection) company.get("children");
if (!ValidationUtil.isEmpty(children)) {
Iterator<Map> it = children.iterator();
while(it.hasNext()) {
while (it.hasNext()) {
Map temp = it.next();
if("emergencyCenter".equals(temp.get("level")) || "company".equals(temp.get("level"))) {
if ("emergencyCenter".equals(temp.get("level")) || "company".equals(temp.get("level"))) {
it.remove();
} else {
this.dealCompanyTree(temp);
......
......@@ -19,7 +19,7 @@ import com.yeejoin.amos.boot.module.tcm.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.tcm.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tcm.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.WechatRelationServiceImpl;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.WechatServiceImpl;
import com.yeejoin.amos.boot.module.tcm.biz.utils.JsonUtils;
......@@ -73,7 +73,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
private Resource stepRegin;
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
private StartPlatformTokenService platformTokenService;
@Autowired
ISourceFileService ISourceFileService;
......@@ -115,7 +115,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
@Transactional
public UnitInfoDto saveUnitInfo(UnitInfoDto model) {
tzsAuthServiceImpl.setRequestContext();
platformTokenService.setRequestContext();
model.setUnitStatus(0);// 设置为待审核状态
model.setSubmitTime(new Date()); // 提交时间
model.setIsChange(false);// 新增状态不是变更状态
......@@ -650,7 +650,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
@Override
public Collection<RegionModel> getRegionTree(Long parentId, String isNationwide) {
tzsAuthServiceImpl.setRequestContext();
platformTokenService.setRequestContext();
Collection<RegionModel> result = null;
if(parentId == null) {
result = this.getAllRegionTree(isNationwide);
......
......@@ -76,7 +76,6 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-security</artifactId>
<version>${amos.version.tzs}</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
......
......@@ -251,7 +251,7 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-workflow</artifactId>
<version>1.10.8</version>
<version>${amos.version}</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
......
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