班组管理 问题修改 12.230

zhc4dev
zhc077 2 years ago
parent 73b5a00c84
commit 8388f0199f
  1. 80
      ant-design-vue-jeecg/src/views/system/User2ListRef.vue
  2. 65
      ant-design-vue-jeecg/src/views/team/GroupxMemberList.vue
  3. 60
      ant-design-vue-jeecg/src/views/team/modules/GroupxMemberModal.vue
  4. 2
      ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue
  5. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  6. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/controller/GroupxMemberController.java
  7. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/entity/GroupxMember.java

@ -11,14 +11,17 @@
<a-table <a-table
ref="table" ref="table"
bordered
size="middle" size="middle"
bordered
rowKey="id" rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:customRow="clickThenSelect"
@change="handleTableChange"> @change="handleTableChange">
</a-table> </a-table>
@ -40,10 +43,12 @@ import JSuperQuery from '@/components/jeecg/JSuperQuery'
import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
import UserModalDetail from './modules/UserModalDetail' import UserModalDetail from './modules/UserModalDetail'
import {filterObj} from "@/utils/util"; import {filterObj} from "@/utils/util";
import {mixinDevice} from '@/utils/mixin'
export default { export default {
name: "User2ListRef", name: "User2ListRef",
mixins: [JeecgListMixin], mixins: [JeecgListMixin, mixinDevice],
components: { components: {
JThirdAppButton, JThirdAppButton,
SysUserAgentModal, SysUserAgentModal,
@ -58,7 +63,7 @@ export default {
return { return {
description: '这是用户管理页面', description: '这是用户管理页面',
queryParam: {}, queryParam: {},
groupxId:'', groupId:'',
recycleBinVisible: false, recycleBinVisible: false,
columns: [ columns: [
/*{ /*{
@ -138,19 +143,27 @@ export default {
// } // }
], ],
// superQueryFieldList: [
// {type: 'input', value: 'username', text: '',},
// {type: 'input', value: 'realname', text: '',},
// {type: 'select', value: 'sex', text: '', dictCode: 'sex'},
// ],
url: { url: {
syncUser: "/act/process/extActProcess/doSyncUser", list: "/sys/user/listByDepartId",
listByDepartId: "/sys/user/listByDepartId", },
delete: "/sys/user/delete", loadRouteType: false,
deleteBatch: "/sys/user/deleteBatch", dictOptions:{
exportXlsUrl: "/sys/user/exportXls",
importExcelUrl: "sys/user/importExcel",
}, },
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '50'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedMainId:'',
superFieldList:[],
selectedRowKeys: [],
} }
}, },
computed: { computed: {
@ -158,23 +171,24 @@ export default {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
} }
}, },
created() { // created() {
this.loadData(); // this.loadData();
}, // },
methods: { methods: {
// valueChange(value) { // valueChange(value) {
// if (value) this.loadData() // if (value) this.loadData()
// }, // },
// //
loadParameter() { loadParameter() {
if (this.loadRouteType === false) { if (this.loadRouteType === false) {
this.groupxId = this.$router. this.groupId = this.$route.query.groupxId;
this.loadRouteType = true; this.loadRouteType = true;
} }
}, },
loadData2(groupxId) { loadData(arq) {
alert("loadData groupxId:"+groupxId) // alert("loadData groupId:"+arq)
if (!this.url.listByDepartId) { if (!this.url.list) {
this.$message.error("请设置url.list属性!") this.$message.error("请设置url.list属性!")
return return
} }
@ -182,11 +196,12 @@ export default {
// if (arg === 1) { // if (arg === 1) {
// this.ipagination.current = 1; // this.ipagination.current = 1;
// } // }
this.onClearSelected();
this.loadParameter(); this.loadParameter();
var params = this.getQueryParams();// var params = this.getQueryParams();//
this.loading = true; this.loading = true;
console.log("----------------the params:", params); console.log("----------------loadData()-the params:", params);
getAction(this.url.listByDepartId, params).then((res) => { getAction(this.url.list, params).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result.records || res.result; this.dataSource = res.result.records || res.result;
if (res.result.total) { if (res.result.total) {
@ -198,10 +213,10 @@ export default {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
this.dataSource.forEach(item => { // this.dataSource.forEach(item => {
item['stationName'] = this.stationName; // item['stationName'] = this.stationName;
item['stationNum'] = this.stationNum; // item['stationNum'] = this.stationNum;
}) // })
this.loading = false this.loading = false
}) })
}, },
@ -216,7 +231,7 @@ export default {
param.field = this.getQueryField(); param.field = this.getQueryField();
param.pageNo = this.ipagination.current; param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize; param.pageSize = this.ipagination.pageSize;
param.groupxId = this.groupxId; param.groupId = this.groupId;
return filterObj(param); return filterObj(param);
}, },
onClearSelected() { onClearSelected() {
@ -228,6 +243,15 @@ export default {
console.log('selectedRowKeys changed: ', selectedRowKeys); console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
}, },
clickThenSelect(record) {
return {
on: {
click: () => {
this.onSelectChange(record.id.split(","), [record]);
}
}
}
},
} }
} }

@ -1,65 +1,10 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 -->
<!-- <div class="table-page-search-wrapper">-->
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery">-->
<!-- <a-row :gutter="24">-->
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-item label="班组">-->
<!--&lt;!&ndash; <a-input placeholder="请输入班组ID" v-model="queryParam.groupxId"></a-input>&ndash;&gt;-->
<!-- <j-search-select-tag placeholder="请选择班组" v-model="queryParam.groupxId" dict="groupx,group_name,id"/>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-item label="用户ID">-->
<!-- <a-input placeholder="请输入用户ID" v-model="queryParam.userId"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!--&lt;!&ndash; <template v-if="toggleSearchStatus">&ndash;&gt;-->
<!--&lt;!&ndash; <a-col :xl="6" :lg="7" :md="8" :sm="24">&ndash;&gt;-->
<!--&lt;!&ndash; <a-form-item label="加入时间">&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash; <a-input placeholder="请输入加入时间" v-model="queryParam.joinTime"></a-input>&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; <a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="queryParam.joinTime"/>&ndash;&gt;-->
<!--&lt;!&ndash; </a-form-item>&ndash;&gt;-->
<!--&lt;!&ndash; </a-col>&ndash;&gt;-->
<!--&lt;!&ndash; </template>&ndash;&gt;-->
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
<!--&lt;!&ndash; <a @click="handleToggleSearch" style="margin-left: 8px">&ndash;&gt;-->
<!--&lt;!&ndash; {{ toggleSearchStatus ? '收起' : '展开' }}&ndash;&gt;-->
<!--&lt;!&ndash; <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>&ndash;&gt;-->
<!--&lt;!&ndash; </a>&ndash;&gt;-->
<!-- </span>-->
<!-- </a-col>-->
<!-- </a-row>-->
<!-- </a-form>-->
<!-- </div>-->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<a-button @click="zyStyleFabricHandleAdd(groupxId)" type="primary" icon="plus">新增</a-button> <a-button @click="zyStyleFabricHandleAdd(groupxId)" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('班组成员管理')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('班组成员管理')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel">-->
<!-- <a-icon type="delete"/>-->
<!-- 删除-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作-->
<!-- <a-icon type="down"/>-->
<!-- </a-button>-->
<!-- </a-dropdown>-->
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" @click="fanHui()">返回</a-button>
</div> </div>
@ -141,12 +86,12 @@ export default {
{ {
title: '工号', title: '工号',
align: "center", align: "center",
dataIndex: 'workNo_dictText' dataIndex: 'workNo'
}, },
{ {
title: '成员名称', title: '成员名称',
align: "center", align: "center",
dataIndex: 'userId_dictText' dataIndex: 'userId'
}, },
{ {
title: '加入时间', title: '加入时间',
@ -253,6 +198,6 @@ export default {
} }
} }
</script> </script>
<style scoped> <!--<style scoped>-->
@import '~@assets/less/common.less'; <!--@import '~@assets/less/common.less';-->
</style> <!--</style>-->

@ -39,15 +39,16 @@ export default {
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
userId: [ // userId: [
{required: true, message: "成员不能为空"}, // {required: true, message: ""},
], // ],
// joinTime: [ // joinTime: [
// {required: true}, // {required: true},
// ] // ]
}, },
url: { url: {
add: "/groupxMember/add", add: "/groupxMember/add",
list: "/sys/user/listByDepartId",
addBatch: "/groupxMember/addBatch", addBatch: "/groupxMember/addBatch",
edit: "/groupxMember/edit", edit: "/groupxMember/edit",
} }
@ -58,10 +59,9 @@ export default {
add(groupxId) { add(groupxId) {
this.model.groupxId = groupxId; this.model.groupxId = groupxId;
console.log("Modal层接收到上级参数-groupxId:" + this.model.groupxId); console.log("Modal层接收到上级参数-groupxId:" + this.model.groupxId);
this.$refs["modalForm"].loadData2(this.model.groupxId);
this.edit(this.model); this.edit(this.model);
}, },
// add () { // add() {
// // // //
// this.edit({}); // this.edit({});
// }, // },
@ -76,13 +76,8 @@ export default {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}, },
handleOk2() { handleOk2() {
// this.$refs["modalForm2"].loadData(this.model.groupxId);
this.model.userId = this.$refs["modalForm"].selectedRowKeys.toString(); this.model.userId = this.$refs["modalForm"].selectedRowKeys.toString();
// console.log("model.toolids:"+this.model.toolsId);
const that = this; const that = this;
//
// this.$refs.form.validate(valid => {
// if (valid) {
that.confirmLoading = true; that.confirmLoading = true;
let httpurl = ''; let httpurl = '';
let method = ''; let method = '';
@ -104,53 +99,12 @@ export default {
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false;
that.close(); that.close();
}) that.loadData();
// } else {
// return false;
// }
// })
},
handleOk() {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
httpurl += this.url.addBatch;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
console.log("----------the add() model:", this.model);
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
} else {
return false;
}
}) })
}, },
handleCancel() { handleCancel() {
this.close() this.close()
}, },
},
}
} }
</script> </script>
<style lang="less" scoped>
</style>

@ -67,7 +67,7 @@ export default {
}, },
data() { data() {
return { return {
enterprisesManager: "sys_user,username,id", enterprisesManager: "sys_user,realname,id",
title: "操作", title: "操作",
visible: false, visible: false,
// mobileVal: "", // mobileVal: "",

@ -20,6 +20,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.aspect.annotation.PermissionData; import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
@ -34,6 +35,10 @@ import org.jeecg.modules.system.model.SysUserSysDepartModel;
import org.jeecg.modules.system.service.*; import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.vo.SysDepartUsersVO; import org.jeecg.modules.system.vo.SysDepartUsersVO;
import org.jeecg.modules.system.vo.SysUserRoleVO; import org.jeecg.modules.system.vo.SysUserRoleVO;
import org.jeecg.modules.team.entity.Groupx;
import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.team.service.IStationService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -41,6 +46,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
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.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -95,6 +101,9 @@ public class SysUserController {
@Autowired @Autowired
private ICollectTypeService collectTypeService; private ICollectTypeService collectTypeService;
@Autowired
private IGroupxService iGroupxService;
@Value("${jeecg.path.upload}") @Value("${jeecg.path.upload}")
private String upLoadPath; private String upLoadPath;
@ -149,30 +158,19 @@ public class SysUserController {
*/ */
@RequestMapping(value = "/listByDepartId", method = RequestMethod.GET) @RequestMapping(value = "/listByDepartId", method = RequestMethod.GET)
public Result<IPage<SysUser>> listByDepartId(SysUser user, public Result<IPage<SysUser>> listByDepartId(SysUser user,
@RequestParam(name = "departId") String departId, @RequestParam(name = "groupId") String groupId,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>(); Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
// QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); // QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap());
// queryWrapper.ne("username", "_reserve_user_external");
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize); Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
// IPage<SysUser> pageList = sysUserService.page(page, queryWrapper); // IPage<SysUser> pageList = sysUserService.page(page, queryWrapper);
IPage<SysUser> pageList = sysUserService.getUserByDepId(page, departId, ""); Groupx group = iGroupxService.getById(groupId);
if (ObjectUtils.isEmpty(group)) throw new JeecgBootException(groupId + "不存在");
//批量查询用户的所属部门 IPage<SysUser> pageList = sysUserService.getUserByDepId(page, group.getDepartId(), "");
//step.1 先拿到全部的 useids
//step.2 通过 useids,一次性查询用户的所属部门名字
// List<String> userIds = pageList.getRecords().stream().map(SysUser::getId).collect(Collectors.toList());
// if (userIds != null && userIds.size() > 0) {
// Map<String, String> useDepNames = sysUserService.getDepNamesByUserIds(userIds);
// pageList.getRecords().forEach(item -> {
// item.setOrgCodeTxt(useDepNames.get(item.getId()));
// });
// }
result.setSuccess(true); result.setSuccess(true);
result.setResult(pageList); result.setResult(pageList);
// log.info(pageList.toString());
return result; return result;
} }

@ -11,11 +11,14 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.team.entity.GroupxMember; import org.jeecg.modules.team.entity.GroupxMember;
import org.jeecg.modules.team.entity.GroupxMember; import org.jeecg.modules.team.entity.GroupxMember;
import org.jeecg.modules.team.service.IGroupxMemberService; import org.jeecg.modules.team.service.IGroupxMemberService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -39,6 +42,9 @@ public class GroupxMemberController extends JeecgController<GroupxMember, IGroup
@Autowired @Autowired
private IGroupxMemberService groupxMemberService; private IGroupxMemberService groupxMemberService;
@Autowired
private ISysUserService iSysUserService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -55,6 +61,16 @@ public class GroupxMemberController extends JeecgController<GroupxMember, IGroup
QueryWrapper<GroupxMember> queryWrapper = QueryGenerator.initQueryWrapper(groupxMember, req.getParameterMap()); QueryWrapper<GroupxMember> queryWrapper = QueryGenerator.initQueryWrapper(groupxMember, req.getParameterMap());
Page<GroupxMember> page = new Page<GroupxMember>(pageNo, pageSize); Page<GroupxMember> page = new Page<GroupxMember>(pageNo, pageSize);
IPage<GroupxMember> pageList = groupxMemberService.page(page, queryWrapper); IPage<GroupxMember> pageList = groupxMemberService.page(page, queryWrapper);
List<GroupxMember> records = pageList.getRecords();
if (!ObjectUtils.isEmpty(records)) {
records.forEach(e -> {
SysUser sysUser = iSysUserService.getById(e.getUserId());
if (!ObjectUtils.isEmpty(sysUser)) {
e.setUserId(sysUser.getRealname());
e.setWorkNo(sysUser.getWorkNo());
}
});
}
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -46,11 +46,10 @@ public class GroupxMember {
*/ */
@Excel(name = "用户id FK 用户表", width = 15) @Excel(name = "用户id FK 用户表", width = 15)
@ApiModelProperty(value = "用户id FK 用户表") @ApiModelProperty(value = "用户id FK 用户表")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") // @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String userId; private String userId;
@TableField(exist = false) @TableField(exist = false)
@Dict(dictTable = "sys_user", dicText = "work_no", dicCode = "id")
private String workNo; private String workNo;
/** /**
* 加入时间 * 加入时间

Loading…
Cancel
Save