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

@ -1,65 +1,10 @@
<template>
<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">
<!-- <a-button @click="handleAdd" 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-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>
</div>
@ -141,12 +86,12 @@ export default {
{
title: '工号',
align: "center",
dataIndex: 'workNo_dictText'
dataIndex: 'workNo'
},
{
title: '成员名称',
align: "center",
dataIndex: 'userId_dictText'
dataIndex: 'userId'
},
{
title: '加入时间',
@ -253,6 +198,6 @@ export default {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
<!--<style scoped>-->
<!--@import '~@assets/less/common.less';-->
<!--</style>-->

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

@ -67,7 +67,7 @@ export default {
},
data() {
return {
enterprisesManager: "sys_user,username,id",
enterprisesManager: "sys_user,realname,id",
title: "操作",
visible: false,
// 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.PermissionData;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.modules.base.service.BaseCommonService;
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.vo.SysDepartUsersVO;
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.def.NormalExcelConstants;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -95,6 +101,9 @@ public class SysUserController {
@Autowired
private ICollectTypeService collectTypeService;
@Autowired
private IGroupxService iGroupxService;
@Value("${jeecg.path.upload}")
private String upLoadPath;
@ -149,30 +158,19 @@ public class SysUserController {
*/
@RequestMapping(value = "/listByDepartId", method = RequestMethod.GET)
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 = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
// QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap());
// queryWrapper.ne("username", "_reserve_user_external");
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
// IPage<SysUser> pageList = sysUserService.page(page, queryWrapper);
IPage<SysUser> pageList = sysUserService.getUserByDepId(page, departId, "");
//批量查询用户的所属部门
//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()));
// });
// }
Groupx group = iGroupxService.getById(groupId);
if (ObjectUtils.isEmpty(group)) throw new JeecgBootException(groupId + "不存在");
IPage<SysUser> pageList = sysUserService.getUserByDepId(page, group.getDepartId(), "");
result.setSuccess(true);
result.setResult(pageList);
// log.info(pageList.toString());
return result;
}

@ -11,11 +11,14 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
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.service.IGroupxMemberService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -39,6 +42,9 @@ public class GroupxMemberController extends JeecgController<GroupxMember, IGroup
@Autowired
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());
Page<GroupxMember> page = new Page<GroupxMember>(pageNo, pageSize);
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);
}

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

Loading…
Cancel
Save