feature/gitPush_dept #93

Merged
zhangyong merged 3 commits from feature/gitPush_dept into test 1 year ago

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>部门主表</title>
<title>公司主表</title>
@ -25,9 +25,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">* 部门名称:</label>
<label class="col-sm-3 control-label is-required">* 公司名称:</label>
<div class="col-sm-9">
<input name="departname" id="departname" class="form-control" placeholder="部门名称" class="form-control" type="text" maxlength='100' required>
<input name="departname" id="departname" class="form-control" placeholder="公司名称" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -45,9 +45,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">* 部门描述:</label>
<label class="col-sm-3 control-label is-required">* 公司描述:</label>
<div class="col-sm-9">
<input name="departdesc" id="departdesc" class="form-control" placeholder="部门描述" class="form-control" type="text" maxlength='100' required>
<input name="departdesc" id="departdesc" class="form-control" placeholder="公司描述" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -81,9 +81,9 @@
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">部门地址:</label>
<label class="col-sm-3 control-label is-required">公司地址:</label>
<div class="col-sm-9">
<input name="departaddress" id="departaddress" class="form-control" placeholder="部门地址" class="form-control" type="text" maxlength='100' required>
<input name="departaddress" id="departaddress" class="form-control" placeholder="公司地址" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -91,20 +91,47 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">机构编号:</label>
<label class="col-sm-3 control-label is-required">业务主体编码:</label>
<div class="col-sm-9">
<input type="text" id="deptno" name="deptno" placeholder="机构编号" data-required="1" class="form-control" required checkENG="true" minlength="2" maxlength="50"/>
<input type="text" id="deptno" name="deptno" placeholder="业务主体编码" data-required="1" class="form-control" required minlength="2" maxlength="50"/>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">企业编码:</label>
<div class="col-sm-9">
<input type="text" id="description" name="description" placeholder="企业编码" data-required="1" class="form-control" required minlength="2" maxlength="50"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">业务主体/租户:</label>
<div class="col-sm-9">
<div class="input-group">
<div class="radio i-checks">
<label>
<input type="radio" id="typedept1" checked="" value="1" name="typedept"> <i></i>业务主体
</label>
<label>
<input type="radio" id="typedept0" value="0" name="typedept"> <i></i>租户
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-sm-offset-5">

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>部门主表</title>
<title>公司主表</title>
@ -27,9 +27,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">* 部门名称:</label>
<label class="col-sm-3 control-label is-required">* 公司名称:</label>
<div class="col-sm-9">
<input name="departname" id="departname" class="form-control" placeholder="部门名称" class="form-control" type="text" maxlength='100' required>
<input name="departname" id="departname" class="form-control" placeholder="公司名称" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -47,9 +47,9 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">* 部门描述:</label>
<label class="col-sm-3 control-label is-required">* 公司描述:</label>
<div class="col-sm-9">
<input name="departdesc" id="departdesc" class="form-control" placeholder="部门描述" class="form-control" type="text" maxlength='100' required>
<input name="departdesc" id="departdesc" class="form-control" placeholder="公司描述" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -84,9 +84,9 @@
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">部门地址:</label>
<label class="col-sm-3 control-label is-required">公司地址:</label>
<div class="col-sm-9">
<input name="departaddress" id="departaddress" class="form-control" placeholder="部门地址" class="form-control" type="text" maxlength='100' required>
<input name="departaddress" id="departaddress" class="form-control" placeholder="公司地址" class="form-control" type="text" maxlength='100' required>
</div>
</div>
</div>
@ -94,13 +94,41 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">机构编号:</label>
<label class="col-sm-3 control-label is-required">业务主体编码:</label>
<div class="col-sm-9">
<input type="text" id="deptno" name="deptno" placeholder="机构编号" data-required="1" readonly="readonly" class="form-control" required checkENG="true" minlength="2" maxlength="50"/>
<input type="text" id="deptno" name="deptno" placeholder="业务主体编码" data-required="1" class="form-control" required minlength="2" maxlength="50"/>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">企业编码:</label>
<div class="col-sm-9">
<input type="text" id="description" name="description" placeholder="企业编码" data-required="1" class="form-control" required minlength="2" maxlength="50"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label is-required">业务主体/租户:</label>
<div class="col-sm-9">
<div class="input-group">
<div class="radio i-checks">
<label>
<input type="radio" id="typedept1" value="1" name="typedept"> <i></i>业务主体
</label>
<label>
<input type="radio" id="typedept0" value="0" name="typedept"> <i></i>租户
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
@ -180,8 +208,8 @@
$(document).ready(function () {
parent.axgetXiaoyao("${ctx}/backstage/admin/department/showDeptJsTree" ,null,false,function (data) {
_deptTree = $.fn.zTree.init($("#departZtreeUl"),setting, data);
parent.axgetXiaoyao("${ctx}/backstage/admin/department/showDeptJsTree" ,null,false,function (datatree) {
_deptTree = $.fn.zTree.init($("#departZtreeUl"),setting, datatree);
_deptTree.expandAll(true);
@ -194,6 +222,8 @@
$("#departdesc").val(data.data.departdesc);
$("#deptno").val(data.data.deptno);
$("#description").val(data.data.description);
var node = _deptTree.getNodesByParam("id",String(data.data.parentid));
@ -209,6 +239,12 @@
$("input:radio[name='enabled']").eq(1).attr('checked',true);
}
if(data.data.typedept == 1){
$("input:radio[name='typedept']").eq(0).attr('checked',true);
}else if(data.data.typedept == 0){
$("input:radio[name='typedept']").eq(1).attr('checked',true);
}
checkeradio();
$("#sorting").val(data.data.sorting);

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>部门主表</title>
<title>公司主表</title>
@ -53,7 +53,7 @@
<input name='search_parentid' id='search_parentid' type="hidden"/>
<div class="form-group">
<input name='search_departname' id='search_departname' class='form-control' placeholder='部门名称'/>
<input name='search_departname' id='search_departname' class='form-control' placeholder='公司名称'/>
</div>
<div class="form-group">
<select class="form-control input-s-sm inline" name="search_enabled" id="search_enabled">
@ -89,12 +89,43 @@
</div>
</div>
<!-- 展示流程图的 窗口 -->
<div id="modal_flowable_list" class="modal fade" aria-hidden="true">
<div class="modal-dialog" role="document" style="width: auto">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="flowImgModalLabel">部署工作流:<span id="flowName"></span></h4>
</div>
<div class="modal-body">
<form id="candidateUserFrom">
<input type="hidden" name="processdefinitionid" id="processdefinitionid">
<input type="hidden" name="caProcessdefinitionid" id="caProcessdefinitionid">
<div class="form-group">
<table id="flowable_list" ></table>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" onclick="saveUserCandidateForm()" class="btn btn-primary">设置</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭窗口</button>
</div>
</div>
</div>
</div>
<#include "/head/footlist.html" />
<script src="${ctx}/static/js/plugins/jqueryzTree/js/jquery.ztree.all.min.js"></script>
</body>
</html>
<script type="text/javascript">
var _tableListDefinition;
var _deptTree;
var setting = {
data: {
@ -124,12 +155,61 @@
});
function playFlow(cc,dd){
$("#modal_flowable_list").modal();
$("#modal_flowable_list").css("z-index",(parent.getMaxZIndex() + 1));
_tableListDefinition.bootstrapTable('refreshOptions',{pageNumber:1});
}
var _tableListDepartment;
var jsptoolbar = '';
var jspOperation = '';
jQuery(document).ready(function($){
_tableListDefinition = $('#flowable_list').bootstrapTable({
url: '${ctx}/flow/definition/latestList' ,
pagination: true, //是否显示分页(*
pageNumber:1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
sidePagination: "server",
height: "100%", pageList: [10, 25, 50],
ajaxOptions:{
headers: {"logintoken": parent.getLoginToken()}
},
queryParams: function queryParams(params) {
return {
sortorder: params.order,
sortname: params.sort,
pageSize: params.limit,
currPage: (params.offset / params.limit) + 1
};
},
responseHandler:function(res){
return{"rows": res.data.list, "total": res.data.totalCount};
},
columns: [
{ width:150,valign: "middle",field:'id',title:'流程定义ID',sortable:false},
{ width:150,valign: "middle",field:'name',title:'流程名称',sortable:false},
{ width:150,valign: "middle",field:'flowKey',title:'流程key',sortable:false},
{ width:150,valign: "middle",field:'description',title:'流程描述',sortable:false},
{
width:90,
field: 'id',
title: '关联的流程',
formatter:function(value,oData,index) {
var listOperation = '无';
if($("#caProcessdefinitionid").val() == oData.id){
listOperation = '<a class="btn btn-info btn-circle btn-lg" href="#"> </a>';
}
return listOperation;
}
}
]
});
initDepartTree();
parent.axgetXiaoyao("${ctx}/backstage/admin/user/toolsbarOperation?" + "resourceid=${resourceid}",null,true ,
function(data){
@ -168,9 +248,28 @@
},
columns: [
{checkbox: true},
{ width:150,valign: "middle",field:'departname',title:'公司名称',sortable:true},
{ width:150,valign: "middle",field:'enabled',title:'公司类型',sortable:true,
formatter:function (value,oData,index) {
var listOperation = "";
if(oData.typedept == 1){
listOperation = "主体";
}else {
listOperation = "租户";
}
return listOperation;
}
},
{ width:150,valign: "middle",field:'deptno',title:'业务主体编码',sortable:true},
{ width:150,valign: "middle",field:'description',title:'企业编码',sortable:true},
{ width:50,valign: "middle",field:'processdefinitionid',title:'是否关联流程',sortable:false,
formatter:function(value,oData,index) {
var listOperation = oData.processdefinitionid == null ? "否" : "是";
{ width:150,valign: "middle",field:'departname',title:'部门名称',sortable:true},
{ width:150,valign: "middle",field:'departdesc',title:'部门描述',sortable:true},
return listOperation;
}
},
{ width:150,valign: "middle",field:'enabled',title:'是否启用',sortable:true,
formatter:function (value,oData,index) {
var listOperation = "";
@ -196,6 +295,8 @@
$(jspOperation).each(function (i, toolbar) {
listOperation = listOperation + "<a href=\"javascript:" + toolbar.actionmethod + "('${resourceid}','" + tempid + "');\" class=\"btn " + toolbar.img + " btn-xs\")><i class=\"fa " + toolbar.methodkey + "\"></i> " + toolbar.text + " </a>&nbsp;&nbsp;";
});
listOperation = listOperation + "<a href=\"javascript:playFlow('" + oData.processdefinitionid + "','" + oData.id + "');\" class=\"btn btn-success btn-xs\")><i class=\"fa fa-map-signs\"></i>查看流程</a>&nbsp;&nbsp;";
return listOperation;
}
}
@ -222,11 +323,11 @@
});
}
function _useradd(sourceid){
parent._xiaoyaoOpenMenuTab('${ctx}/backstage/admin/departmentHtml/toSave',"添加部门",sourceid);
parent._xiaoyaoOpenMenuTab('${ctx}/backstage/admin/departmentHtml/toSave',"添加公司",sourceid);
}
function updateData(sourceid,str){
var url = '${ctx}/backstage/admin/departmentHtml/toEdit/' + str ;
parent._xiaoyaoOpenMenuTab(url,"修改部门",sourceid + "_edit");
parent._xiaoyaoOpenMenuTab(url,"修改公司",sourceid + "_edit");
}
function _useredit(sourceid){
var str = getIdSelections() + "";

@ -121,7 +121,7 @@
<div class="col-sm-9">
<div class="input-group">
<input name="treeDeptName" id="treeDeptName" type="text" placeholder="请选择归属部门" onclick="selectDeptTree()" readonly="true" required class="form-control">
<input name="departmentId" id="departmentId" type="hidden">
<input name="departmentIds" id="departmentIds" type="hidden">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
@ -154,11 +154,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> 关联公司:</label>
<div class="col-sm-9">
<select data-placeholder="请选择公司" id="tenantselect" name="tenantselect" class="chosen-select" multiple style="width:350px;" tabindex="4">
</select>
</div>
</div>
</div>
@ -294,8 +290,41 @@
simpleData: {
enable: true
}
}, callback: {onClick: zTreeOnClick }
},
check: {
enable: true,
chkStyle: "checkbox",
chkboxType: { "Y": "", "N": "" }
},
callback: {
onCheck: zOnCheck
}
};
// 全局变量
var checks = [];
// 复选框调用
function zOnCheck(event, treeId, treeNode) {
if (treeNode.checked) {//如果是选中节点
checks.push({id: treeNode.id, name: treeNode.name});
} else {//如果是取消选中
removeCheck(treeNode.id);
}
console.log(checks)
}
// 移除元素
function removeCheck(chkid) {
$.each(checks, function (idx, item) {
if (item != undefined && item.id == chkid) {
checks.splice(idx, 1);
}
})
}
function showuserIconModel() {
$userIconModel.modal();
$userIconModel.css("z-index",(parent.getMaxZIndex() + 1));
@ -308,6 +337,22 @@
$modalDeptTree.css("z-index",(parent.getMaxZIndex() + 1));
}
function closedept(){
var tempName = "";
var tempId = "";
$.each(checks,function(name,anArray) {
if(tempName.length > 1){
tempName = tempName + "," + anArray.name;
tempId = tempId + "," + anArray.id;
}else{
tempName = tempName + anArray.name;
tempId = tempId + anArray.id;
}
});
$("#treeDeptName").val(tempName);
$("#departmentIds").val(tempId);
$modalDeptTree.modal('hide');
}
//折叠ibox
@ -323,13 +368,7 @@
$(this).hide();
$("#collapes_linkopen").show();
});
function zTreeOnClick(event, treeId, treeNode) {
$("#treeDeptName").val(treeNode.name);
$("#departmentId").val(treeNode.id);
closedept();
}
var selectConfig = {
'.chosen-select': {},
'.chosen-select-deselect': {
@ -355,16 +394,7 @@
changeRoles(userdepartmentId);
changePost(userdepartmentId);
parent.axgetXiaoyao("${ctx}/backstage/admin/tenant/listall",null,false,function (data) {
if(data.code == "OK"){
console.log(data.data)
$.each(data.data,function(name,anArray) {
console.log(anArray)
$("#tenantselect").append("<option value='" + anArray.id + "'>" + anArray.name + "</option>");
});
}
});
var config = {

@ -123,7 +123,7 @@
<div class="col-sm-9">
<div class="input-group">
<input name="treeDeptName" id="treeDeptName" type="text" placeholder="请选择归属部门" onclick="selectDeptTree()" readonly="true" required class="form-control">
<input name="departmentId" id="departmentId" type="hidden">
<input name="departmentIds" id="departmentIds" type="hidden">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
@ -157,11 +157,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"> 关联公司:</label>
<div class="col-sm-9">
<select data-placeholder="请选择公司" id="tenantselect" name="tenantselect" class="chosen-select" multiple style="width:350px;" tabindex="4">
</select>
</div>
</div>
</div>
@ -286,8 +282,40 @@
simpleData: {
enable: true
}
}, callback: {onClick: zTreeOnClick }
},
check: {
enable: true,
chkStyle: "checkbox",
chkboxType: { "Y": "", "N": "" }
},
callback: {
onCheck: zOnCheck
}
};
// 全局变量
var checks = [];
// 复选框调用
function zOnCheck(event, treeId, treeNode) {
if (treeNode.checked) {//如果是选中节点
checks.push({id: treeNode.id, name: treeNode.name});
} else {//如果是取消选中
removeCheck(treeNode.id);
}
console.log(checks)
}
// 移除元素
function removeCheck(chkid) {
$.each(checks, function (idx, item) {
if (item != undefined && item.id == chkid) {
checks.splice(idx, 1);
}
})
}
var selectConfig = {
'.chosen-select': {},
'.chosen-select-deselect': {
@ -316,6 +344,21 @@
$modalDeptTree.css("z-index",(parent.getMaxZIndex() + 1));
}
function closedept(){
var tempName = "";
var tempId = "";
$.each(checks,function(name,anArray) {
if(tempName.length > 1){
tempName = tempName + "," + anArray.name;
tempId = tempId + "," + anArray.id;
}else{
tempName = tempName + anArray.name;
tempId = tempId + anArray.id;
}
});
$("#treeDeptName").val(tempName);
$("#departmentIds").val(tempId);
$modalDeptTree.modal('hide');
}
//折叠ibox
@ -331,13 +374,7 @@
$(this).hide(); F
$("#collapes_linkopen").show();
});
function zTreeOnClick(event, treeId, treeNode) {
$("#treeDeptName").val(treeNode.name);
$("#departmentId").val(treeNode.id);
closedept();
}
$(document).ready(function () {
@ -347,20 +384,6 @@
changePost(userdepartmentId);
parent.axgetXiaoyao("${ctx}/backstage/admin/tenant/listall",null,false,function (data) {
if(data.code == "OK"){
console.log(data.data)
$.each(data.data,function(name,anArray) {
console.log(anArray)
$("#tenantselect").append("<option value='" + anArray.id + "'>" + anArray.name + "</option>");
});
}
});
parent.axgetXiaoyao("${ctx}/backstage/admin/department/showDeptJsTree",null,false,function (data) {
_deptTree = $.fn.zTree.init($("#departZtreeUl"),setting, data);
_deptTree.expandAll(true);
@ -379,16 +402,23 @@
$("#email").val(usermodel.email);
$("#nationid").val(usermodel.nationid);
var nodeId = usermodel.departmentId;
if(undefined != nodeId && null != nodeId){
var node = _deptTree.getNodeByParam("id",nodeId);
_deptTree.selectNode(node);
var tempId = "";
$.each(usermodel.deptlist,function (index,deptDate){
if(null != deptDate){
var node = _deptTree.getNodeByParam("id",deptDate.id);
// _deptTree.selectNode(node);
_deptTree.checkNode(node,true,true,true);
}
if(tempId.length > 1){
tempId = tempId + "," + deptDate.id;
}else{
tempId = tempId + deptDate.id;
}
});
$("#departmentIds").val(tempId);
$("#treeDeptName").val(usermodel.departname);
$("#departmentId").val(usermodel.departmentId);
if(usermodel.enabled == 1){
$("input:radio[name='enabled']").eq(0).attr('checked',true);
@ -402,12 +432,6 @@
$("input:radio[name='usex']").eq(1).attr('checked',true);
}
$.each(usermodel.tenantList,function(name,anArray) {
$("#tenantselect option[value='" + anArray.id + "']").attr("selected",true);
});
}else{
parent.toastr.error("非法请求。");
//rolesback();

@ -196,8 +196,10 @@ public class UserController extends BaseController{
//角色主键数组
String[] rolesid = request.getParameterValues("rolesid");
String departmentIds = request.getParameter("departmentIds");
//保存用户信息
int isok = this.userService.save(tab, rolesid);
int isok = this.userService.save(tab, rolesid,departmentIds);
if (isok > 0) {
String[] tenantselect = request.getParameterValues("tenantselect");
@ -252,8 +254,10 @@ public class UserController extends BaseController{
//角色主键数组
String[] rolesid = request.getParameterValues("rolesid");
String departmentIds = request.getParameter("departmentIds");
//保存用户信息
int isok = this.userService.editUser(tab, rolesid);
int isok = this.userService.editUser(tab, rolesid,departmentIds);
if (isok > 0) {
String[] tenantselect = request.getParameterValues("tenantselect");

@ -52,6 +52,7 @@ public class Department implements BaseDto,java.io.Serializable {
@Schema(description = "上一级部门主键默认为0表示为第一级数据对象非0情况表示为有上一级数据对象")
@TableField(value="PARENTID")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentid;
@Schema(description = "记录根级部门主键用于记录子部门所属根节点主键默认为0只有一层节点记录上一级节点主键")
@ -130,6 +131,37 @@ public class Department implements BaseDto,java.io.Serializable {
@TableField(value="UPDATETIME")
private Long updatetime;
@Schema(description = "对应的Service名主要是spring的service名")
@TableField(value="SERVICENAME")
private String servicename;
@Schema(description = "内置表单使用flowable表单0使用本地数据1使用flowable表单3:外置表单4其他自定义表单")
@TableField(value="BUILTFORM")
private Integer builtform;
@Schema(description = "表单地址,用户展示用户表单使用")
@TableField(value="FORMURL")
private String formurl;
@Schema(description = "表单详情")
@TableField(value="FORMDETAIL")
private String formdetail;
@Schema(description = "表单分类")
@TableField(value="FORMTYPE")
private String formtype;
@Schema(description = "流程定义id")
@TableField(value="PROCESSDEFINITIONID")
private String processdefinitionid;
@Schema(description = "公司类型0租户1主体")
@TableField(value="TYPEDEPT")
private Integer typedept;
@Schema(description = "对应的工作流编码,与工作流中的命名空间对应")
@TableField(value="CATEGORY")
private String category;
//子集机构的集合
@TableField(exist = false)
private List<Department> listchilddept;
@ -165,7 +197,15 @@ public class Department implements BaseDto,java.io.Serializable {
new SimpleEntry<>("CREATEUSER","createuser"),
new SimpleEntry<>("CREATEDATE","createdate"),
new SimpleEntry<>("UPDATEUSER","updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime")
new SimpleEntry<>("UPDATETIME","updatetime"),
new SimpleEntry<>("SERVICENAME","servicename"),
new SimpleEntry<>("BUILTFORM","builtform"),
new SimpleEntry<>("FORMURL","formurl"),
new SimpleEntry<>("FORMDETAIL","formdetail"),
new SimpleEntry<>("FORMTYPE","formtype"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"),
new SimpleEntry<>("TYPEDEPT","typedept"),
new SimpleEntry<>("CATEGORY","category")
)
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override

@ -172,12 +172,12 @@ public class User implements BaseDto,java.io.Serializable {
//用于记录用户对应的顶级机构主键
@TableField(exist = false)
private Long departmentRootId = 0L;
//租户关系
@TableField(exist = false)
List<Tenant> tenantList;
//
// //租户关系
// @TableField(exist = false)
// List<Tenant> tenantList;
//用户对应的部门信息,映射文件中对应的字段信息
@JsonIgnore
@TableField(exist = false)
private List<Department> deptlist = new ArrayList<Department>(0);
@ -215,7 +215,7 @@ public class User implements BaseDto,java.io.Serializable {
Iterator<Department> it = deptlist.iterator();
StringBuffer sb = new StringBuffer();
if (it.hasNext()) {
while (it.hasNext()) {
Department dept = it.next();
if (null != sb && sb.length() > 0) {

@ -33,6 +33,12 @@ public interface DepartmentService extends BaseService<Department> {
*/
public List<Department> listDepartByUser(User user, boolean enabled);
/**
*
* @param category
* @return
*/
List<Department> listByDeptNo(String deptno);
/**
* ,
* @param id

@ -87,7 +87,7 @@ public interface UserService extends BaseService<User> {
* @param rolesid
* @return
*/
int save(User user, String[] rolesid);
int save(User user, String[] rolesid,String departmentIds);
/**
* ,
@ -108,7 +108,7 @@ public interface UserService extends BaseService<User> {
* @param user
* @return
*/
int editUser(User user, String[] rolesid);
int editUser(User user, String[] rolesid,String departmentIds);
/**
* userDefaultPassword123456

@ -206,6 +206,17 @@ public class DepartmentServiceImpl extends BaseServiceImpl<DepartmentMybatisDao,
return list;
}
/**
*
* @param category
* @return
*/
public List<Department> listByDeptNo(String deptno){
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("DEPTNO",deptno);
return this.selectSearchList(queryWrapper);
}
/**
*
* @param roleid

@ -105,7 +105,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//返回用户前端菜单权限列表
List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname());
@ -136,7 +136,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//返回用户前端菜单权限列表
List<SFrontmenuT> frontmenuTList1 = isFrontmenuTService.queryUserMenuById(user.getLoginname());
@ -283,7 +283,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
*/
@Override
@Transactional
public int save(User user, String[] rolesid){
public int save(User user, String[] rolesid,String departmentIds){
//spring密码加密啊算法
BCryptPasswordEncoder bcryptPasswordEncoder = new BCryptPasswordEncoder();
@ -299,12 +299,18 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
isok = this.usermybatisdao.insert(user);
//保存用户是否成功
if(isok > 0){
String[] deptids = departmentIds.split(",");
for(String dids:deptids){
Userobject uo = new Userobject();
uo.setUserid(user.getId());
uo.setDepartid(user.getDepartmentId());
uo.setDepartid(Long.parseLong(dids));
//保存用户与部门的关系
this.userobjectMybatisDao.insert(uo);
}
//判断接收的角色是否为空,如果为空用户角色使用默认角色
if(null != rolesid && rolesid.length > 0){
@ -426,7 +432,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
*/
@Override
@Transactional
public int editUser(User user,String[] rolesid){
public int editUser(User user,String[] rolesid,String departmentIds){
//获得数据库中用户信息
User olduser = this.usermybatisdao.selectById(user.getId());
@ -442,17 +448,27 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
queryWrapper.eq("USERID",user.getId());
//判断修改前用户的机构主键是否一致,如果不一致需要修改
if(!user.getDepartmentId().equals(olduser.getDepartmentId())){
// if(!user.getDepartmentId().equals(olduser.getDepartmentId())){
//删除原有用户与机构的关联关系
this.userobjectMybatisDao.delete(queryWrapper);
String[] deptids = departmentIds.split(",");
for(String dids:deptids){
Userobject uo = new Userobject();
uo.setUserid(user.getId());
uo.setDepartid(user.getDepartmentId());
uo.setDepartid(Long.parseLong(dids));
//保存用户与部门的关系
this.userobjectMybatisDao.insert(uo);
}
// Userobject uo = new Userobject();
// uo.setUserid(user.getId());
// uo.setDepartid(user.getDepartmentId());
// //保存用户与部门的关系
// this.userobjectMybatisDao.insert(uo);
// }
//判断接收的角色是否为空
if(null != rolesid && rolesid.length > 0){
@ -616,7 +632,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMybatisDao,User> imple
if(null != user){
List<Department> departmentList = this.departmentMybatisDao.selectDeptByUserid(user.getId());
user.formatDeptlist(departmentList);
user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
}
return user;

@ -238,7 +238,7 @@ public class UserTokenServiceImpl implements UserTokenService {
Map<String,Object> rolesShowleave = this.rolesService.getRolesConditionMap(user);
SearchQuery searchQueryrolesShowleave = this.rolesService.getRolesCondition(rolesShowleave);
user.setRolesShowleave(rolesShowleave);
user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
//user.setTenantList(this.userTenantService.listUserTenant(user.getId()));
user.setSearchQueryrolesShowleave(searchQueryrolesShowleave);
userVo = BeanUtil.copyProperties(user,User.class);

@ -26,6 +26,14 @@
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="SERVICENAME" property="servicename" jdbcType="VARCHAR"/>
<result column="BUILTFORM" property="builtform" jdbcType="INTEGER"/>
<result column="FORMURL" property="formurl" jdbcType="VARCHAR"/>
<result column="FORMDETAIL" property="formdetail" jdbcType="VARCHAR"/>
<result column="FORMTYPE" property="formtype" jdbcType="VARCHAR"/>
<result column="PROCESSDEFINITIONID" property="processdefinitionid" jdbcType="VARCHAR"/>
<result column="TYPEDEPT" property="typedept" jdbcType="INTEGER"/>
<result column="CATEGORY" property="category" jdbcType="VARCHAR"/>
<collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/>
</resultMap>
<resultMap id="BaseResultMap_only" type="cn.jyjz.xiaoyao.admin.dataobject.Department">
@ -53,6 +61,14 @@
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="SERVICENAME" property="servicename" jdbcType="VARCHAR"/>
<result column="BUILTFORM" property="builtform" jdbcType="INTEGER"/>
<result column="FORMURL" property="formurl" jdbcType="VARCHAR"/>
<result column="FORMDETAIL" property="formdetail" jdbcType="VARCHAR"/>
<result column="FORMTYPE" property="formtype" jdbcType="VARCHAR"/>
<result column="PROCESSDEFINITIONID" property="processdefinitionid" jdbcType="VARCHAR"/>
<result column="TYPEDEPT" property="typedept" jdbcType="INTEGER"/>
<result column="CATEGORY" property="category" jdbcType="VARCHAR"/>
<collection property="listchilddept" select="selectChildDeptEnabled" javaType="java.util.ArrayList" column="{id=id}"/>
</resultMap>
<sql id="Base_Column_List">
@ -79,7 +95,15 @@
CREATEUSER AS createuser,
CREATEDATE AS createdate,
UPDATEUSER AS updateuser,
UPDATETIME AS updatetime
UPDATETIME AS updatetime,
SERVICENAME AS servicename,
BUILTFORM AS builtform,
FORMURL AS formurl,
FORMDETAIL AS formdetail,
FORMTYPE AS formtype,
PROCESSDEFINITIONID AS processdefinitionid,
TYPEDEPT AS typedept,
CATEGORY AS category
</sql>
<sql id="Base_Where">
@ -109,6 +133,14 @@
<if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if>
<if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if>
<if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if>
<if test="servicename != null"> and SERVICENAME ${servicename.dataOp} ${servicename.likestar}#{servicename.value}${servicename.likeend}</if>
<if test="builtform != null"> and BUILTFORM ${builtform.dataOp} ${builtform.likestar}#{builtform.value}${builtform.likeend}</if>
<if test="formurl != null"> and FORMURL ${formurl.dataOp} ${formurl.likestar}#{formurl.value}${formurl.likeend}</if>
<if test="formdetail != null"> and FORMDETAIL ${formdetail.dataOp} ${formdetail.likestar}#{formdetail.value}${formdetail.likeend}</if>
<if test="formtype != null"> and FORMTYPE ${formtype.dataOp} ${formtype.likestar}#{formtype.value}${formtype.likeend}</if>
<if test="processdefinitionid != null"> and PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}</if>
<if test="typedept != null"> and TYPEDEPT ${typedept.dataOp} ${typedept.likestar}#{typedept.value}${typedept.likeend}</if>
<if test="category != null"> and CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and DEPARTID in
@ -187,7 +219,15 @@
d.CREATEUSER AS createuser,
d.CREATEDATE AS createdate,
d.UPDATEUSER AS updateuser,
d.UPDATETIME AS updatetime
d.UPDATETIME AS updatetime,
d.SERVICENAME AS servicename,
d.BUILTFORM AS builtform,
d.FORMURL AS formurl,
d.FORMDETAIL AS formdetail,
d.FORMTYPE AS formtype,
d.PROCESSDEFINITIONID AS processdefinitionid,
d.TYPEDEPT AS typedept,
d.CATEGORY AS category
from S_DEPARTMENT_T d,S_USEROBJECT_T uo where uo.DEPARTID=d.ID and uo.USERID=#{id}
</select>
<!-- 查询机构启用的子集的机构信息 start-->
@ -216,7 +256,15 @@
dm.CREATEUSER AS createuser,
dm.CREATEDATE AS createdate,
dm.UPDATEUSER AS updateuser,
dm.UPDATETIME AS updatetime
dm.UPDATETIME AS updatetime,
dm.SERVICENAME AS servicename,
dm.BUILTFORM AS builtform,
dm.FORMURL AS formurl,
dm.FORMDETAIL AS formdetail,
dm.FORMTYPE AS formtype,
dm.PROCESSDEFINITIONID AS processdefinitionid,
dm.TYPEDEPT AS typedept,
dm.CATEGORY AS category
from S_DEPARTMENT_T dm,S_DEPARTMENTCHILD_T dmc where dm.ID = dmc.CHILDID and dmc.PARENTID = #{id} ORDER BY dm.SORTING DESC
</select>
</mapper>

@ -107,7 +107,7 @@
u.UPDATEUSER AS updateuser,
u.UPDATETIME AS updatetime,
u.PSDUPDATETIME AS psdupdatetime
from S_USER_T u RIGHT JOIN S_USEROBJECT_T uo ON uo.USERID = u.ID
from S_USER_T u
${ew.customSqlSegment}
</select>

@ -1,5 +1,7 @@
package cn.jyjz.flowable.config;
import cn.jyjz.xiaoyao.admin.dataobject.Department;
import cn.jyjz.xiaoyao.admin.service.DepartmentService;
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
import cn.jyjz.xiaoyao.oa.from.service.CategoryService;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
@ -21,6 +23,8 @@ public class GlobalEntityInitListener implements FlowableEventListener {
@Autowired
private CategoryService categoryService;
@Autowired
private DepartmentService departmentService;
@Override
public void onEvent(FlowableEvent flowableEvent) {
FlowableEventType type = flowableEvent.getType();
@ -37,9 +41,17 @@ public class GlobalEntityInitListener implements FlowableEventListener {
categoryService.updateById(category);
}
}
//更新机构与审批流的关联,使用“业务主体编码”与流程的“目标命名空间”字段保持一致
List<Department> departmentList = departmentService.listByDeptNo(processDefinitionEntity.getCategory());
if(null != departmentList && !departmentList.isEmpty()){
for (Department department:departmentList){
department.setServicename("taskchildPictureService");
department.setProcessdefinitionid(processDefinitionEntity.getId());
departmentService.updateDept(department);
}
}
}
}

@ -190,3 +190,22 @@ ALTER TABLE OA_USERAPPROVE_T ADD COLUMN TASKNO varchar(64) comment '节点编
INSERT INTO S_BACKSTAGEOPENURL_T(ID,URL,REMARK) VALUES(1196092352600928301, '/flow/task/listalldata', '查询我的待审批、审批历史');
update S_RESOURCES_T set RESOURCENAME='公司管理',RESOURCEDESC='公司管理' where ID=5;
update S_DEPARTMENT_T set DEPARTSHOTNAME='无量云',DEPARTNAME='无量云',DEPARTDESC='无量云说明',DEPARTADDRESS='无量云地址' where ID=0;
delete from S_RESOURCES_T where ID=1196092352600928256;
delete from S_RESOURCEMETHOD_T where RESOURCEID=1196092352600928256;
ALTER TABLE S_DEPARTMENT_T ADD COLUMN SERVICENAME varchar(190) comment '对应的Service名主要是spring的service名';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN BUILTFORM int comment '内置表单使用flowable表单0使用本地数据1使用flowable表单3:外置表单4其他自定义表单';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN FORMURL varchar(190) comment '表单地址,用户展示用户表单使用';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN FORMDETAIL varchar(190) comment '表单详情';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN FORMTYPE varchar(50) comment '表单分类';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN PROCESSDEFINITIONID varchar(64) comment '流程定义id';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN TYPEDEPT int default 1 comment '公司类型0租户1主体';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN TYPEDEPT int default 1 comment '公司类型0租户1主体';
ALTER TABLE S_DEPARTMENT_T ADD COLUMN CATEGORY varchar(190) not null comment '对应的工作流编码,与工作流中的命名空间对应';
INSERT INTO S_BACKSTAGEOPENURL_T(ID,URL,REMARK) VALUES(1196092352600928213, '/flow/definition/flowImg', '查看流程图');

Loading…
Cancel
Save