Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
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
base_platform_enterprise
gic-platform-enterprise
Commits
a0d6e3a1
Commit
a0d6e3a1
authored
Apr 10, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
引入json包
parent
4657014e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
13 deletions
+148
-13
pom.xml
gic-platform-enterprise-api/pom.xml
+21
-0
EnterpriseDTO.java
...i/src/main/java/com/gic/enterprise/dto/EnterpriseDTO.java
+80
-0
MarketServiceDTO.java
.../java/com/gic/enterprise/dto/market/MarketServiceDTO.java
+33
-4
EnterpriseApiService.java
...java/com/gic/enterprise/service/EnterpriseApiService.java
+5
-7
EnterpriseApiServiceImpl.java
...terprise/service/outer/impl/EnterpriseApiServiceImpl.java
+2
-1
EnterpriseController.java
...om/gic/operation/web/controller/EnterpriseController.java
+7
-1
No files found.
gic-platform-enterprise-api/pom.xml
View file @
a0d6e3a1
...
@@ -42,6 +42,27 @@
...
@@ -42,6 +42,27 @@
<version>
1.18.0
</version>
<version>
1.18.0
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.12
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<version>
2.6
</version>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<version>
1.7.0
</version>
</dependency>
<dependency>
<groupId>
commons-collections
</groupId>
<artifactId>
commons-collections
</artifactId>
<version>
3.2
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/EnterpriseDTO.java
View file @
a0d6e3a1
...
@@ -111,6 +111,32 @@ public class EnterpriseDTO implements Serializable{
...
@@ -111,6 +111,32 @@ public class EnterpriseDTO implements Serializable{
*/
*/
private
List
<
EnterpriseResourceRelDTO
>
resourcesList
;
private
List
<
EnterpriseResourceRelDTO
>
resourcesList
;
/***超级管理员*/
private
String
userName
;
/**
* 手机号
*/
private
String
phoneNumber
;
/**
* 密码
*/
private
String
password
;
/**
* 1:自动生成 2:自定义密码
*/
private
Integer
passwordType
;
/**
* 确认密码
*/
private
String
confirmPassword
;
/**
* 国际区号,如中国 86
*/
private
String
phoneAreaCode
;
public
Integer
getEnterpriseId
()
{
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
return
enterpriseId
;
}
}
...
@@ -238,4 +264,58 @@ public class EnterpriseDTO implements Serializable{
...
@@ -238,4 +264,58 @@ public class EnterpriseDTO implements Serializable{
public
void
setResourcesList
(
List
<
EnterpriseResourceRelDTO
>
resourcesList
)
{
public
void
setResourcesList
(
List
<
EnterpriseResourceRelDTO
>
resourcesList
)
{
this
.
resourcesList
=
resourcesList
;
this
.
resourcesList
=
resourcesList
;
}
}
public
String
getUserName
()
{
return
userName
;
}
public
EnterpriseDTO
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
return
this
;
}
public
String
getPhoneNumber
()
{
return
phoneNumber
;
}
public
EnterpriseDTO
setPhoneNumber
(
String
phoneNumber
)
{
this
.
phoneNumber
=
phoneNumber
;
return
this
;
}
public
String
getPassword
()
{
return
password
;
}
public
EnterpriseDTO
setPassword
(
String
password
)
{
this
.
password
=
password
;
return
this
;
}
public
Integer
getPasswordType
()
{
return
passwordType
;
}
public
EnterpriseDTO
setPasswordType
(
Integer
passwordType
)
{
this
.
passwordType
=
passwordType
;
return
this
;
}
public
String
getConfirmPassword
()
{
return
confirmPassword
;
}
public
EnterpriseDTO
setConfirmPassword
(
String
confirmPassword
)
{
this
.
confirmPassword
=
confirmPassword
;
return
this
;
}
public
String
getPhoneAreaCode
()
{
return
phoneAreaCode
;
}
public
EnterpriseDTO
setPhoneAreaCode
(
String
phoneAreaCode
)
{
this
.
phoneAreaCode
=
phoneAreaCode
;
return
this
;
}
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/market/MarketServiceDTO.java
View file @
a0d6e3a1
...
@@ -4,12 +4,13 @@ import java.io.Serializable;
...
@@ -4,12 +4,13 @@ import java.io.Serializable;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.beanutils.PropertyUtils
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.CollectionUtil
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
/**
/**
* @ClassName: MarketServiceDTO
* @ClassName: MarketServiceDTO
* @Description: 基础服务订购
* @Description: 基础服务订购
...
@@ -120,7 +121,7 @@ public class MarketServiceDTO implements Serializable{
...
@@ -120,7 +121,7 @@ public class MarketServiceDTO implements Serializable{
}
}
public
List
<
Map
<
String
,
Object
>>
getSkuMapList
()
{
public
List
<
Map
<
String
,
Object
>>
getSkuMapList
()
{
Map
<
String
,
List
<
SkuDTO
>>
skuMap
=
CollectionUtil
.
group
(
skuList
,
"versionCode"
)
;
Map
<
String
,
List
<
SkuDTO
>>
skuMap
=
group
(
skuList
,
"versionCode"
)
;
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>(
skuMap
.
size
());
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>(
skuMap
.
size
());
for
(
Map
.
Entry
<
String
,
List
<
SkuDTO
>>
entry
:
skuMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
SkuDTO
>>
entry
:
skuMap
.
entrySet
())
{
Map
<
String
,
Object
>
tempResult
=
new
HashMap
<>(
16
);
Map
<
String
,
Object
>
tempResult
=
new
HashMap
<>(
16
);
...
@@ -211,4 +212,32 @@ public class MarketServiceDTO implements Serializable{
...
@@ -211,4 +212,32 @@ public class MarketServiceDTO implements Serializable{
JSONObject
json
=
(
JSONObject
)
JSON
.
parse
(
discountDetail
);
JSONObject
json
=
(
JSONObject
)
JSON
.
parse
(
discountDetail
);
return
(
String
)
json
.
get
(
"200"
);
return
(
String
)
json
.
get
(
"200"
);
}
}
public
static
<
K
,
V
>
Map
<
K
,
List
<
V
>>
group
(
List
<
V
>
list
,
String
field
)
{
Map
<
K
,
List
<
V
>>
map
=
new
HashMap
();
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
Object
v
;
Object
sublist
;
for
(
Iterator
var3
=
list
.
iterator
();
var3
.
hasNext
();
((
List
)
sublist
).
add
(
v
))
{
v
=
var3
.
next
();
Object
p
=
null
;
try
{
p
=
PropertyUtils
.
getProperty
(
v
,
field
);
}
catch
(
Exception
var7
)
{
throw
new
RuntimeException
(
var7
.
getMessage
(),
var7
);
}
sublist
=
(
List
)
map
.
get
(
p
);
if
(
sublist
==
null
)
{
sublist
=
new
ArrayList
();
map
.
put
(
p
,
sublist
);
}
}
return
map
;
}
else
{
return
map
;
}
}
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/EnterpriseApiService.java
View file @
a0d6e3a1
package
com
.
gic
.
enterprise
.
service
;
package
com
.
gic
.
enterprise
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.dto.EnterpriseLicenseDTO
;
import
com.gic.enterprise.dto.EnterpriseLicenseDTO
;
import
com.gic.enterprise.dto.EnterpriseListDTO
;
import
com.gic.enterprise.dto.EnterpriseListDTO
;
import
com.gic.enterprise.dto.EnterpriseResourceRelDTO
;
import
com.gic.enterprise.dto.EnterpriseResourceRelDTO
;
import
com.gic.enterprise.dto.market.MarketServiceDTO
;
import
com.gic.enterprise.dto.market.MarketServiceDTO
;
import
com.gic.enterprise.dto.market.OrderBuyLicenseDTO
;
import
com.gic.enterprise.dto.market.OrderGicDTO
;
import
com.gic.enterprise.dto.market.OrderGicDTO
;
import
com.gic.enterprise.qo.BuyForGicQO
;
import
com.gic.enterprise.qo.BuyForGicQO
;
import
com.gic.enterprise.qo.EnterpriseQO
;
import
com.gic.enterprise.qo.EnterpriseQO
;
import
com.gic.enterprise.qo.OrderServiceQO
;
import
com.gic.enterprise.qo.OrderServiceQO
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 商户相关操作
* 商户相关操作
* @ClassName: EnterpriseApiService
* @ClassName: EnterpriseApiService
...
@@ -32,10 +30,10 @@ public interface EnterpriseApiService {
...
@@ -32,10 +30,10 @@ public interface EnterpriseApiService {
* @Description:
* @Description:
* @author guojuxing
* @author guojuxing
* @param enterpriseDTO
* @param enterpriseDTO
* @param
userDTO
* @param
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
*/
ServiceResponse
<
Integer
>
saveEnterprise
(
EnterpriseDTO
enterpriseDTO
,
UserDTO
userDTO
);
ServiceResponse
<
Integer
>
saveEnterprise
(
EnterpriseDTO
enterpriseDTO
);
/**
/**
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/EnterpriseApiServiceImpl.java
View file @
a0d6e3a1
...
@@ -86,7 +86,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
...
@@ -86,7 +86,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ServiceResponse
<
Integer
>
saveEnterprise
(
EnterpriseDTO
enterpriseDTO
,
UserDTO
userDTO
)
{
public
ServiceResponse
<
Integer
>
saveEnterprise
(
EnterpriseDTO
enterpriseDTO
)
{
//valid param
//valid param
ServiceResponse
paramResult
=
ValidUtil
.
allCheckValidate
(
enterpriseDTO
,
ServiceResponse
paramResult
=
ValidUtil
.
allCheckValidate
(
enterpriseDTO
,
EnterpriseDTO
.
SaveEnterpriseValid
.
class
);
EnterpriseDTO
.
SaveEnterpriseValid
.
class
);
...
@@ -142,6 +142,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
...
@@ -142,6 +142,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
//初始化计费中心账户
//初始化计费中心账户
billingAccountService
.
createBillingAccount
(
enterpriseId
);
billingAccountService
.
createBillingAccount
(
enterpriseId
);
UserDTO
userDTO
=
EntityUtil
.
changeEntityNew
(
UserDTO
.
class
,
enterpriseDTO
);
//新增超级管理员
//新增超级管理员
userDTO
.
setEnterpriseId
(
enterpriseId
);
userDTO
.
setEnterpriseId
(
enterpriseId
);
//超级管理员
//超级管理员
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/EnterpriseController.java
View file @
a0d6e3a1
...
@@ -122,7 +122,13 @@ public class EnterpriseController {
...
@@ -122,7 +122,13 @@ public class EnterpriseController {
//密码加密
//密码加密
userDTO
.
setPassword
(
UserPasswordUtil
.
getEncryptPassword
(
password
));
userDTO
.
setPassword
(
UserPasswordUtil
.
getEncryptPassword
(
password
));
//新增商户
//新增商户
ServiceResponse
<
Integer
>
result
=
enterpriseApiService
.
saveEnterprise
(
enterpriseDTO
,
userDTO
);
enterpriseDTO
.
setUserName
(
userDTO
.
getUserName
())
.
setPassword
(
userDTO
.
getPassword
())
.
setConfirmPassword
(
userDTO
.
getConfirmPassword
())
.
setPasswordType
(
userDTO
.
getPasswordType
())
.
setPhoneAreaCode
(
userDTO
.
getPhoneAreaCode
())
.
setPhoneNumber
(
userDTO
.
getPhoneNumber
());
ServiceResponse
<
Integer
>
result
=
enterpriseApiService
.
saveEnterprise
(
enterpriseDTO
);
if
(
result
.
isSuccess
()
&&
UserConstants
.
CREATE_AUTO
==
userDTO
.
getPasswordType
().
intValue
())
{
if
(
result
.
isSuccess
()
&&
UserConstants
.
CREATE_AUTO
==
userDTO
.
getPasswordType
().
intValue
())
{
//发送短信,通知自动生成密码
//发送短信,通知自动生成密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
...
...
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