Commit 84c26650 authored by suhuiguang's avatar suhuiguang

1.机器人登录问题处理

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