业务组织配置

jg-waiwang-pro
vayne 9 months ago
parent 8e9ff1af91
commit d217ab8b82

@ -3,16 +3,16 @@
<mapper namespace="jnpf.mapper.BusinessLineMapper"> <mapper namespace="jnpf.mapper.BusinessLineMapper">
<select id="queryBusinessLineList" resultType="jnpf.entity.BusinessLineEntity"> <select id="queryBusinessLineList" resultType="jnpf.entity.BusinessLineEntity">
select * from jg_business_line where 1=1 select * from jg_business_line
</select> </select>
<select id="queryOrganizeCount" resultType="jnpf.entity.BusinessEnterpriseRelationalEntity"> <select id="queryOrganizeCount" resultType="Integer">
select count(id) from jg_business_enterprise_relational a select count(0) from jg_business_enterprise_relational a
where a.business_line_id = #{id} where a.business_line_id = #{id}
</select> </select>
<select id="queryUserCount" resultType="jnpf.entity.BusinessUserRelationalEntity"> <select id="queryUserCount" resultType="Integer">
select count(id) from jg_business_user_relational a select count(0) from jg_business_user_relational a
where a.business_line_id = #{id} where a.business_line_id = #{id}
</select> </select>

@ -17,6 +17,6 @@ public interface BusinessLineMapper extends BaseMapper<BusinessLineEntity> {
List<BusinessLineEntity> queryBusinessLineList(); List<BusinessLineEntity> queryBusinessLineList();
int queryOrganizeCount(String id); Integer queryOrganizeCount(String id);
int queryUserCount(String id); Integer queryUserCount(String id);
} }

@ -95,14 +95,14 @@ public class BusinessLineConfigController {
Map<String, Object> businessLineConfigMap=JsonUtil.entityToMap(entity); Map<String, Object> businessLineConfigMap=JsonUtil.entityToMap(entity);
businessLineConfigMap.put("id", businessLineConfigMap.get("id")); businessLineConfigMap.put("id", businessLineConfigMap.get("id"));
//副表数据 //副表数据
BusinessLineSonEntity businessLineSonEntity = businessLineConfigService.getBusinessLineSon(entity.getId()); BusinessLineSonEntity businessLineSonEntity = businessLineConfigService.getBusinessLineSon(entity.getBusinessLineId());
if(ObjectUtil.isNotEmpty(businessLineSonEntity)){ if(ObjectUtil.isNotEmpty(businessLineSonEntity)){
Map<String, Object> businessLineSonMap=JsonUtil.entityToMap(businessLineSonEntity); Map<String, Object> businessLineSonMap=JsonUtil.entityToMap(businessLineSonEntity);
for(String key:businessLineSonMap.keySet()){ for(String key:businessLineSonMap.keySet()){
businessLineConfigMap.put("jnpf_jg_business_line_jnpf_"+key,businessLineSonMap.get(key)); businessLineConfigMap.put("jnpf_jg_business_line_jnpf_"+key,businessLineSonMap.get(key));
} }
} }
BaseUserEntity baseUserEntity = businessLineConfigService.getBaseUser(entity.getId()); BaseUserEntity baseUserEntity = businessLineConfigService.getBaseUser(entity.getUserId());
if(ObjectUtil.isNotEmpty(baseUserEntity)){ if(ObjectUtil.isNotEmpty(baseUserEntity)){
Map<String, Object> baseUserMap=JsonUtil.entityToMap(baseUserEntity); Map<String, Object> baseUserMap=JsonUtil.entityToMap(baseUserEntity);
for(String key:baseUserMap.keySet()){ for(String key:baseUserMap.keySet()){

@ -75,22 +75,12 @@ public class BusinessLineController {
*/ */
@Operation(summary = "获取业务线树形") @Operation(summary = "获取业务线树形")
@GetMapping("/Tree") @GetMapping("/Tree")
public ActionResult<ListVO<BusinessLineSonTree>> tree() { public ActionResult<List<BusinessLineSonTree>> tree() {
List<BusinessLineEntity> list = businessLineService.queryBusinessLineListInfo(); List<BusinessLineEntity> list = businessLineService.list();
List<BusinessLineModel> models = JsonUtil.getJsonToList(list, BusinessLineModel.class); List<BusinessLineModel> models = JsonUtil.getJsonToList(list, BusinessLineModel.class);
List<SumTree<BusinessLineModel>> trees = TreeDotUtils.convertListToTreeDot(models); List<SumTree<BusinessLineModel>> trees = TreeDotUtils.convertListToTreeDot(models);
List<BusinessLineSonTree> listVO = JsonUtil.getJsonToList(trees, BusinessLineSonTree.class); List<BusinessLineSonTree> listVO = JsonUtil.getJsonToList(trees, BusinessLineSonTree.class);
//将子节点全部删除 return ActionResult.success(listVO);
Iterator<BusinessLineSonTree> iterator = listVO.iterator();
while (iterator.hasNext()) {
BusinessLineSonTree businessLineSonTree = iterator.next();
if (!"-1".equals(businessLineSonTree.getParentId())) {
iterator.remove();
}
}
ListVO vo = new ListVO();
vo.setList(listVO);
return ActionResult.success(vo);
} }

@ -260,7 +260,6 @@ export default {
}, },
methods: { methods: {
organizeSubmit(val, val2, val3) { organizeSubmit(val, val2, val3) {
debugger
let enterpriseId = '' let enterpriseId = ''
if (!val || !val.length) return enterpriseId = '' if (!val || !val.length) return enterpriseId = ''
enterpriseId = val[val.length - 1] enterpriseId = val[val.length - 1]
@ -268,7 +267,6 @@ export default {
enterpriseId: '', enterpriseId: '',
businessLineId: '' businessLineId: ''
} }
debugger
data.enterpriseId = enterpriseId data.enterpriseId = enterpriseId
data.businessLineId = val3 data.businessLineId = val3
request({ request({

@ -2,7 +2,7 @@
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-left"> <div class="JNPF-common-layout-left">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2>左侧标题</h2> <h2>{{ title }}</h2>
<el-dropdown> <el-dropdown>
<el-link icon="icon-ym icon-ym-mpMenu" :underline="false" /> <el-link icon="icon-ym icon-ym-mpMenu" :underline="false" />
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -12,7 +12,7 @@
</el-dropdown> </el-dropdown>
</div> </div>
<div class="JNPF-common-tree-search-box"> <div class="JNPF-common-tree-search-box">
<el-input placeholder="输入关键字" v-model="keyword" suffix-icon="el-icon-search" clearable /> <el-input placeholder="输入业务线名称" v-model="keyword" suffix-icon="el-icon-search" clearable />
</div> </div>
<el-tree :data="treeData" class="JNPF-common-el-tree" highlight-current ref="treeBox" <el-tree :data="treeData" class="JNPF-common-el-tree" highlight-current ref="treeBox"
:expand-on-click-node="false" @node-click="handleNodeClick" node-key="id" :props="treeProps" :expand-on-click-node="false" @node-click="handleNodeClick" node-key="id" :props="treeProps"
@ -167,6 +167,7 @@ export default {
data() { data() {
return { return {
title: '',
keyword: '', keyword: '',
expandsTree: true, expandsTree: true,
refreshTree: true, refreshTree: true,
@ -400,9 +401,11 @@ export default {
this.initData() this.initData()
}, },
getTreeView() { getTreeView() {
getDataInterfaceRes('519521191191380165').then(res => { request({
let data = res.data url: `/api/scm/BusinessLine/Tree`,
this.treeData = data method: 'get'
}).then(res => {
this.treeData = res.data
this.initSearchDataAndListData() this.initSearchDataAndListData()
}) })
}, },
@ -416,11 +419,12 @@ export default {
return fullPath return fullPath
}, },
handleNodeClick(data, node) { handleNodeClick(data, node) {
this.title = data.name
this.treeActiveId = data.id this.treeActiveId = data.id
for (let key in this.query) { for (let key in this.query) {
this.query[key] = undefined this.query[key] = undefined
} }
this.query.jnpf_jg_business_line_jnpf_name = data.id this.query.businessLineId = data.id
this.listQuery = { this.listQuery = {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -452,6 +456,7 @@ export default {
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
debugger
var _list = res.data.list; var _list = res.data.list;
this.list = _list.map(o => ({ this.list = _list.map(o => ({
...o, ...o,

@ -102,7 +102,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope" v-if="scope.row.diffFlag != '1'">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1" <el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑 @click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button> </el-button>

Loading…
Cancel
Save