Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
1f76630d
Commit
1f76630d
authored
Feb 12, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
95194de3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
1 deletions
+98
-1
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+6
-0
DepartmentMapper.java
...ic/haoban/manage/service/dao/mapper/DepartmentMapper.java
+3
-0
DepartmentService.java
.../gic/haoban/manage/service/service/DepartmentService.java
+2
-0
DepartmentApiServiceImpl.java
...manage/service/service/impl/DepartmentApiServiceImpl.java
+6
-0
DepartmentServiceImpl.java
...anage/service/service/out/impl/DepartmentServiceImpl.java
+6
-0
DepartmentMapper.xml
...e3-service/src/main/resources/mapper/DepartmentMapper.xml
+9
-0
DepartmentContoller.java
...gic/haoban/manage/web/controller/DepartmentContoller.java
+46
-1
DepartmentAddQO.java
...in/java/com/gic/haoban/manage/web/qo/DepartmentAddQO.java
+20
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
1f76630d
...
@@ -32,5 +32,11 @@ public interface DepartmentApiService {
...
@@ -32,5 +32,11 @@ public interface DepartmentApiService {
* @return
* @return
*/
*/
HaobanResponse
del
(
String
departmentId
);
HaobanResponse
del
(
String
departmentId
);
/**
* 根据关联id 获取部门
* @param departId
* @return
*/
DepartmentDTO
selectByRelatedId
(
String
departId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DepartmentMapper.java
View file @
1f76630d
...
@@ -22,4 +22,6 @@ public interface DepartmentMapper {
...
@@ -22,4 +22,6 @@ public interface DepartmentMapper {
List
<
TabHaobanDepartment
>
listByParentId
(
@Param
(
"parentId"
)
String
parentId
);
List
<
TabHaobanDepartment
>
listByParentId
(
@Param
(
"parentId"
)
String
parentId
);
int
selectMaxSort
(
@Param
(
"parentDepartmentId"
)
String
parentDepartmentId
);
int
selectMaxSort
(
@Param
(
"parentDepartmentId"
)
String
parentDepartmentId
);
TabHaobanDepartment
selectByRelatedId
(
@Param
(
"relatedId"
)
String
relatedId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/DepartmentService.java
View file @
1f76630d
...
@@ -17,4 +17,6 @@ public interface DepartmentService {
...
@@ -17,4 +17,6 @@ public interface DepartmentService {
void
del
(
String
departmentId
);
void
del
(
String
departmentId
);
TabHaobanDepartment
selectByRelatedId
(
String
relatedId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/DepartmentApiServiceImpl.java
View file @
1f76630d
...
@@ -101,4 +101,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -101,4 +101,10 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return
hr
;
return
hr
;
}
}
@Override
public
DepartmentDTO
selectByRelatedId
(
String
relatedId
)
{
TabHaobanDepartment
tab
=
departmentService
.
selectByRelatedId
(
relatedId
);
return
EntityUtil
.
changeEntityByJSON
(
DepartmentDTO
.
class
,
tab
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentServiceImpl.java
View file @
1f76630d
...
@@ -69,4 +69,10 @@ public class DepartmentServiceImpl implements DepartmentService {
...
@@ -69,4 +69,10 @@ public class DepartmentServiceImpl implements DepartmentService {
}
}
@Override
public
TabHaobanDepartment
selectByRelatedId
(
String
relatedId
)
{
return
mapper
.
selectByRelatedId
(
relatedId
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/DepartmentMapper.xml
View file @
1f76630d
...
@@ -199,4 +199,12 @@
...
@@ -199,4 +199,12 @@
where parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}
where parent_department_id = #{parentDepartmentId,jdbcType=VARCHAR}
and status_flag = 1
and status_flag = 1
</select>
</select>
<select
id=
"selectByRelatedId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_department
where related_id = #{relatedId,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/DepartmentContoller.java
View file @
1f76630d
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -8,19 +9,26 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -8,19 +9,26 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.DepartmentService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentAddQO
;
import
com.gic.haoban.manage.web.qo.DepartmentDelQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
import
com.gic.haoban.manage.web.qo.DepartmentEditQO
;
@RestController
@RestController
public
class
DepartmentContoller
extends
WebBaseController
{
public
class
DepartmentContoller
extends
WebBaseController
{
@Autowired
@Autowired
private
DepartmentApiService
departmentApiService
;
private
DepartmentApiService
departmentApiService
;
@Autowired
private
DepartmentService
departmentService
;
@Autowired
private
StoreService
storeService
;
@RequestMapping
(
"department-list"
)
@RequestMapping
(
"department-list"
)
public
HaobanResponse
departmentList
(
String
parentId
)
{
public
HaobanResponse
departmentList
(
String
parentId
)
{
...
@@ -107,6 +115,7 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -107,6 +115,7 @@ public class DepartmentContoller extends WebBaseController{
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
department
.
setIsStore
(
0
);
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
HaobanResponse
hr
=
departmentApiService
.
add
(
department
);
HaobanResponse
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getErrorCode
()
!=
1
)
{
if
(
hr
.
getErrorCode
()
!=
1
)
{
...
@@ -150,6 +159,40 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -150,6 +159,40 @@ public class DepartmentContoller extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
@RequestMapping
(
"unbind-department-list"
)
public
HaobanResponse
unbindDepartmentList
(
String
departmentId
,
String
enterpriseId
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
list
.
add
(
departmentId
);
List
<
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
>
departmentList
=
departmentService
.
getDeptmentByPids
(
list
);
List
<
StoreDTO
>
storeList
=
storeService
.
listStoreByStoreGroupId
(
departmentId
);
List
<
DepartmentDTO
>
dtoList
=
new
ArrayList
<
DepartmentDTO
>();
for
(
com
.
gic
.
enterprise
.
api
.
dto
.
DepartmentDTO
departmentDTO
:
departmentList
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectByRelatedId
(
departmentDTO
.
getDepartId
());
if
(
dto
==
null
)
{
DepartmentDTO
unBindDTO
=
new
DepartmentDTO
();
unBindDTO
.
setRelatedId
(
departmentDTO
.
getDepartId
());
unBindDTO
.
setIsStore
(
0
);
unBindDTO
.
setDepartmentName
(
departmentDTO
.
getDepartName
());
dtoList
.
add
(
unBindDTO
);
}
}
for
(
StoreDTO
storeDTO
:
storeList
)
{
DepartmentDTO
dto
=
departmentApiService
.
selectByRelatedId
(
storeDTO
.
getStoreId
());
if
(
dto
==
null
)
{
DepartmentDTO
unBindDTO
=
new
DepartmentDTO
();
unBindDTO
.
setRelatedId
(
storeDTO
.
getStoreId
());
unBindDTO
.
setIsStore
(
0
);
unBindDTO
.
setDepartmentName
(
storeDTO
.
getStoreName
());
dtoList
.
add
(
unBindDTO
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
dtoList
);
}
private
void
handler
(
String
sonDepartment
,
String
parentId
)
{
private
void
handler
(
String
sonDepartment
,
String
parentId
)
{
if
(
StringUtils
.
isNotBlank
(
sonDepartment
))
{
if
(
StringUtils
.
isNotBlank
(
sonDepartment
))
{
...
@@ -172,7 +215,9 @@ public class DepartmentContoller extends WebBaseController{
...
@@ -172,7 +215,9 @@ public class DepartmentContoller extends WebBaseController{
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setDepartmentName
(
departmentAddQO
.
getDepartmentName
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setChainId
(
dto
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
dto
.
getDepartmentId
());
department
.
setIsStore
(
0
);
department
.
setIsStore
(
0
);
department
.
setIsStore
(
departmentAddQO
.
getStoreFlag
());
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
department
.
setLevel
(
dto
.
getLevel
()
+
1
);
department
.
setRelatedId
(
departmentAddQO
.
getRelatedId
());
HaobanResponse
hr
=
departmentApiService
.
add
(
department
);
HaobanResponse
hr
=
departmentApiService
.
add
(
department
);
if
(
hr
.
getErrorCode
()
!=
1
)
{
if
(
hr
.
getErrorCode
()
!=
1
)
{
continue
;
continue
;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/DepartmentAddQO.java
View file @
1f76630d
...
@@ -11,6 +11,10 @@ public class DepartmentAddQO implements Serializable {
...
@@ -11,6 +11,10 @@ public class DepartmentAddQO implements Serializable {
private
String
parentId
;
private
String
parentId
;
private
String
sonDepartment
;
private
String
sonDepartment
;
private
Integer
storeFlag
;
private
String
relatedId
;
public
String
getDepartmentName
()
{
public
String
getDepartmentName
()
{
return
departmentName
;
return
departmentName
;
...
@@ -43,6 +47,22 @@ public class DepartmentAddQO implements Serializable {
...
@@ -43,6 +47,22 @@ public class DepartmentAddQO implements Serializable {
public
void
setDepartmentId
(
String
departmentId
)
{
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
;
this
.
departmentId
=
departmentId
;
}
}
public
Integer
getStoreFlag
()
{
return
storeFlag
;
}
public
void
setStoreFlag
(
Integer
storeFlag
)
{
this
.
storeFlag
=
storeFlag
;
}
public
String
getRelatedId
()
{
return
relatedId
;
}
public
void
setRelatedId
(
String
relatedId
)
{
this
.
relatedId
=
relatedId
;
}
...
...
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