Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
9a00a84d
Commit
9a00a84d
authored
Oct 27, 2022
by
sxwnfpwx@163.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
3f960321
6b313c3b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
168 additions
and
12 deletions
+168
-12
OrgEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
+1
-1
WorkHistoryMapper.xml
...e-ugp-api/src/main/resources/mapper/WorkHistoryMapper.xml
+3
-0
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+162
-9
InstallNoticeController.java
...ot/module/ugp/biz/controller/InstallNoticeController.java
+2
-2
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/OrgEnum.java
View file @
9a00a84d
...
...
@@ -18,7 +18,7 @@ public enum OrgEnum {
建设单位
(
"CONSTRUCTION"
,
"249"
,
"建设单位"
,
1
),
安装单位
(
"INSTALL"
,
"250"
,
"安装单位"
,
1
),
设计单位
(
"DESIGN"
,
"251"
,
"设计单位"
,
1
),
监察
单位
(
"SUPERVISION"
,
"252"
,
"监察单位
"
,
1
),
监察
部门
(
"SUPERVISION"
,
"252"
,
"监察部门
"
,
1
),
监检机构
(
"MONITORING"
,
"253"
,
"监检机构"
,
1
);
private
String
key
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/WorkHistoryMapper.xml
View file @
9a00a84d
...
...
@@ -23,6 +23,9 @@
<if
test=
"tzUgpWorkHistory.endDate!='' and tzUgpWorkHistory.endDate!=null"
>
and wh.end_date like concat("%",#{tzUgpWorkHistory.endDate},"%")
</if>
<if
test=
"tzUgpWorkHistory.sequenceNbr!='' and tzUgpWorkHistory.sequenceNbr!=null"
>
and wh.sequence_nbr = #{tzUgpWorkHistory.sequenceNbr}
</if>
</where>
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
9a00a84d
...
...
@@ -3,7 +3,19 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.sun.org.apache.xpath.internal.objects.XObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
...
...
@@ -13,8 +25,18 @@ import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.*
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -24,6 +46,9 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
java.util.*
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -62,6 +87,18 @@ public class CompanyController extends BaseController {
@Value
(
"${ugp.sms.tempCode}"
)
private
String
smsTempCode
;
// @Value("${ugp.user.name}")
// private String ugpUserName;
//
// @Value("${ugp.user.pwd}")
// private String ugpUserPwd;
/**
* saveUserRedis设置过期时间
*/
@Value
(
"${redis.cache.failure.time}"
)
private
Long
redisRegionTimeSecond
;
@Autowired
RedisUtils
redisUtils
;
...
...
@@ -230,15 +267,6 @@ public class CompanyController extends BaseController {
return
ResponseHelper
.
buildResponse
(
CompanyTypeEnum
.
mapList
);
}
// /**
// * 企业注册:3、账号信息提交
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @PostMapping(value = "/saveInfo")
// @ApiOperation(httpMethod = "POST", value = "", notes = "")
// public ResponseModel<String> saveInfo(Object object){
// return ResponseHelper.buildResponse(companyServiceImpl.saveInfo(object));
// }
/**
* 获取组织机构树
...
...
@@ -270,6 +298,114 @@ public class CompanyController extends BaseController {
}
/**
* 管理员身份证图片上传 无token
*
* @return
*/
@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
adminLicensePic
)
{
if
(
ValidationUtil
.
isEmpty
(
adminLicensePic
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
RequestContext
.
setToken
(
requestContext
.
getToken
());
FeignClientResult
<
Map
<
String
,
String
>>
date
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
adminLicensePic
);
String
urlString
=
""
;
if
(
date
!=
null
)
{
Map
<
String
,
String
>
map
=
date
.
getResult
();
Iterator
<
String
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
urlString
=
it
.
next
();
}
}
return
ResponseHelper
.
buildResponse
(
urlString
);
}
@Autowired
AmosRequestContext
requestContext
;
// public void setRequestContext() {
// RequestContext.setAppKey("AMOS_STUDIO");
// RequestContext.setProduct("AMOS_STUDIO_WEB");
// RequestContext.setToken(requestContext.getToken());
// // 需要登录后台账号
// RequestContext.setAppKey("AMOS_STUDIO");
// RequestContext.setProduct("AMOS_STUDIO_WEB");
// if(redisUtils.hasKey(RedisKey.CTI_USER_TOKEN)) {
// // 验证token
// boolean validToken = TokenOperation.refresh(redisUtils.get(RedisKey.CTI_USER_TOKEN).toString());
// // 登陆
// if(!validToken) {
// this.loginCtiUser();
// }
// } else { // 登陆
// this.loginCtiUser();
// }
// String ctiToken = redisUtils.get(RedisKey.CTI_USER_TOKEN).toString();
// RequestContext.setToken(ctiToken);
// try {
// FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.queryByUserName(ugpUserName);
// AgencyUserModel userModel = agencyUserModel.getResult();
// RequestContext.setExeUserId(userModel.getUserId());
// saveUserRedis(userModel, ctiToken);
// } catch (Exception e) {
// //删除失效token缓存
// throw new RuntimeException(e.getMessage());
// }
// }
//
// private void loginCtiUser() {
// String passwd = DesUtil.encode(ugpUserPwd, "qaz");
// IdPasswordAuthModel loninData = new IdPasswordAuthModel();
// loninData.setLoginId(ugpUserName);
// loninData.setPassword(passwd);
// FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
// if(loginResult.getStatus() == 200) {
// HashMap resultMap = (HashMap) loginResult.getResult();
// redisUtils.set(RedisKey.CTI_USER_TOKEN, resultMap.get("token").toString(), redisRegionTimeSecond);
// }
// }
//
// private void saveUserRedis(AgencyUserModel user, String token) {
// String authToken = RedisKey.buildReginKey(user.getUserId(), token);
// if (redisUtils.hasKey(authToken)) {
// return;
// }
// CompanyBo company = new CompanyBo();
// DepartmentBo department = new DepartmentBo();
// RoleBo role = new RoleBo();
// CompanyModel companyM = user.getCompanys() != null ? user.getCompanys().get(0) : null ;
// Bean.copyExistPropertis(companyM, company);
// Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
// DepartmentModel departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null ;
// Bean.copyExistPropertis(departmentM, department);
// Map<Long, List<RoleModel>> roles = user.getOrgRoles();
// Long sequenceNbr;
// if (departmentM == null) {
// sequenceNbr = null;
// } else {
// sequenceNbr = departmentM.getSequenceNbr();
// }
// RoleModel roleM = null;
// if (sequenceNbr == null) {
// roleM = companyM != null ?roles.get(companyM.getSequenceNbr()).get(0) : null;
// } else {
// roleM = roles.get(sequenceNbr).get(0);
// }
// Bean.copyExistPropertis(roleM, role);
// ReginParams reginParams = new ReginParams();
// reginParams.setCompany(company);
// reginParams.setRole(role);
// reginParams.setDepartment(department);
// reginParams.setUserModel(user);
// redisUtils.set(authToken, JSONObject.toJSONString(reginParams), redisRegionTimeSecond);
// }
/**
* 判断手机号是否已经注册
*
* @return
...
...
@@ -287,6 +423,23 @@ public class CompanyController extends BaseController {
}
/**
* 判断组织机构是否存在
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/hasExistUnit/{creditCode}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"判断组织机构是否存在"
,
notes
=
"判断组织机构是否存在"
)
public
ResponseModel
<
Boolean
>
hasExistUnit
(
@PathVariable
(
value
=
"creditCode"
)
String
creditCode
)
{
Boolean
flag
=
false
;
Company
company
=
companyServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
Company
>().
eq
(
Company:
:
getCreditCode
,
creditCode
));
if
(!
ValidationUtil
.
isEmpty
(
company
))
{
flag
=
true
;
}
return
ResponseHelper
.
buildResponse
(
flag
);
}
/**
* 发送手机号验证码
*
* @return
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
View file @
9a00a84d
...
...
@@ -255,10 +255,10 @@ public class InstallNoticeController extends BaseController {
public
ResponseModel
<
Boolean
>
deleteBySeq
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
final
String
noticeStatus
=
installNoticeDto
.
getNoticeStatus
();
if
(
noticeStatus
.
equals
(
"已提交"
)||
noticeStatus
.
equals
(
"已保存
"
)){
if
(
!
noticeStatus
.
equals
(
"已接收
"
)){
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
return
null
;
return
ResponseHelper
.
buildResponse
(
false
)
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment