合并dev工作流引擎版本迭代,优化流程处理
This commit is contained in:
commit
42c2c756fa
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Copyright 2018 lenos
|
||||
* <p>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.len.actlistener;
|
||||
|
||||
import com.len.entity.ActAssignee;
|
||||
import com.len.entity.BaseTask;
|
||||
import com.len.entity.UserLeave;
|
||||
import com.len.service.ActAssigneeService;
|
||||
import com.len.service.impl.ActAssigneeServiceImpl;
|
||||
import com.len.util.AssigneeType;
|
||||
import com.len.util.SpringUtil;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhuxiaomeng
|
||||
* @date 2018/1/20.
|
||||
* @email 154040976@qq.com
|
||||
* <p>
|
||||
* 流程监听器 动态注入节点办理人
|
||||
*/
|
||||
public class ActStartNodeListener implements TaskListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
//KEY
|
||||
String nodeId = delegateTask.getTaskDefinitionKey();
|
||||
|
||||
Map<String, Object> variables = delegateTask.getVariables();
|
||||
BaseTask baseTask = (BaseTask) variables.get("baseTask");
|
||||
|
||||
delegateTask.setAssignee(baseTask.getUserId());
|
||||
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ import org.activiti.engine.RepositoryService;
|
|||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.activiti.image.HMProcessDiagramGenerator;
|
||||
import org.activiti.image.impl.DefaultProcessDiagramGenerator;
|
||||
import org.activiti.spring.ProcessEngineFactoryBean;
|
||||
import org.activiti.spring.SpringProcessEngineConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -53,6 +55,8 @@ public class ActivitiConfig {
|
|||
processEngineConfiguration.setAnnotationFontName("宋体");
|
||||
processEngineConfiguration.setLabelFontName("宋体");
|
||||
|
||||
processEngineConfiguration.setProcessDiagramGenerator(new DefaultProcessDiagramGenerator());
|
||||
|
||||
return processEngineConfiguration;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,28 +16,29 @@
|
|||
package com.len.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.len.base.BaseController;
|
||||
import com.len.base.CurrentUser;
|
||||
import com.len.core.shiro.ShiroUtil;
|
||||
import com.len.entity.BaseTask;
|
||||
import com.len.entity.LeaveOpinion;
|
||||
import com.len.entity.SysRoleUser;
|
||||
import com.len.entity.UserLeave;
|
||||
import com.len.exception.MyException;
|
||||
import com.len.service.RoleUserService;
|
||||
import com.len.service.UserLeaveService;
|
||||
import com.len.util.BeanUtil;
|
||||
import com.len.util.CommonUtil;
|
||||
import com.len.util.JsonUtil;
|
||||
import com.len.util.ReType;
|
||||
import com.len.util.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -49,9 +50,14 @@ import org.activiti.engine.history.HistoricProcessInstance;
|
|||
import org.activiti.engine.history.HistoricVariableUpdate;
|
||||
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.activiti.engine.impl.context.Context;
|
||||
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
|
||||
import org.activiti.engine.impl.pvm.PvmTransition;
|
||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.activiti.image.HMProcessDiagramGenerator;
|
||||
import org.activiti.image.ProcessDiagramGenerator;
|
||||
import org.activiti.image.impl.DefaultProcessDiagramGenerator;
|
||||
import org.activiti.spring.ProcessEngineFactoryBean;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -62,6 +68,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
/**
|
||||
* @author zhuxiaomeng
|
||||
|
@ -95,9 +102,23 @@ public class UserLeaveController extends BaseController {
|
|||
@Autowired
|
||||
ProcessEngineConfiguration processEngineConfiguration;
|
||||
|
||||
@Autowired
|
||||
RoleUserService roleUserService;
|
||||
|
||||
private String leaveOpinionList = "leaveOpinionList";
|
||||
|
||||
|
||||
@GetMapping(value = "showMain")
|
||||
public String showMain(Model model) {
|
||||
return "/dashboard/dashboard";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "showMain2")
|
||||
public String showMain2(Model model) {
|
||||
return "/dashboard/dashboard2";
|
||||
}
|
||||
|
||||
@GetMapping(value = "showLeave")
|
||||
public String showUser(Model model) {
|
||||
return "/act/leave/leaveList";
|
||||
|
@ -175,8 +196,8 @@ public class UserLeaveController extends BaseController {
|
|||
@GetMapping("updateLeave/{taskId}")
|
||||
public String updateLeave(Model model, @PathVariable String taskId) {
|
||||
Map<String, Object> variables = taskService.getVariables(taskId);
|
||||
UserLeave leave = (UserLeave) variables.get("userLeave");
|
||||
leave = leaveService.selectByPrimaryKey(leave.getId());
|
||||
BaseTask baseTask = (BaseTask) variables.get("baseTask");
|
||||
UserLeave leave = leaveService.selectByPrimaryKey(baseTask.getId());
|
||||
model.addAttribute("leave", leave);
|
||||
model.addAttribute("taskId", taskId);
|
||||
return "/act/leave/update-leave";
|
||||
|
@ -192,7 +213,7 @@ public class UserLeaveController extends BaseController {
|
|||
leaveService.updateByPrimaryKeySelective(oldLeave);
|
||||
|
||||
Map<String, Object> variables = taskService.getVariables(taskId);
|
||||
UserLeave userLeave = (UserLeave) variables.get("userLeave");
|
||||
// UserLeave userLeave = (UserLeave) variables.get("userLeave");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (flag) {
|
||||
map.put("flag", true);
|
||||
|
@ -222,14 +243,15 @@ public class UserLeaveController extends BaseController {
|
|||
userLeave.setUserId(user.getId());
|
||||
userLeave.setUserName(user.getUsername());
|
||||
userLeave.setProcessInstanceId("2018");//模拟数据
|
||||
|
||||
leaveService.insertSelective(userLeave);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("userLeave", userLeave);
|
||||
userLeave.setUrlpath("/leave/readOnlyLeave/"+userLeave.getId());
|
||||
map.put("baseTask",(BaseTask) userLeave);
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process_leave", map);
|
||||
userLeave.setProcessInstanceId(processInstance.getId());
|
||||
UserLeave userLeave1 = leaveService.selectByPrimaryKey(userLeave.getId());
|
||||
BeanUtil.copyNotNullBean(userLeave, userLeave1);
|
||||
userLeave1.setUrlpath("/leave/readOnlyLeave/"+userLeave.getId());
|
||||
leaveService.updateByPrimaryKeySelective(userLeave1);
|
||||
if (processInstance == null) {
|
||||
return JsonUtil.error("未识别key");
|
||||
|
@ -238,6 +260,13 @@ public class UserLeaveController extends BaseController {
|
|||
return j;
|
||||
}
|
||||
|
||||
@GetMapping("readOnlyLeave/{billId}")
|
||||
public String readOnlyLeave(Model model, @PathVariable String billId) {
|
||||
UserLeave leave = leaveService.selectByPrimaryKey(billId);
|
||||
model.addAttribute("leave", leave);
|
||||
return "/act/leave/update-leave-readonly";
|
||||
}
|
||||
|
||||
/**
|
||||
* ---------我的任务---------
|
||||
*/
|
||||
|
@ -250,29 +279,62 @@ public class UserLeaveController extends BaseController {
|
|||
@ResponseBody
|
||||
public String showTaskList(Model model, com.len.entity.Task task, String page, String limit) {
|
||||
CurrentUser user = CommonUtil.getUser();
|
||||
SysRoleUser sysRoleUser = new SysRoleUser();
|
||||
sysRoleUser.setUserId(user.getId());
|
||||
List<SysRoleUser> userRoles = roleUserService.selectByCondition(sysRoleUser);
|
||||
List<String> roleString = new ArrayList<String>();
|
||||
for(SysRoleUser sru:userRoles)
|
||||
{
|
||||
roleString.add(sru.getRoleId());
|
||||
}
|
||||
List<Task> taskList = taskService.createTaskQuery().taskCandidateUser(user.getId()).list();
|
||||
List<Task> assigneeList =taskService.createTaskQuery().taskAssignee(user.getId()).list();
|
||||
List<Task> candidateGroup =taskService.createTaskQuery().taskCandidateGroupIn(roleString).list();
|
||||
taskList.addAll(assigneeList);
|
||||
taskList.addAll(candidateGroup);
|
||||
List<com.len.entity.Task> tasks = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
com.len.entity.Task taskEntity = null;
|
||||
|
||||
Map<String, Map<String, Object>> mapMap = new HashMap<>();
|
||||
Map<String, Object> objectMap = null;
|
||||
Set<String> taskSet = new HashSet<String>();
|
||||
for (Task task1 : taskList) {
|
||||
objectMap = new HashMap<>();
|
||||
map = taskService.getVariables(task1.getId());
|
||||
UserLeave userLeave = (UserLeave) map.get("userLeave");
|
||||
String taskId = task1.getId();
|
||||
if(taskSet.contains(taskId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
map = taskService.getVariables(taskId);
|
||||
BaseTask userLeave = (BaseTask) map.get("baseTask");
|
||||
|
||||
taskEntity = new com.len.entity.Task(task1);
|
||||
taskEntity.setUserName(userLeave.getUserName());
|
||||
taskEntity.setReason(userLeave.getReason());
|
||||
taskEntity.setUrlpath(userLeave.getUrlpath());
|
||||
/**如果是自己*/
|
||||
if (user.getId().equals(userLeave.getUserId()) && !(boolean) map.get("flag")) {
|
||||
objectMap.put("flag", true);
|
||||
if (user.getId().equals(userLeave.getUserId()) ) {
|
||||
if( map.get("flag")!=null)
|
||||
{
|
||||
if(!(boolean) map.get("flag"))
|
||||
{
|
||||
objectMap.put("flag", true);
|
||||
}else
|
||||
{
|
||||
objectMap.put("flag", false);
|
||||
}
|
||||
}else
|
||||
{
|
||||
objectMap.put("flag", true);
|
||||
}
|
||||
} else {
|
||||
objectMap.put("flag", false);
|
||||
}
|
||||
mapMap.put(taskEntity.getId(), objectMap);
|
||||
tasks.add(taskEntity);
|
||||
taskSet.add(taskId);
|
||||
}
|
||||
return ReType.jsonStrng(taskList.size(), tasks, mapMap, "id");
|
||||
}
|
||||
|
@ -280,18 +342,18 @@ public class UserLeaveController extends BaseController {
|
|||
@GetMapping("agent/{id}")
|
||||
public String agent(Model model, @PathVariable("id") String taskId) {
|
||||
Map<String, Object> variables = taskService.getVariables(taskId);
|
||||
UserLeave userLeave = (UserLeave) variables.get("userLeave");
|
||||
userLeave = leaveService.selectByPrimaryKey(userLeave.getId());
|
||||
model.addAttribute("leave", userLeave);
|
||||
BaseTask baseTask = (BaseTask) variables.get("baseTask");
|
||||
// UserLeave userLeave = leaveService.selectByPrimaryKey(baseTask.getId());
|
||||
model.addAttribute("leaveUrl", baseTask.getUrlpath());
|
||||
model.addAttribute("taskId", taskId);
|
||||
return "/act/task/task-agent";
|
||||
return "/act/task/task-agent-iframe";
|
||||
}
|
||||
|
||||
@PostMapping("agent/complete")
|
||||
@ResponseBody
|
||||
public JsonUtil complete(LeaveOpinion op, HttpServletRequest request) {
|
||||
Map<String, Object> variables = taskService.getVariables(op.getTaskId());
|
||||
UserLeave userLeave = (UserLeave) variables.get("userLeave");
|
||||
|
||||
CurrentUser user = ShiroUtil.getCurrentUse();
|
||||
op.setCreateTime(new Date());
|
||||
op.setOpId(user.getId());
|
||||
|
@ -299,6 +361,22 @@ public class UserLeaveController extends BaseController {
|
|||
JsonUtil j = new JsonUtil();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("flag", op.isFlag());
|
||||
|
||||
//判断节点是否已经拒绝过一次了
|
||||
Object needend = variables.get("needend");
|
||||
if(needend!=null && (boolean ) needend && (!op.isFlag()) )
|
||||
{
|
||||
map.put("needfinish",-1); //结束
|
||||
}else
|
||||
{
|
||||
if(op.isFlag())
|
||||
{
|
||||
map.put("needfinish",1);//通过下一个节点
|
||||
}else
|
||||
{
|
||||
map.put("needfinish",0);//不通过
|
||||
}
|
||||
}
|
||||
//审批信息叠加
|
||||
List<LeaveOpinion> leaveList = new ArrayList<>();
|
||||
Object o = variables.get(leaveOpinionList);
|
||||
|
@ -317,7 +395,7 @@ public class UserLeaveController extends BaseController {
|
|||
|
||||
/**
|
||||
* 追踪图片成图
|
||||
*
|
||||
* 增加历史流程
|
||||
* @param request
|
||||
* @param resp
|
||||
* @param processInstanceId
|
||||
|
@ -326,45 +404,180 @@ public class UserLeaveController extends BaseController {
|
|||
@GetMapping("getProcImage")
|
||||
public void getProcImage(HttpServletRequest request, HttpServletResponse resp, String processInstanceId)
|
||||
throws IOException {
|
||||
InputStream imageStream = generateStream(request,resp,processInstanceId,true);
|
||||
if(imageStream==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
InputStream imageNoCurrentStream = generateStream(request,resp,processInstanceId,false);
|
||||
if(imageNoCurrentStream==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AnimatedGifEncoder e = new AnimatedGifEncoder();
|
||||
e.setTransparent(Color.BLACK);
|
||||
e.setRepeat(0);
|
||||
e.setQuality(19);
|
||||
e.start(resp.getOutputStream());
|
||||
|
||||
BufferedImage current = ImageIO.read(imageStream); // 读入需要播放的jpg文件
|
||||
e.addFrame(current); //添加到帧中
|
||||
|
||||
e.setDelay(200); //设置播放的延迟时间
|
||||
BufferedImage nocurrent = ImageIO.read(imageNoCurrentStream); // 读入需要播放的jpg文件
|
||||
e.addFrame(nocurrent); //添加到帧中
|
||||
|
||||
e.finish();
|
||||
|
||||
// byte[] b = new byte[1024];
|
||||
// int len;
|
||||
// while ((len = imageStream.read(b, 0, 1024)) != -1) {
|
||||
// resp.getOutputStream().write(b, 0, len);
|
||||
// }
|
||||
}
|
||||
|
||||
//只读图片页面
|
||||
@GetMapping("shinePics/{processInstanceId}")
|
||||
public String shinePics(Model model, @PathVariable String processInstanceId) {
|
||||
model.addAttribute("processInstanceId", processInstanceId);
|
||||
return "/act/leave/shinePics";
|
||||
}
|
||||
|
||||
@GetMapping("getShineProcImage")
|
||||
@ResponseBody
|
||||
public String getShineProcImage(HttpServletRequest request, HttpServletResponse resp, String processInstanceId)
|
||||
throws IOException {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray shineProImages = new JSONArray();
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
InputStream imageStream = generateStream(request,resp,processInstanceId,true);
|
||||
if(imageStream!=null)
|
||||
{
|
||||
String imageCurrentNode = Base64Utils.ioToBase64(imageStream);
|
||||
if(StringUtils.isNotBlank(imageCurrentNode))
|
||||
{
|
||||
shineProImages.add(imageCurrentNode);
|
||||
}
|
||||
}
|
||||
InputStream imageNoCurrentStream = generateStream(request,resp,processInstanceId,false);
|
||||
if(imageNoCurrentStream!=null)
|
||||
{
|
||||
String imageNoCurrentNode = Base64Utils.ioToBase64(imageNoCurrentStream);
|
||||
if(StringUtils.isNotBlank(imageNoCurrentNode))
|
||||
{
|
||||
shineProImages.add(imageNoCurrentNode);
|
||||
}
|
||||
}
|
||||
result.put("id",UUID.randomUUID().toString());
|
||||
result.put("errorNo",0);
|
||||
result.put("images",shineProImages);
|
||||
return result.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public InputStream generateStream(HttpServletRequest request, HttpServletResponse resp, String processInstanceId,boolean needCurrent)
|
||||
{
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
HistoricProcessInstance historicProcessInstance =
|
||||
historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
String processDefinitionId = null;
|
||||
List<String> executedActivityIdList = new ArrayList<String>();
|
||||
List<String> currentActivityIdList = new ArrayList<>();
|
||||
List<HistoricActivityInstance> historicActivityInstanceList = new ArrayList<>();
|
||||
if (processInstance != null) {
|
||||
processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
executedActivityIdList = this.runtimeService.getActiveActivityIds(processInstance.getId());
|
||||
} else if (historicProcessInstance != null) {
|
||||
processDefinitionId = historicProcessInstance.getProcessDefinitionId();
|
||||
List<HistoricActivityInstance> historicActivityInstanceList =
|
||||
historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).orderByHistoricActivityInstanceId().asc().list();
|
||||
for (HistoricActivityInstance activityInstance : historicActivityInstanceList) {
|
||||
executedActivityIdList.add(activityInstance.getActivityId());
|
||||
if(needCurrent)
|
||||
{
|
||||
currentActivityIdList = this.runtimeService.getActiveActivityIds(processInstance.getId());
|
||||
}
|
||||
} if (historicProcessInstance != null) {
|
||||
processDefinitionId = historicProcessInstance.getProcessDefinitionId();
|
||||
historicActivityInstanceList =
|
||||
historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).orderByHistoricActivityInstanceId().asc().list();
|
||||
for (HistoricActivityInstance activityInstance : historicActivityInstanceList) {
|
||||
executedActivityIdList.add(activityInstance.getActivityId());
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(processDefinitionId) || executedActivityIdList.isEmpty()) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
//高亮线路id集合
|
||||
ProcessDefinitionEntity definitionEntity = (ProcessDefinitionEntity)repositoryService.getProcessDefinition(processDefinitionId);
|
||||
List<String> highLightedFlows = getHighLightedFlows(definitionEntity,historicActivityInstanceList);
|
||||
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
|
||||
//List<String> activeActivityIds = runtimeService.getActiveActivityIds(processInstanceId);
|
||||
processEngineConfiguration = processEngine.getProcessEngineConfiguration();
|
||||
Context.setProcessEngineConfiguration((ProcessEngineConfigurationImpl) processEngineConfiguration);
|
||||
ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
|
||||
HMProcessDiagramGenerator diagramGenerator = (HMProcessDiagramGenerator) processEngineConfiguration.getProcessDiagramGenerator();
|
||||
//List<String> activeIds = this.runtimeService.getActiveActivityIds(processInstance.getId());
|
||||
|
||||
InputStream imageStream = diagramGenerator.generateDiagram(
|
||||
bpmnModel, "png",
|
||||
executedActivityIdList, Collections.<String>emptyList(),
|
||||
executedActivityIdList,highLightedFlows,
|
||||
processEngine.getProcessEngineConfiguration().getActivityFontName(),
|
||||
processEngine.getProcessEngineConfiguration().getLabelFontName(),
|
||||
"宋体",
|
||||
null, 1.0);
|
||||
byte[] b = new byte[1024];
|
||||
int len;
|
||||
while ((len = imageStream.read(b, 0, 1024)) != -1) {
|
||||
resp.getOutputStream().write(b, 0, len);
|
||||
}
|
||||
null, 1.0,currentActivityIdList);
|
||||
|
||||
return imageStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取需要高亮的线
|
||||
* @param processDefinitionEntity
|
||||
* @param historicActivityInstances
|
||||
* @return
|
||||
*/
|
||||
private List<String> getHighLightedFlows(
|
||||
ProcessDefinitionEntity processDefinitionEntity,
|
||||
List<HistoricActivityInstance> historicActivityInstances) {
|
||||
|
||||
List<String> highFlows = new ArrayList<String>();// 用以保存高亮的线flowId
|
||||
for (int i = 0; i < historicActivityInstances.size() - 1; i++) {// 对历史流程节点进行遍历
|
||||
ActivityImpl activityImpl = processDefinitionEntity
|
||||
.findActivity(historicActivityInstances.get(i)
|
||||
.getActivityId());// 得到节点定义的详细信息
|
||||
List<ActivityImpl> sameStartTimeNodes = new ArrayList<ActivityImpl>();// 用以保存后需开始时间相同的节点
|
||||
ActivityImpl sameActivityImpl1 = processDefinitionEntity
|
||||
.findActivity(historicActivityInstances.get(i + 1)
|
||||
.getActivityId());
|
||||
// 将后面第一个节点放在时间相同节点的集合里
|
||||
sameStartTimeNodes.add(sameActivityImpl1);
|
||||
for (int j = i + 1; j < historicActivityInstances.size() - 1; j++) {
|
||||
HistoricActivityInstance activityImpl1 = historicActivityInstances
|
||||
.get(j);// 后续第一个节点
|
||||
HistoricActivityInstance activityImpl2 = historicActivityInstances
|
||||
.get(j + 1);// 后续第二个节点
|
||||
if (activityImpl1.getStartTime().equals(
|
||||
activityImpl2.getStartTime())) {
|
||||
// 如果第一个节点和第二个节点开始时间相同保存
|
||||
ActivityImpl sameActivityImpl2 = processDefinitionEntity
|
||||
.findActivity(activityImpl2.getActivityId());
|
||||
sameStartTimeNodes.add(sameActivityImpl2);
|
||||
} else {
|
||||
// 有不相同跳出循环
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<PvmTransition> pvmTransitions = activityImpl
|
||||
.getOutgoingTransitions();// 取出节点的所有出去的线
|
||||
for (PvmTransition pvmTransition : pvmTransitions) {
|
||||
// 对所有的线进行遍历
|
||||
ActivityImpl pvmActivityImpl = (ActivityImpl) pvmTransition
|
||||
.getDestination();
|
||||
// 如果取出的线的目标节点存在时间相同的节点里,保存该线的id,进行高亮显示
|
||||
if (sameStartTimeNodes.contains(pvmActivityImpl)) {
|
||||
highFlows.add(pvmTransition.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return highFlows;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,222 @@
|
|||
package com.len.entity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by kingdee-001 on 2018/6/30.
|
||||
*/
|
||||
@MappedSuperclass
|
||||
public abstract class BaseTask implements Serializable{
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO,generator = "JDBC")
|
||||
protected String id;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
@Column(name = "user_id")
|
||||
protected String userId;
|
||||
|
||||
@Column(name = "user_name")
|
||||
protected String userName;
|
||||
|
||||
|
||||
|
||||
@Column(name = "process_instance_Id")
|
||||
protected String processInstanceId;
|
||||
|
||||
protected String status;
|
||||
|
||||
@Column(name = "create_date")
|
||||
protected Date createDate;
|
||||
|
||||
@Column(name = "create_by")
|
||||
protected String createBy;
|
||||
|
||||
@Column(name = "update_date")
|
||||
protected Date updateDate;
|
||||
|
||||
@Column(name = "update_by")
|
||||
protected String updateBy;
|
||||
|
||||
|
||||
protected String reason;
|
||||
|
||||
|
||||
//***实时节点信息
|
||||
protected String taskName;
|
||||
|
||||
|
||||
private String urlpath;
|
||||
|
||||
|
||||
private Integer submittimes;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return user_id
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userId
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return user_name
|
||||
*/
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userName
|
||||
*/
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName == null ? null : userName.trim();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return reason
|
||||
*/
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reason
|
||||
*/
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason == null ? null : reason.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return process_instance_Id
|
||||
*/
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param processInstanceId
|
||||
*/
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId == null ? null : processInstanceId.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return status
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return create_date
|
||||
*/
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createDate
|
||||
*/
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return create_by
|
||||
*/
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createBy
|
||||
*/
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy == null ? null : createBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return update_date
|
||||
*/
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateDate
|
||||
*/
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return update_by
|
||||
*/
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateBy
|
||||
*/
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy == null ? null : updateBy.trim();
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getUrlpath() {
|
||||
return urlpath;
|
||||
}
|
||||
|
||||
public void setUrlpath(String urlpath) {
|
||||
this.urlpath = urlpath;
|
||||
}
|
||||
|
||||
public Integer getSubmittimes() {
|
||||
return submittimes;
|
||||
}
|
||||
|
||||
public void setSubmittimes(Integer submittimes) {
|
||||
this.submittimes = submittimes;
|
||||
}
|
||||
}
|
|
@ -43,7 +43,7 @@ public class Task {
|
|||
|
||||
private String userName;
|
||||
private String reason;
|
||||
|
||||
private String urlpath;
|
||||
public Task() {
|
||||
}
|
||||
public Task(org.activiti.engine.task.Task t) {
|
||||
|
|
|
@ -7,16 +7,29 @@ import java.util.List;
|
|||
import javax.persistence.*;
|
||||
|
||||
@Table(name = "user_leave")
|
||||
public class UserLeave implements Serializable {
|
||||
public class UserLeave extends BaseTask {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private String id;
|
||||
@GeneratedValue(strategy = GenerationType.AUTO,generator = "JDBC")
|
||||
protected String id;
|
||||
|
||||
@Column(name = "user_id")
|
||||
private String userId;
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Column(name = "user_name")
|
||||
private String userName;
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
private Integer days;
|
||||
|
||||
@Column(name = "begin_time")
|
||||
private Date beginTime;
|
||||
|
@ -24,10 +37,6 @@ public class UserLeave implements Serializable {
|
|||
@Column(name = "end_time")
|
||||
private Date endTime;
|
||||
|
||||
private String reason;
|
||||
|
||||
private Integer days;
|
||||
|
||||
@Column(name = "process_instance_Id")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -49,13 +58,7 @@ public class UserLeave implements Serializable {
|
|||
@Transient
|
||||
private String taskName;
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
//请假单审核信息
|
||||
private List<LeaveOpinion> opinionList=new ArrayList<>();
|
||||
|
@ -76,89 +79,6 @@ public class UserLeave implements Serializable {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return user_id
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userId
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return user_name
|
||||
*/
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userName
|
||||
*/
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName == null ? null : userName.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return begin_time
|
||||
*/
|
||||
public Date getBeginTime() {
|
||||
return beginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param beginTime
|
||||
*/
|
||||
public void setBeginTime(Date beginTime) {
|
||||
this.beginTime = beginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return end_time
|
||||
*/
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param endTime
|
||||
*/
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return reason
|
||||
*/
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reason
|
||||
*/
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason == null ? null : reason.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return days
|
||||
|
@ -174,87 +94,24 @@ public class UserLeave implements Serializable {
|
|||
this.days = days;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return process_instance_Id
|
||||
*/
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId;
|
||||
|
||||
|
||||
public Date getBeginTime() {
|
||||
return beginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param processInstanceId
|
||||
*/
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId == null ? null : processInstanceId.trim();
|
||||
|
||||
public void setBeginTime(Date beginTime) {
|
||||
this.beginTime = beginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return status
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return create_date
|
||||
*/
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createDate
|
||||
*/
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return create_by
|
||||
*/
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createBy
|
||||
*/
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy == null ? null : createBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return update_date
|
||||
*/
|
||||
public Date getUpdateDate() {
|
||||
return updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateDate
|
||||
*/
|
||||
public void setUpdateDate(Date updateDate) {
|
||||
this.updateDate = updateDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return update_by
|
||||
*/
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateBy
|
||||
*/
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy == null ? null : updateBy.trim();
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,32 @@
|
|||
package com.len.util;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import sun.misc.BASE64Decoder;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Created by user on 2018/7/12.
|
||||
*/
|
||||
public class Base64Utils {
|
||||
private static Logger logger = Logger.getLogger(Base64Utils.class);
|
||||
private static BASE64Encoder encoder = new BASE64Encoder();
|
||||
|
||||
public static String ioToBase64(InputStream in) throws IOException {
|
||||
String strBase64 = null;
|
||||
try {
|
||||
byte[] bytes = new byte[in.available()];
|
||||
// 将文件中的内容读入到数组中
|
||||
in.read(bytes);
|
||||
strBase64 = encoder.encode(bytes); //将字节流数组转换为字符串
|
||||
in.close();
|
||||
} catch (IOException ioe) {
|
||||
logger.error("图片转64编码异常",ioe);
|
||||
}
|
||||
return strBase64;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.activiti.image;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
|
||||
/**
|
||||
* This interface declares methods to generate process diagram
|
||||
*
|
||||
* @author martin.grofcik
|
||||
* @author Tijs Rademakers
|
||||
*/
|
||||
public interface HMProcessDiagramGenerator extends ProcessDiagramGenerator{
|
||||
|
||||
/**
|
||||
* Generates a diagram of the given process definition, using the
|
||||
* diagram interchange information of the process.
|
||||
* @param bpmnModel bpmn model to get diagram for
|
||||
* @param imageType type of the image to generate.
|
||||
* @param highLightedActivities activities to highlight
|
||||
* @param highLightedFlows flows to highlight
|
||||
* @param activityFontName override the default activity font
|
||||
* @param labelFontName override the default label font
|
||||
* @param annotationFontName override the default annotation font
|
||||
* @param customClassLoader provide a custom classloader for retrieving icon images
|
||||
*/
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows,
|
||||
String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor);
|
||||
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows,
|
||||
String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor,List<String> currentHighlightdActivities);
|
||||
|
||||
/**
|
||||
* Generates a diagram of the given process definition, using the
|
||||
* diagram interchange information of the process.
|
||||
* @param bpmnModel bpmn model to get diagram for
|
||||
* @param imageType type of the image to generate.
|
||||
* @param highLightedActivities activities to highlight
|
||||
* @param highLightedFlows flows to highlight
|
||||
*/
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows);
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities,
|
||||
List<String> highLightedFlows, double scaleFactor);
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities);
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, double scaleFactor);
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader);
|
||||
|
||||
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName,
|
||||
String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor);
|
||||
|
||||
public InputStream generatePngDiagram(BpmnModel bpmnModel);
|
||||
|
||||
public InputStream generatePngDiagram(BpmnModel bpmnModel, double scaleFactor);
|
||||
|
||||
public InputStream generateJpgDiagram(BpmnModel bpmnModel);
|
||||
|
||||
public InputStream generateJpgDiagram(BpmnModel bpmnModel, double scaleFactor);
|
||||
|
||||
public BufferedImage generatePngImage(BpmnModel bpmnModel, double scaleFactor);
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
* @author Tijs Rademakers
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("service")
|
||||
@RequestMapping("/service")
|
||||
public class StencilsetRestResource {
|
||||
|
||||
@RequestMapping(value="/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
* @author Tijs Rademakers
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("service")
|
||||
@RequestMapping("/service")
|
||||
@Slf4j
|
||||
public class ModelEditorJsonRestResource implements ModelDataJsonConstants {
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
* @author Tijs Rademakers
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("service")
|
||||
@RequestMapping("/service")
|
||||
@Slf4j
|
||||
public class ModelSaveRestResource implements ModelDataJsonConstants {
|
||||
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>新建业绩申报</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:100%;height:400px;overflow: auto;">
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">业绩申报信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="customer" class="layui-form-label">
|
||||
选择客户
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<#--<input type="hidden" name="customerId" id="customerId">-->
|
||||
<#--<input type="hidden" name="customerName" id="customerName">-->
|
||||
<select id="customer" name="customerId" lay-verify="required" lay-filter="customerFilter">
|
||||
<option value="">请选择一个客户</option>
|
||||
<#list customerList as cl>
|
||||
<option value="${cl.id}">${cl.customerName}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="product" class="layui-form-label">
|
||||
选择产品
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<#--<input type="hidden" name="productId" id="productId">-->
|
||||
<#--<input type="hidden" name="productName" id="productName">-->
|
||||
<select id="product" name="productId" lay-verify="required" lay-filter="productFilter">
|
||||
<option value="">请选择一个产品</option>
|
||||
<#list productList as cl>
|
||||
<option value="${cl.id}">${cl.productName}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">申报原因</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="reason" class="layui-form-label">
|
||||
<span class="x-red">*</span>申报原因
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="reason" style="width: 300px;" name="reason" lay-verify="reason"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 60px"></div>
|
||||
</div>
|
||||
<div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;
|
||||
position: fixed;bottom: 1px;margin-left:-20px;">
|
||||
<div class="layui-form-item" style=" float: right;margin-right: 30px;margin-top: 8px">
|
||||
|
||||
<button class="layui-btn layui-btn-normal" lay-filter="add" lay-submit>
|
||||
申请
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary" data-type="close">
|
||||
取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layer'], function () {
|
||||
$ = layui.jquery;
|
||||
var form = layui.form
|
||||
, layer = layui.layer
|
||||
, laydate = layui.laydate;
|
||||
var d = new Date();
|
||||
var day = d.getFullYear() + "-" + (parseInt(d.getMonth()) + 1) + '-' + d.getDate();
|
||||
console.log(day);
|
||||
var $ = layui.$, active = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
}
|
||||
$('.layui-form-item .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
form.render('select');
|
||||
|
||||
form.on('select(customerFilter)', function(data){
|
||||
$('#customerId').val(data.value);
|
||||
$("#customerName").val($(data.elem).find("option:selected").text());
|
||||
});
|
||||
|
||||
form.on('select(productFilter)', function(data){
|
||||
$('#productId').val(data.value);
|
||||
$("#productName").val($(data.elem).find("option:selected").text());
|
||||
});
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
reason: function (value) {
|
||||
if (value.trim() == "") {
|
||||
return "请填写请假原因";
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('submit(close)', function (data) {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(add)', function (data) {
|
||||
$.ajax({
|
||||
url: 'addDeclare',
|
||||
type: 'post',
|
||||
data: data.field,
|
||||
async: false, traditional: true,
|
||||
success: function (d) {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
if (d.flag) {
|
||||
parent.layer.close(index);
|
||||
window.parent.layui.table.reload('delcareList');
|
||||
window.top.layer.msg(d.msg, {icon: 6, offset: 'rb', area: ['120px', '80px'], anim: 2});
|
||||
} else {
|
||||
layer.msg(d.msg, {icon: 5});
|
||||
}
|
||||
}, error: function () {
|
||||
layer.alert("请求失败", {icon: 6}, function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,256 @@
|
|||
<#-- Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2018/1/15
|
||||
Time: 16:53
|
||||
To change this template use File | Settings | File Templates.
|
||||
流程部署-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>业绩申报流程</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/lenos/main.css"/>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="lenos-search">
|
||||
<div class="select">
|
||||
<#--开始时间:-->
|
||||
<#--<div class="layui-inline">-->
|
||||
<#--<input class="layui-input" placeholder="yyyy-MM-dd" height="20px" id="beginTime" autocomplete="off">-->
|
||||
<#--</div>-->
|
||||
<#--结束时间:-->
|
||||
<#--<div class="layui-inline">-->
|
||||
<#--<input class="layui-input" placeholder="yyyy-MM-dd" height="20px" id="endTime" autocomplete="off">-->
|
||||
<#--</div>-->
|
||||
<#--<button class="select-on layui-btn layui-btn-sm" data-type="select"><i class="layui-icon"></i>-->
|
||||
<#--</button>-->
|
||||
<button class="layui-btn layui-btn-sm icon-position-button" id="refresh" style="float: right;"
|
||||
data-type="reload">
|
||||
<i class="layui-icon">ဂ</i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-btn-group">
|
||||
<button class="layui-btn layui-btn-normal" data-type="createDeclare">
|
||||
<i class="layui-icon"></i>新建业绩申报
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="delcareList" class="layui-hide" lay-filter="delcare"></table>
|
||||
<script type="text/html" id="toolBar">
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="getProcImage"><i class="layui-icon"></i>查看流程图</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delcareDetail"><i class="layui-icon"></i>查看审批详情</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delcareBillDetail"><i class="layui-icon"></i>查看单据详情</a>
|
||||
</script>
|
||||
<script type="text/html" id="status">
|
||||
{{#if(typeof(d.taskName)!='undefined'){}}
|
||||
<div>${d.taskName}</div>
|
||||
{{# }else{}}
|
||||
结束
|
||||
{{# }}}
|
||||
</script>
|
||||
<script>
|
||||
layui.laytpl.toDateString = function (d, format) {
|
||||
var date = new Date(d || new Date())
|
||||
, ymd = [
|
||||
this.digit(date.getFullYear(), 4)
|
||||
, this.digit(date.getMonth() + 1)
|
||||
, this.digit(date.getDate())
|
||||
]
|
||||
, hms = [
|
||||
this.digit(date.getHours())
|
||||
, this.digit(date.getMinutes())
|
||||
, this.digit(date.getSeconds())
|
||||
];
|
||||
|
||||
format = format || 'yyyy-MM-dd HH:mm:ss';
|
||||
|
||||
return format.replace(/yyyy/g, ymd[0])
|
||||
.replace(/MM/g, ymd[1])
|
||||
.replace(/dd/g, ymd[2])
|
||||
.replace(/HH/g, hms[0])
|
||||
.replace(/mm/g, hms[1])
|
||||
.replace(/ss/g, hms[2]);
|
||||
};
|
||||
|
||||
//数字前置补零
|
||||
layui.laytpl.digit = function (num, length, end) {
|
||||
var str = '';
|
||||
num = String(num);
|
||||
length = length || 2;
|
||||
for (var i = num.length; i < length; i++) {
|
||||
str += '0';
|
||||
}
|
||||
return num < Math.pow(10, length) ? str + (num | 0) : num;
|
||||
};
|
||||
|
||||
document.onkeydown = function (e) { // 回车提交表单
|
||||
var theEvent = window.event || e;
|
||||
var code = theEvent.keyCode || theEvent.which;
|
||||
if (code == 13) {
|
||||
$(".select .select-on").click();
|
||||
}
|
||||
}
|
||||
|
||||
layui.use('table', function () {
|
||||
var table = layui.table, laydate = layui.laydate;
|
||||
// var a = laydate.render({
|
||||
// elem: '#beginTime',
|
||||
// done: function(value, date, endDate) {
|
||||
// b.config.min = {
|
||||
// year: date.year,
|
||||
// month: date.month - 1,
|
||||
// date: date.date,
|
||||
// hours: date.hours,
|
||||
// minutes: date.minutes,
|
||||
// seconds: date.seconds
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// var b = laydate.render({
|
||||
// elem: '#endTime'
|
||||
// });
|
||||
//方法级渲染
|
||||
table.render({
|
||||
id: 'delcareList',
|
||||
elem: '#delcareList',
|
||||
url: 'showDeclareList',
|
||||
cols: [[
|
||||
{checkbox: true, fixed: true, width: '5%'},
|
||||
{field: 'userName', title: '申请人', width: '10%', sort: true},
|
||||
{
|
||||
field: 'createDate',
|
||||
title: '创建时间',
|
||||
width: '10%',
|
||||
sort: true,
|
||||
templet: '<div>{{ layui.laytpl.toDateString(d.beginTime,"yyyy-MM-dd") }}</div>'
|
||||
},
|
||||
{field: 'taskName', title: '状态', width: '10%', templet: '#status'},
|
||||
{field: 'reason', title: '原因', width: '10%', sort: true},
|
||||
{field: 'processInstanceId', title: '流程定义id', width: '10%', sort: true},
|
||||
{field: 'text', title: '操作', width: '35%', toolbar: '#toolBar'}
|
||||
|
||||
]],
|
||||
page: true,
|
||||
height: 'full-84'
|
||||
});
|
||||
|
||||
var $ = layui.$, active = {
|
||||
// select: function () {
|
||||
// var beginTime = $('#beginTime').val();
|
||||
// var endTime = $('#endTime').val();
|
||||
// table.reload('leaveList', {
|
||||
// where: {
|
||||
// beginTime: beginTime,
|
||||
// endTime: endTime
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
createDeclare: function () {
|
||||
add("申请业绩申报", 'addDeclare', 700, 450);
|
||||
},
|
||||
reload: function () {
|
||||
table.reload('delcareList', {
|
||||
where: {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//监听工具条
|
||||
table.on('tool(delcare)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'start') {
|
||||
start(data.key);
|
||||
} else if (obj.event === 'getProcImage') {
|
||||
// var url = '${re.contextPath}/leave/getShineProcImage?processInstanceId=' + data.processInstanceId + '';
|
||||
layer.open({
|
||||
id: 'delcare-image',
|
||||
type: 2,
|
||||
area: ['880px', '400px'],
|
||||
fix: false,
|
||||
maxmin: true,
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: '流程图',
|
||||
content: '${re.contextPath}/leave/shinePics/' + data.processInstanceId
|
||||
});
|
||||
} else if (obj.event === 'delcareDetail') {
|
||||
layer.open({
|
||||
id: 'delcare-detail',
|
||||
type: 2,
|
||||
area: ['880px', '400px'],
|
||||
fix: false,
|
||||
maxmin: true,
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: '审核详情',
|
||||
content: "${re.contextPath}/leave/leaveDetail?processId=" + data.processInstanceId
|
||||
});
|
||||
}else if(obj.event ==='delcareBillDetail')
|
||||
{
|
||||
layer.open({
|
||||
id: 'delcare-infodetail',
|
||||
type: 2,
|
||||
area: ['880px', '400px'],
|
||||
fix: false,
|
||||
maxmin: true,
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: '单据详情',
|
||||
content: "readOnlyLeave/"+data.id
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
eleClick(active, '.layui-col-md12 .layui-btn');
|
||||
eleClick(active, '.select .layui-btn');
|
||||
|
||||
});
|
||||
|
||||
function add(title, url, w, h) {
|
||||
if (title == null || title == '') {
|
||||
title = false;
|
||||
}
|
||||
;
|
||||
if (url == null || url == '') {
|
||||
url = "404.html";
|
||||
}
|
||||
;
|
||||
if (w == null || w == '') {
|
||||
w = ($(window).width() * 0.9);
|
||||
}
|
||||
;
|
||||
if (h == null || h == '') {
|
||||
h = ($(window).height() - 50);
|
||||
}
|
||||
;
|
||||
layer.open({
|
||||
id: 'delcare-add',
|
||||
type: 2,
|
||||
area: [w + 'px', h + 'px'],
|
||||
fix: false,
|
||||
maxmin: true,
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: title,
|
||||
content: url
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,165 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>业绩申报查看</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:100%;height:400px;overflow: auto;">
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">业绩申报信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="customer" class="layui-form-label">
|
||||
选择客户
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<input type="hidden" name="customerId" id="customerId">
|
||||
<input type="hidden" name="customerName" id="customerName">
|
||||
<select disabled readonly="readonly" id="customer" name="customer" lay-verify="required" lay-filter="customerFilter">
|
||||
<option value="">未选择客户</option>
|
||||
<#list customerList as cl>
|
||||
<option value="${cl.id}" <#if cl.id == declare.customerId>selected = selected"</#if> >${cl.customerName}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="product" class="layui-form-label">
|
||||
选择产品
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<input type="hidden" name="productId" id="productId">
|
||||
<input type="hidden" name="productName" id="productName">
|
||||
<select disabled readonly="readonly" id="product" name="product" lay-verify="required" lay-filter="productFilter">
|
||||
<option value="">未选择产品</option>
|
||||
<#list productList as cl>
|
||||
|
||||
<option value="${cl.id}" <#if cl.id == declare.productId>selected = selected"</#if> >${cl.productName} </option>
|
||||
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="endTime" class="layui-form-label">
|
||||
<span class="x-red">*</span>结束时间
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" disabled readonly="readonly" id="endTime" name="endTime" lay-verify="endTime" placeholder="yyyy-MM-dd"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">申报原因</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="reason" class="layui-form-label">
|
||||
<span class="x-red">*</span>申报原因
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="reason" disabled readonly="readonly" style="width: 300px;" name="reason" lay-verify="reason" value="${declare.reason}"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 60px"></div>
|
||||
</div>
|
||||
<#--<div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;-->
|
||||
<#--position: fixed;bottom: 1px;margin-left:-20px;">-->
|
||||
<#--<div class="layui-form-item" style=" float: right;margin-right: 30px;margin-top: 8px">-->
|
||||
<#--<button class="layui-btn layui-btn-normal" lay-filter="add" lay-submit>-->
|
||||
<#--重新提交-->
|
||||
<#--</button>-->
|
||||
<#--<button class="layui-btn layui-btn-normal" lay-filter="closeDeclare" lay-submit>-->
|
||||
<#--取消请假-->
|
||||
<#--</button>-->
|
||||
<#--<button class="layui-btn layui-btn-primary" data-type="close">-->
|
||||
<#--取消-->
|
||||
<#--</button>-->
|
||||
<#--</div>-->
|
||||
<#--</div>-->
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layer'], function () {
|
||||
$ = layui.jquery;
|
||||
var form = layui.form
|
||||
, layer = layui.layer
|
||||
, laydate = layui.laydate;
|
||||
var d = new Date();
|
||||
var day = d.getFullYear() + "-" + (parseInt(d.getMonth()) + 1) + '-' + d.getDate();
|
||||
console.log(day);
|
||||
var $ = layui.$, active = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
}
|
||||
$('.layui-form-item .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
form.render('select');
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
reason: function (value) {
|
||||
if (value.trim() == "") {
|
||||
return "请填写原因";
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('submit(close)', function (data) {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(add)', function (data) {
|
||||
layerAjax('updateDeclare/${taskId}/${declare.id}/true', data.field, 'taskList');
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('submit(closeDeclare)', function (data) {
|
||||
layerAjax('updateDeclare/${taskId}/${leave.id}/false', data.field, 'taskList');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,165 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>业绩申报查看</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:100%;height:400px;overflow: auto;">
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">业绩申报信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="customer" class="layui-form-label">
|
||||
选择客户
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<input type="hidden" name="customerId" id="customerId">
|
||||
<input type="hidden" name="customerName" id="customerName">
|
||||
<select id="customer" name="customer" lay-verify="required" lay-filter="customerFilter">
|
||||
<option value="">未选择客户</option>
|
||||
<#list customerList as cl>
|
||||
<option value="${cl.id}" <#if cl.id == declare.customerId>selected = selected"</#if> >${cl.customerName}</option>
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="product" class="layui-form-label">
|
||||
选择产品
|
||||
</label>
|
||||
<div class="layui-input-block layui-form">
|
||||
<input type="hidden" name="productId" id="productId">
|
||||
<input type="hidden" name="productName" id="productName">
|
||||
<select id="product" name="product" lay-verify="required" lay-filter="productFilter">
|
||||
<option value="">未选择产品</option>
|
||||
<#list productList as cl>
|
||||
|
||||
<option value="${cl.id}" <#if cl.id == declare.productId>selected = selected"</#if> >${cl.productName} </option>
|
||||
|
||||
</#list>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="endTime" class="layui-form-label">
|
||||
<span class="x-red">*</span>结束时间
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="endTime" name="endTime" lay-verify="endTime" placeholder="yyyy-MM-dd"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">申报原因</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="reason" class="layui-form-label">
|
||||
<span class="x-red">*</span>申报原因
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="reason" style="width: 300px;" name="reason" lay-verify="reason" value="${declare.reason}"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 60px"></div>
|
||||
</div>
|
||||
<div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;
|
||||
position: fixed;bottom: 1px;margin-left:-20px;">
|
||||
<div class="layui-form-item" style=" float: right;margin-right: 30px;margin-top: 8px">
|
||||
<button class="layui-btn layui-btn-normal" lay-filter="add" lay-submit>
|
||||
重新提交
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-filter="closeDeclare" lay-submit>
|
||||
取消请假
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary" data-type="close">
|
||||
取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layer'], function () {
|
||||
$ = layui.jquery;
|
||||
var form = layui.form
|
||||
, layer = layui.layer
|
||||
, laydate = layui.laydate;
|
||||
var d = new Date();
|
||||
var day = d.getFullYear() + "-" + (parseInt(d.getMonth()) + 1) + '-' + d.getDate();
|
||||
console.log(day);
|
||||
var $ = layui.$, active = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
}
|
||||
$('.layui-form-item .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
form.render('select');
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
reason: function (value) {
|
||||
if (value.trim() == "") {
|
||||
return "请填写原因";
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('submit(close)', function (data) {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(add)', function (data) {
|
||||
layerAjax('updateDeclare/${taskId}/${declare.id}/true', data.field, 'taskList');
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('submit(closeDeclare)', function (data) {
|
||||
layerAjax('updateDeclare/${taskId}/${leave.id}/false', data.field, 'taskList');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -174,17 +174,17 @@
|
|||
if (obj.event === 'start') {
|
||||
start(data.key);
|
||||
}else if(obj.event === 'getProcImage'){
|
||||
var url='getProcImage?processInstanceId='+data.processInstanceId+'';
|
||||
// var url='getProcImage?processInstanceId='+data.processInstanceId+'';
|
||||
layer.open({
|
||||
id: 'leave-image',
|
||||
type: 1,
|
||||
type: 2,
|
||||
area: [ '880px', '400px'],
|
||||
fix: false,
|
||||
maxmin: true,
|
||||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: '流程图',
|
||||
content: "<img src='"+url+"'/>"
|
||||
content: '${re.contextPath}/leave/shinePics/' + data.processInstanceId
|
||||
});
|
||||
}else if(obj.event==='leaveDetail'){
|
||||
layer.open({
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>流程图</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:100%;height:400px;overflow: auto;">
|
||||
<div class="layui-form-item">
|
||||
<image id="showImages1" style="display: none;"></image>
|
||||
<image id="showImages2"></image>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var countNum = 0;
|
||||
layui.use(['form','layer'], function(){
|
||||
$ = layui.jquery;
|
||||
//执行AJAX 获取数据
|
||||
$.getJSON('${re.contextPath}/leave/getShineProcImage?processInstanceId=${processInstanceId}', function(json){
|
||||
var result = json.images;
|
||||
var imgObj1 = document.getElementById("showImages1")
|
||||
imgObj1.src = "data:image/png;base64,"+result[0] ;
|
||||
var imgObj2 = document.getElementById("showImages2")
|
||||
imgObj2.src = "data:image/png;base64,"+result[1] ;
|
||||
// $("#showImages1").show();
|
||||
window.setInterval(function () {
|
||||
//获取网页中id=myImg的图片对象元素
|
||||
// var imgObj = document.getElementById("showImages")
|
||||
// imgObj.src = "data:image/png;base64,"+result[countNum] ;
|
||||
if(countNum==0)
|
||||
{
|
||||
$("#showImages1").show();
|
||||
$("#showImages2").hide();
|
||||
}else
|
||||
{
|
||||
$("#showImages1").hide();
|
||||
$("#showImages2").show();
|
||||
}
|
||||
countNum++;
|
||||
if (countNum==2)
|
||||
{
|
||||
countNum = 0;//回到了原点
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,143 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>编辑请假</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:100%;height:400px;overflow: auto;">
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">请假信息</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="beginTime" class="layui-form-label">
|
||||
<span class="x-red">*</span>开始时间
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="id" type="hidden" value="${leave.id}">
|
||||
<input type="text" id="beginTime" readonly disabled value="${leave.beginTime?string("yyyy-MM-dd")}" name="beginTime" lay-verify="beginTime" placeholder="yyyy-MM-dd"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="endTime" class="layui-form-label">
|
||||
<span class="x-red">*</span>结束时间
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="endTime" readonly disabled value="${leave.endTime?string("yyyy-MM-dd")}" name="endTime" lay-verify="endTime" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
|
||||
<legend style="font-size:16px;">原因</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label for="reason" class="layui-form-label">
|
||||
<span class="x-red">*</span>请假原因
|
||||
</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" readonly disabled id="reason" value="${leave.reason}" style="width: 300px;" name="reason" lay-verify="reason" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 60px"></div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form','layer'], function(){
|
||||
$ = layui.jquery;
|
||||
var form = layui.form
|
||||
,layer = layui.layer
|
||||
,laydate = layui.laydate;
|
||||
var d = new Date();
|
||||
var day=d.getFullYear()+"-"+(parseInt(d.getMonth())+1)+'-'+d.getDate();
|
||||
var $ = layui.$, active = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
}
|
||||
$('.layui-form-item .layui-btn').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
var a = laydate.render({
|
||||
elem: '#beginTime',
|
||||
min:day,
|
||||
done: function(value, date, endDate) {
|
||||
b.config.min = {
|
||||
year: date.year,
|
||||
month: date.month - 1,
|
||||
date: date.date,
|
||||
hours: date.hours,
|
||||
minutes: date.minutes,
|
||||
seconds: date.seconds
|
||||
}
|
||||
}
|
||||
});
|
||||
var b = laydate.render({
|
||||
elem: '#endTime',
|
||||
min: '2018-01-20'
|
||||
});
|
||||
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
beginTime: function(value){
|
||||
if(value.trim()==""){
|
||||
return "开始时间不能为空";
|
||||
}
|
||||
},
|
||||
endTime:function(value) {
|
||||
if (value.trim() == "") {
|
||||
return "结束时间不能为空";
|
||||
}
|
||||
},
|
||||
reason:function(value){
|
||||
if(value.trim()==""){
|
||||
return "请填写请假原因";
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('submit(close)',function (data) {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(add)', function(data){
|
||||
layerAjax('updateLeave/${taskId}/${leave.id}/true',data.field,'taskList');
|
||||
return false;
|
||||
}); form.on('submit(closeLeave)', function(data){
|
||||
layerAjax('updateLeave/${taskId}/${leave.id}/false',data.field,'taskList');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,95 @@
|
|||
<#--Created by IntelliJ IDEA.
|
||||
User: zxm
|
||||
Date: 2017/12/20
|
||||
Time: 10:00
|
||||
To change this template use File | Settings | File Templates.-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>办理任务</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="${re.contextPath}/plugin/ztree/css/metroStyle/metroStyle.css">
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
|
||||
<div style="width:100%; height:320px;overflow: hidden;">
|
||||
<iframe style="width:100%;height:100%;border: none;" src="${leaveUrl}"></iframe>
|
||||
</div>
|
||||
|
||||
<form class="layui-form layui-form-pane" style="margin-left: 20px;">
|
||||
<div style="width:98%;height:80px;overflow: hidden;">
|
||||
<input type="hidden" name="taskId" value="${taskId}">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">审批意见</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="opinion" id="opinion" lay-verify="opinion" class="layui-textarea" style="min-height: 30px;height: 30px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;height: 55px;background-color: white;border-top:1px solid #e6e6e6;
|
||||
position: fixed;bottom: 1px;margin-left:-20px;">
|
||||
<div class="layui-form-item" style=" float: right;margin-right: 10px;margin-top: 8px">
|
||||
<input name="flag" type="hidden">
|
||||
<button class="layui-btn layui-btn-normal" lay-filter="ok" lay-submit>
|
||||
通过
|
||||
</button><button class="layui-btn layui-btn-normal" lay-filter="no" lay-submit>
|
||||
不通过
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-primary" data-type="close">
|
||||
取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form','layer'], function(){
|
||||
$ = layui.jquery;
|
||||
var form = layui.form
|
||||
,layer = layui.layer;
|
||||
|
||||
|
||||
//自定义验证规则
|
||||
form.verify({
|
||||
opinion: function(value){
|
||||
if(value.trim()==""){
|
||||
return "审核信息不能为空";
|
||||
}
|
||||
}
|
||||
});
|
||||
var $ = layui.$, active = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
}
|
||||
eleClick(active,'.layui-form-item .layui-btn');
|
||||
|
||||
form.on('submit(no)',function(data){
|
||||
data.field.flag=false;
|
||||
layerAjax('complete',data.field,'taskList');
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('submit(ok)', function(data){
|
||||
data.field.flag=true;
|
||||
layerAjax('complete',data.field,'taskList');
|
||||
return false;
|
||||
});
|
||||
form.render();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -156,7 +156,7 @@
|
|||
if (obj.event === 'handle') {
|
||||
popup('办理','agent/'+data.id,700,500,'task-agent');
|
||||
}else if(obj.event === 'update'){
|
||||
popup('编辑','updateLeave/'+data.id,700,500,'task-update');
|
||||
popup('编辑','${re.contextPath}/leave/updateLeave/'+data.id,700,500,'task-update');
|
||||
}else if(obj.event==='leaveDetail'){
|
||||
layer.open({
|
||||
id: 'leave-detail',
|
||||
|
@ -167,7 +167,7 @@
|
|||
shadeClose: false,
|
||||
shade: 0.4,
|
||||
title: '审核详情',
|
||||
content: "/leave/leaveDetail?processId="+data.processInstanceId
|
||||
content: "leaveDetail?processId="+data.processInstanceId
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,23 +12,20 @@
|
|||
<result column="assignee_type" jdbcType="INTEGER" property="assigneeType" />
|
||||
<result column="activti_name" jdbcType="VARCHAR" property="activtiName" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, sid, assignee, role_id, assignee_type, activti_name
|
||||
</sql>
|
||||
<select id="selectListByPage" parameterType="com.len.entity.ActAssignee" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
from act_assignee
|
||||
<where>
|
||||
<if test="sid!=null and sid!=''"> and sid = #{sid}</if>
|
||||
<if test="roleId!=null and roleId!=''"> and role_id = #{roleId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByNodeId" parameterType="java.lang.String">
|
||||
delete from act_assignee
|
||||
where sid = #{sid,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
|
||||
<select id="selectListByPage" parameterType="com.len.entity.ActAssignee" resultMap="BaseResultMap">
|
||||
SELECT *
|
||||
from act_assignee
|
||||
<!--<where>
|
||||
<if test="userId!=null and userId!=''">and user_id=#{userId}</if>
|
||||
<if test="beginTime!=null">
|
||||
<![CDATA[ and DATE_FORMAT(begin_time, '%Y-%m-%d')>= DATE_FORMAT(#{beginTime}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
<if test="endTime!=null">
|
||||
<![CDATA[ and DATE_FORMAT(end_time, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
</where>-->
|
||||
</select>
|
||||
</mapper>
|
|
@ -21,5 +21,5 @@
|
|||
var ACTIVITI = ACTIVITI || {};
|
||||
|
||||
ACTIVITI.CONFIG = {
|
||||
'contextRoot' : '/service',
|
||||
'contextRoot' : '../service',
|
||||
};
|
||||
|
|
|
@ -28,7 +28,8 @@ var activitiModeler = angular.module('activitiModeler', [
|
|||
'ngGrid',
|
||||
'ngAnimate',
|
||||
'pascalprecht.translate',
|
||||
'duScroll'
|
||||
'duScroll',
|
||||
'tm.pagination'
|
||||
]);
|
||||
|
||||
var activitiModule = activitiModeler;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/*
|
||||
* Assignment
|
||||
*/
|
||||
var KisBpmAssignmentCtrl = [ '$scope', '$modal', function($scope, $modal) {
|
||||
var KisBpmAssignmentCtrl = [ '$scope', '$modal','$http', function($scope, $modal,$http) {
|
||||
|
||||
// Config for the modal window
|
||||
var opts = {
|
||||
|
@ -32,7 +32,7 @@ var KisBpmAssignmentCtrl = [ '$scope', '$modal', function($scope, $modal) {
|
|||
$modal(opts);
|
||||
}];
|
||||
|
||||
var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) {
|
||||
var KisBpmAssignmentPopupCtrl = [ '$scope','$modal', function($scope, $modal) {
|
||||
|
||||
// Put json representing assignment on scope
|
||||
if ($scope.property.value !== undefined && $scope.property.value !== null
|
||||
|
@ -48,6 +48,12 @@ var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) {
|
|||
{
|
||||
$scope.assignment.candidateUsers = [{value: ''}];
|
||||
}
|
||||
|
||||
|
||||
if ($scope.assignment.assignee == undefined || $scope.assignment.assignee == '')
|
||||
{
|
||||
$scope.assignment.assignee = '';
|
||||
}
|
||||
|
||||
// Click handler for + button after enum value
|
||||
var userValueIndex = 1;
|
||||
|
@ -75,6 +81,28 @@ var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) {
|
|||
$scope.assignment.candidateGroups.splice(index, 1);
|
||||
};
|
||||
|
||||
//Open the dialog to select users
|
||||
$scope.choseAssignment = function(flag) {
|
||||
|
||||
var opts = {
|
||||
template: 'editor-app/configuration/properties/assignment-popup-popup.html?version=' + Date.now(),
|
||||
scope: $scope
|
||||
};
|
||||
$scope.choseAssignmentFlag = flag;
|
||||
// Open the dialog
|
||||
$modal(opts);
|
||||
}
|
||||
|
||||
//Open the dialog to select candidateGroups
|
||||
$scope.choseCandidateGroups = function(){
|
||||
var opts = {
|
||||
template: 'editor-app/configuration/properties/assignment-candidateGroup.html?version=' + Date.now(),
|
||||
scope: $scope
|
||||
};
|
||||
// Open the dialog
|
||||
$modal(opts);
|
||||
}
|
||||
|
||||
$scope.save = function() {
|
||||
|
||||
$scope.property.value = {};
|
||||
|
@ -147,4 +175,242 @@ var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) {
|
|||
}
|
||||
}
|
||||
};
|
||||
}];
|
||||
|
||||
//因新打开的界面上选定的数据要传输到当前modal中,所以使用此方式,这是angular.js中不同控制器之间传输数据的方式
|
||||
$scope.$on('choseAssigneesStr', function(event,data,nameData){
|
||||
var infos = data.split(",");
|
||||
var nameInfos =nameData.split(",");
|
||||
// $scope.assignment.candidateUsers= [];
|
||||
for(var i=0;i<infos.length;i++)
|
||||
{
|
||||
$scope.assignment.candidateUsers.push({value:infos[i],nameValue:nameInfos[i]});
|
||||
// $scope.assignment.candidateUsers[i].value = infos[i];
|
||||
}
|
||||
//清空第一个
|
||||
if( (!$scope.assignment.candidateUsers[0].value )||$scope.assignment.candidateUsers[0]=='' )
|
||||
{
|
||||
//清空第一个元素
|
||||
$scope.assignment.candidateUsers.splice(0,1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.$on('choseAssigneeStr', function(event,data){
|
||||
$scope.assignment.assignee = data;
|
||||
});
|
||||
$scope.$on('choseAssigneeNameStr', function(event,data){
|
||||
$scope.assignment.assigneeshowname = data;
|
||||
});
|
||||
$scope.$on('choseCandidateGroupsStr', function(event,data,nameData){
|
||||
// $scope.assignment.candidateGroups[0].value = data;
|
||||
var infos = data.split(",");
|
||||
var nameInfos =nameData.split(",");
|
||||
|
||||
for(var i=0;i<infos.length;i++)
|
||||
{
|
||||
// $scope.assignment.candidateGroups[i].value = infos[i];
|
||||
$scope.assignment.candidateGroups.push({value:infos[i],nameValue:nameInfos[i]});
|
||||
}
|
||||
|
||||
//清空第一个
|
||||
if( (!$scope.assignment.candidateGroups[0].value )||$scope.assignment.candidateGroups[0]=='' )
|
||||
{
|
||||
//清空第一个元素
|
||||
$scope.assignment.candidateGroups.splice(0,1);
|
||||
}
|
||||
|
||||
});
|
||||
}];
|
||||
|
||||
var KisBpmChoseAssignmentCtrl = ['$scope', '$http', function($scope, $http) {
|
||||
|
||||
$scope.paginationConf = {
|
||||
currentPage: 1,
|
||||
totalItems: 1,
|
||||
itemsPerPage: 15,
|
||||
pagesLength: 15,
|
||||
perPageOptions: [10, 20, 30, 40, 50],
|
||||
onChange: function(){
|
||||
|
||||
}
|
||||
};
|
||||
//初始化左边菜单栏数据,并触发第一个菜单的点击事件
|
||||
var roles = [];
|
||||
var initId;
|
||||
$scope.getAllRoles = function (successCallback) {
|
||||
$http({
|
||||
method: 'get',
|
||||
headers: {'Accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
|
||||
url: '../role/showaLLRoleList'})
|
||||
|
||||
.success(function (data, status, headers, config) {
|
||||
var obj = data;
|
||||
for (var i=0; i<obj.length; i++) {
|
||||
if (i==0) {
|
||||
initId = obj[i].id + "";
|
||||
$scope.getAllAccountByRole(initId);
|
||||
}
|
||||
roles.push({id:obj[i].id,name:obj[i].remark});
|
||||
}
|
||||
$scope.roles = roles;
|
||||
})
|
||||
.error(function (data, status, headers, config) {
|
||||
});
|
||||
};
|
||||
$scope.getAllRoles(function(){});
|
||||
|
||||
function getDetail(value,page,limit)
|
||||
{
|
||||
|
||||
$http({
|
||||
method: 'get',
|
||||
headers: {'Accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
|
||||
url: '../user/listByRoleId?roleId='+value+"&page="+page+"&limit="+limit})
|
||||
.success(function (data, status, headers, config) {
|
||||
//封装数据
|
||||
var obj = data.users;
|
||||
if (data != null) {
|
||||
var accounts = [];
|
||||
for (var i=0; i<obj.length; i++) {
|
||||
accounts.push({id:obj[i].id, code : obj[i].username, name : obj[i].realName, index:i});
|
||||
}
|
||||
$scope.accounts=accounts;
|
||||
}
|
||||
refreshPage(value,page,limit,data.totals);
|
||||
})
|
||||
.error(function (data, status, headers, config) {
|
||||
});
|
||||
}
|
||||
|
||||
function refreshPage(value,currentPage,perPage,totals) {
|
||||
//初始化表格
|
||||
$scope.paginationConf = {
|
||||
currentPage: currentPage,
|
||||
totalItems: totals,
|
||||
itemsPerPage: perPage,
|
||||
pagesLength: 5,
|
||||
perPageOptions: [10, 20, 30, 40, 50],
|
||||
onChange: function(){
|
||||
var currentPage = $scope.paginationConf.currentPage;
|
||||
getDetail(value,currentPage,perPage);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//模态框左侧组的点击事件:根据所点击的组获取当前组的所有用户
|
||||
$scope.getAllAccountByRole = function(value) {
|
||||
//初始化表格
|
||||
getDetail(value,1,10);
|
||||
};
|
||||
|
||||
// Close button handler
|
||||
$scope.close = function() {
|
||||
$scope.$hide();
|
||||
};
|
||||
$scope.formData = {};
|
||||
$scope.candidateUser={};
|
||||
|
||||
//Save Data
|
||||
$scope.save = function() {
|
||||
if ($scope.choseAssignmentFlag == "assignee") {
|
||||
|
||||
var choseAssignees = $scope.accounts;
|
||||
var choseAssigneesStr = "";
|
||||
var choseAssigneesNameStr = "";
|
||||
for (var i=0;i<choseAssignees.length; i++) {
|
||||
if (choseAssignees[i].checked) {
|
||||
choseAssigneesStr = choseAssignees[i].id;
|
||||
choseAssigneesNameStr = choseAssignees[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$scope.$emit('choseAssigneeStr', choseAssigneesStr);
|
||||
$scope.$emit('choseAssigneeNameStr', choseAssigneesNameStr);
|
||||
} else if ($scope.choseAssignmentFlag == "assignees") {
|
||||
var choseAssignees = $scope.accounts;
|
||||
var choseAssigneesStr = "";
|
||||
var choseAssigneesNameStr = "";
|
||||
for (var i=0;i<choseAssignees.length; i++) {
|
||||
if (choseAssignees[i].selected) {
|
||||
choseAssigneesStr += choseAssignees[i].id + ",";
|
||||
choseAssigneesNameStr +=choseAssignees[i].name + ",";
|
||||
}
|
||||
}
|
||||
choseAssigneesStr = choseAssigneesStr.substring(0,choseAssigneesStr.length-1);
|
||||
choseAssigneesNameStr = choseAssigneesNameStr.substring(0,choseAssigneesNameStr.length-1);
|
||||
$scope.$emit('choseAssigneesStr', choseAssigneesStr,choseAssigneesNameStr);
|
||||
}
|
||||
$scope.close();
|
||||
};
|
||||
$scope.selectAll = function($event) {
|
||||
var checkbox = $event.target;
|
||||
var choseAssignees = $scope.accounts;
|
||||
for (var i=0;i<choseAssignees.length; i++) {
|
||||
if (checkbox.checked) {
|
||||
choseAssignees[i].selected = true;
|
||||
} else {
|
||||
choseAssignees[i].selected = false;
|
||||
}
|
||||
}
|
||||
$scope.accounts = choseAssignees;
|
||||
}
|
||||
}];
|
||||
|
||||
var KisBpmChoseCandidateGroupsCtrl = ['$scope', '$http', function($scope, $http) {
|
||||
|
||||
var candidateGroups = [];
|
||||
$scope.getAllRoles = function (successCallback) {
|
||||
$http({
|
||||
method: 'get',
|
||||
headers: {'Accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
|
||||
url: '../role/showaLLRoleList'})
|
||||
.success(function (data, status, headers, config) {
|
||||
var obj = data;
|
||||
for (var i=0; i<obj.length; i++) {
|
||||
candidateGroups.push({id:obj[i].id,name:obj[i].name,description:obj[i].remark});
|
||||
}
|
||||
$scope.candidateGroups = candidateGroups;
|
||||
})
|
||||
.error(function (data, status, headers, config) {
|
||||
});
|
||||
};
|
||||
$scope.getAllRoles(function() {
|
||||
});
|
||||
|
||||
// Close button handler
|
||||
$scope.close = function() {
|
||||
$scope.$hide();
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
var choseCandidateGroups = $scope.candidateGroups;
|
||||
var choseCandidateGroupsStr = "";
|
||||
var choseAssigneesNameStr = "";
|
||||
for (var i=0;i<choseCandidateGroups.length; i++) {
|
||||
if (choseCandidateGroups[i].selected) {
|
||||
choseCandidateGroupsStr += choseCandidateGroups[i].id + ",";
|
||||
choseAssigneesNameStr +=choseCandidateGroups[i].description + ",";
|
||||
}
|
||||
}
|
||||
choseCandidateGroupsStr = choseCandidateGroupsStr.substring(0,choseCandidateGroupsStr.length-1);
|
||||
choseAssigneesNameStr = choseAssigneesNameStr.substring(0,choseAssigneesNameStr.length-1);
|
||||
$scope.$emit('choseCandidateGroupsStr', choseCandidateGroupsStr,choseAssigneesNameStr);
|
||||
$scope.close();
|
||||
}
|
||||
|
||||
$scope.selectAll = function($event) {
|
||||
var checkbox = $event.target;
|
||||
var candidateGroups = $scope.candidateGroups;
|
||||
for (var i=0;i<candidateGroups.length; i++) {
|
||||
if (checkbox.checked) {
|
||||
candidateGroups[i].selected = true;
|
||||
} else {
|
||||
candidateGroups[i].selected = false;
|
||||
}
|
||||
}
|
||||
$scope.candidateGroups = candidateGroups;
|
||||
}
|
||||
}];
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<div class="modal" ng-controller="KisBpmChoseCandidateGroupsCtrl">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button>
|
||||
<h2 translate>PROPERTY.ASSIGNMENT.TITLE</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row row-no-gutter">
|
||||
<div class="col-xs-2"></div>
|
||||
<div class="col-xs-8">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" ng-click="selectAll($event)"></th>
|
||||
<th>组名</th>
|
||||
<th>描述</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="candidateGroup in candidateGroups">
|
||||
<td>
|
||||
<input type="checkbox" ng-model="candidateGroup.selected" ne-true-value="{{candidateGroup.id}}" ng-false-value="false">
|
||||
</td>
|
||||
<td>{{candidateGroup.name}}</td>
|
||||
<td>{{candidateGroup.description}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-xs-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button ng-click="close()" translate>ACTION.CANCEL</button>
|
||||
<button ng-click="save()" translate>ACTION.SAVE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,73 @@
|
|||
<div class="modal" ng-controller="KisBpmChoseAssignmentCtrl">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">×</button>
|
||||
<h2 translate>PROPERTY.ASSIGNMENT.TITLE</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row row-no-gutter">
|
||||
<div class="col-xs-3">
|
||||
<div class="stencils" id="z_tree">
|
||||
<div ng-repeat="role in roles">
|
||||
<ul class="stencil-group" ng-class="{collapsed: !group.expanded, 'first': $first}">
|
||||
<li>
|
||||
<span ng-click="getAllAccountByRole(role.id)" >
|
||||
{{role.name}}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<input type="radio" ng-model="kk" name="accountIds" ng-value="1" >-->
|
||||
<!--<input type="radio" ng-model="kk" name="accountIds" ng-value="0" >-->
|
||||
|
||||
<div class="col-xs-8">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input ng-if="choseAssignmentFlag=='assignees'" type="checkbox" ng-click="selectAll($event)"></th>
|
||||
<th>工号</th>
|
||||
<th>姓名</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="account in accounts">
|
||||
<td>
|
||||
<!--<input ng-if="choseAssignmentFlag=='assignee'" type="radio" name="accountIdinfo" ng-value="{{account.id}}"-->
|
||||
<!--ng-model="cardRadio" ng-model="$parent.cardRadio" value="{{account.id}}" ng-checked="$index==0?true:false">-->
|
||||
|
||||
<!--<input type="radio" ng-model="$parent.kk" name="accountIds" ne-true-value="1" ng-false-value="false">-->
|
||||
<!--<input type="radio" ng-model="$parent.kk" name="accountIds" ne-true-value="0" ng-false-value="false">-->
|
||||
<input ng-if="choseAssignmentFlag=='assignee'" type="radio" ng-model="account.checked" name="accountsIds" value="{{account.id}}"
|
||||
>
|
||||
|
||||
<input ng-if="choseAssignmentFlag=='assignees'" type="checkbox" ng-model="account.selected" ne-true-value="{{account.id}}"
|
||||
ng-false-value="false">
|
||||
</td>
|
||||
<td>{{account.code}}</td>
|
||||
<td ng-value="{{account.name}}">{{account.name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
|
||||
<div>
|
||||
<p style="float: left;margin-top: 7px;"></p>
|
||||
<tm-pagination conf="paginationConf"></tm-pagination>
|
||||
</div>
|
||||
|
||||
<button ng-click="close()" translate class="btn btn-inverse">ACTION.CANCEL</button>
|
||||
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -10,7 +10,11 @@
|
|||
<div class="row row-no-gutter">
|
||||
<div class="form-group">
|
||||
<label for="assigneeField">{{'PROPERTY.ASSIGNMENT.ASSIGNEE' | translate}}</label>
|
||||
<input type="text" id="assigneeField" class="form-control" ng-model="assignment.assignee" placeholder="{{'PROPERTY.ASSIGNMENT.ASSIGNEE_PLACEHOLDER' | translate}}" />
|
||||
|
||||
<input type="text" id="assigneeShowField" class="form-control" readonly ng-model="assignment.assigneeshowname" placeholder="{{'PROPERTY.ASSIGNMENT.ASSIGNEE_PLACEHOLDER' | translate}}"
|
||||
ng-click="choseAssignment('assignee')" ng-value="candidateUser.choseAssigneeShowname"/>
|
||||
<input type="text" id="assigneeField" class="form-control" ng-hide="true" ng-model="assignment.assignee" placeholder="{{'PROPERTY.ASSIGNMENT.ASSIGNEE_PLACEHOLDER' | translate}}"
|
||||
ng-value="candidateUser.choseAssignee"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -18,7 +22,8 @@
|
|||
<div class="form-group">
|
||||
<label for="userField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS' | translate}}</label>
|
||||
<div ng-repeat="candidateUser in assignment.candidateUsers">
|
||||
<input id="userField" class="form-control" type="text" ng-model="candidateUser.value" />
|
||||
<input id="userNameField" class="form-control" type="text" readonly ng-model="candidateUser.nameValue" ng-click="choseAssignment('assignees')" ng-value="candidateUser.value"/>
|
||||
<input id="userField" class="form-control" type="text" ng-hide="true" ng-model="candidateUser.value" ng-value="candidateUser.value"/>
|
||||
<i class="glyphicon glyphicon-minus clickable-property" ng-click="removeCandidateUserValue($index)"></i>
|
||||
<i ng-if="$index == (assignment.candidateUsers.length - 1)" class="glyphicon glyphicon-plus clickable-property" ng-click="addCandidateUserValue($index)"></i>
|
||||
</div>
|
||||
|
@ -27,7 +32,8 @@
|
|||
<div class="form-group">
|
||||
<label for="groupField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS' | translate}}</label>
|
||||
<div ng-repeat="candidateGroup in assignment.candidateGroups">
|
||||
<input id="groupField" class="form-control" type="text" ng-model="candidateGroup.value" />
|
||||
<input id="groupNameField" class="form-control" type="text" readonly ng-model="candidateGroup.nameValue" ng-click="choseCandidateGroups()"/>
|
||||
<input id="groupField" class="form-control" type="text" ng-model="candidateGroup.value" ng-hide="true"/>
|
||||
<i class="glyphicon glyphicon-minus clickable-property" ng-click="removeCandidateGroupValue($index)"></i>
|
||||
<i ng-if="$index == (assignment.candidateGroups.length - 1)" class="glyphicon glyphicon-plus clickable-property" ng-click="addCandidateGroupValue($index)"></i>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
/**
|
||||
* name: tm.pagination
|
||||
* Version: 0.0.2
|
||||
*/
|
||||
angular.module('tm.pagination', []).directive('tmPagination',[function(){
|
||||
return {
|
||||
restrict: 'EA',
|
||||
template: '<div class="page-list">' +
|
||||
'<ul class="pagination" ng-show="conf.totalItems > 0">' +
|
||||
'<li ng-class="{disabled: conf.currentPage == 1}" ng-click="prevPage()"><span>«</span></li>' +
|
||||
'<li ng-repeat="item in pageList track by $index" ng-class="{active: item == conf.currentPage, separate: item == \'...\'}" ' +
|
||||
'ng-click="changeCurrentPage(item)">' +
|
||||
'<span>{{ item }}</span>' +
|
||||
'</li>' +
|
||||
'<li ng-class="{disabled: conf.currentPage == conf.numberOfPages}" ng-click="nextPage()"><span>»</span></li>' +
|
||||
'</ul>' +
|
||||
'<div class="page-total" ng-show="conf.totalItems > 0">' +
|
||||
'第<input type="text" ng-model="jumpPageNum" ng-keyup="jumpToPage($event)"/>页 ' +
|
||||
'每页<select ng-model="conf.itemsPerPage" ng-options="option for option in conf.perPageOptions " ng-change="changeItemsPerPage()"></select>' +
|
||||
'/共<strong>{{ conf.totalItems }}</strong>条' +
|
||||
'</div>' +
|
||||
'<div class="no-items" ng-show="conf.totalItems <= 0">暂无数据</div>' +
|
||||
'</div>',
|
||||
replace: true,
|
||||
scope: {
|
||||
conf: '='
|
||||
},
|
||||
link: function(scope, element, attrs){
|
||||
|
||||
// 变更当前页
|
||||
scope.changeCurrentPage = function(item){
|
||||
if(item == '...'){
|
||||
return;
|
||||
}else{
|
||||
scope.conf.currentPage = item;
|
||||
}
|
||||
};
|
||||
|
||||
// 定义分页的长度必须为奇数 (default:9)
|
||||
scope.conf.pagesLength = parseInt(scope.conf.pagesLength) ? parseInt(scope.conf.pagesLength) : 9 ;
|
||||
if(scope.conf.pagesLength % 2 === 0){
|
||||
// 如果不是奇数的时候处理一下
|
||||
scope.conf.pagesLength = scope.conf.pagesLength -1;
|
||||
}
|
||||
|
||||
// conf.erPageOptions
|
||||
if(!scope.conf.perPageOptions){
|
||||
scope.conf.perPageOptions = [10, 15, 20, 30, 50];
|
||||
}
|
||||
|
||||
// pageList数组
|
||||
function getPagination(){
|
||||
// conf.currentPage
|
||||
scope.conf.currentPage = parseInt(scope.conf.currentPage) ? parseInt(scope.conf.currentPage) : 1;
|
||||
// conf.totalItems
|
||||
scope.conf.totalItems = parseInt(scope.conf.totalItems);
|
||||
|
||||
// conf.itemsPerPage (default:15)
|
||||
// 先判断一下本地存储中有没有这个值
|
||||
if(scope.conf.rememberPerPage){
|
||||
if(!parseInt(localStorage[scope.conf.rememberPerPage])){
|
||||
localStorage[scope.conf.rememberPerPage] = parseInt(scope.conf.itemsPerPage) ? parseInt(scope.conf.itemsPerPage) : 15;
|
||||
}
|
||||
|
||||
scope.conf.itemsPerPage = parseInt(localStorage[scope.conf.rememberPerPage]);
|
||||
|
||||
|
||||
}else{
|
||||
scope.conf.itemsPerPage = parseInt(scope.conf.itemsPerPage) ? parseInt(scope.conf.itemsPerPage) : 15;
|
||||
}
|
||||
|
||||
// numberOfPages
|
||||
scope.conf.numberOfPages = Math.ceil(scope.conf.totalItems/scope.conf.itemsPerPage);
|
||||
|
||||
// judge currentPage > scope.numberOfPages
|
||||
if(scope.conf.currentPage < 1){
|
||||
scope.conf.currentPage = 1;
|
||||
}
|
||||
|
||||
if(scope.conf.currentPage > scope.conf.numberOfPages){
|
||||
scope.conf.currentPage = scope.conf.numberOfPages;
|
||||
}
|
||||
|
||||
// jumpPageNum
|
||||
scope.jumpPageNum = scope.conf.currentPage;
|
||||
|
||||
// 如果itemsPerPage在不在perPageOptions数组中,就把itemsPerPage加入这个数组中
|
||||
var perPageOptionsLength = scope.conf.perPageOptions.length;
|
||||
// 定义状态
|
||||
var perPageOptionsStatus;
|
||||
for(var i = 0; i < perPageOptionsLength; i++){
|
||||
if(scope.conf.perPageOptions[i] == scope.conf.itemsPerPage){
|
||||
perPageOptionsStatus = true;
|
||||
}
|
||||
}
|
||||
// 如果itemsPerPage在不在perPageOptions数组中,就把itemsPerPage加入这个数组中
|
||||
if(!perPageOptionsStatus){
|
||||
scope.conf.perPageOptions.push(scope.conf.itemsPerPage);
|
||||
}
|
||||
|
||||
// 对选项进行sort
|
||||
scope.conf.perPageOptions.sort(function(a, b){return a-b});
|
||||
|
||||
scope.pageList = [];
|
||||
if(scope.conf.numberOfPages <= scope.conf.pagesLength){
|
||||
// 判断总页数如果小于等于分页的长度,若小于则直接显示
|
||||
for(i =1; i <= scope.conf.numberOfPages; i++){
|
||||
scope.pageList.push(i);
|
||||
}
|
||||
}else{
|
||||
// 总页数大于分页长度(此时分为三种情况:1.左边没有...2.右边没有...3.左右都有...)
|
||||
// 计算中心偏移量
|
||||
var offset = (scope.conf.pagesLength - 1)/2;
|
||||
if(scope.conf.currentPage <= offset){
|
||||
// 左边没有...
|
||||
for(i =1; i <= offset +1; i++){
|
||||
scope.pageList.push(i);
|
||||
}
|
||||
scope.pageList.push('...');
|
||||
scope.pageList.push(scope.conf.numberOfPages);
|
||||
}else if(scope.conf.currentPage > scope.conf.numberOfPages - offset){
|
||||
scope.pageList.push(1);
|
||||
scope.pageList.push('...');
|
||||
for(i = offset + 1; i >= 1; i--){
|
||||
scope.pageList.push(scope.conf.numberOfPages - i);
|
||||
}
|
||||
scope.pageList.push(scope.conf.numberOfPages);
|
||||
}else{
|
||||
// 最后一种情况,两边都有...
|
||||
scope.pageList.push(1);
|
||||
scope.pageList.push('...');
|
||||
|
||||
for(i = Math.ceil(offset/2) ; i >= 1; i--){
|
||||
scope.pageList.push(scope.conf.currentPage - i);
|
||||
}
|
||||
scope.pageList.push(scope.conf.currentPage);
|
||||
for(i = 1; i <= offset/2; i++){
|
||||
scope.pageList.push(scope.conf.currentPage + i);
|
||||
}
|
||||
|
||||
scope.pageList.push('...');
|
||||
scope.pageList.push(scope.conf.numberOfPages);
|
||||
}
|
||||
}
|
||||
|
||||
if(scope.conf.onChange){
|
||||
scope.conf.onChange();
|
||||
}
|
||||
scope.$parent.conf = scope.conf;
|
||||
}
|
||||
|
||||
// prevPage
|
||||
scope.prevPage = function(){
|
||||
if(scope.conf.currentPage > 1){
|
||||
scope.conf.currentPage -= 1;
|
||||
}
|
||||
};
|
||||
// nextPage
|
||||
scope.nextPage = function(){
|
||||
if(scope.conf.currentPage < scope.conf.numberOfPages){
|
||||
scope.conf.currentPage += 1;
|
||||
}
|
||||
};
|
||||
|
||||
// 跳转页
|
||||
scope.jumpToPage = function(){
|
||||
scope.jumpPageNum = scope.jumpPageNum.replace(/[^0-9]/g,'');
|
||||
if(scope.jumpPageNum !== ''){
|
||||
scope.conf.currentPage = scope.jumpPageNum;
|
||||
}
|
||||
};
|
||||
|
||||
// 修改每页显示的条数
|
||||
scope.changeItemsPerPage = function(){
|
||||
// 清除本地存储的值方便重新设置
|
||||
if(scope.conf.rememberPerPage){
|
||||
localStorage.removeItem(scope.conf.rememberPerPage);
|
||||
}
|
||||
};
|
||||
|
||||
scope.$watch(function(){
|
||||
var newValue = scope.conf.currentPage + ' ' + scope.conf.totalItems + ' ';
|
||||
// 如果直接watch perPage变化的时候,因为记住功能的原因,所以一开始可能调用两次。
|
||||
//所以用了如下方式处理
|
||||
if(scope.conf.rememberPerPage){
|
||||
// 由于记住的时候需要特别处理一下,不然可能造成反复请求
|
||||
// 之所以不监控localStorage[scope.conf.rememberPerPage]是因为在删除的时候会undefind
|
||||
// 然后又一次请求
|
||||
if(localStorage[scope.conf.rememberPerPage]){
|
||||
newValue += localStorage[scope.conf.rememberPerPage];
|
||||
}else{
|
||||
newValue += scope.conf.itemsPerPage;
|
||||
}
|
||||
}else{
|
||||
newValue += scope.conf.itemsPerPage;
|
||||
}
|
||||
return newValue;
|
||||
|
||||
}, getPagination);
|
||||
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -25,6 +25,26 @@
|
|||
<link rel="stylesheet" href="editor-app/css/style-common.css">
|
||||
<link rel="stylesheet" href="editor-app/css/style-editor.css">
|
||||
|
||||
<style>
|
||||
.page-list{
|
||||
overflow: hidden;
|
||||
}
|
||||
.page-list .pagination { margin: 0 0 10px 0; float: left;}
|
||||
.page-list .pagination span {cursor: pointer;}
|
||||
.page-list .pagination .separate span{cursor: default; border-top:none;border-bottom:none;}
|
||||
.page-list .pagination .separate span:hover {background: none;}
|
||||
.page-list .page-total {
|
||||
float: left;
|
||||
margin: 2px 0 2px 11px;
|
||||
}
|
||||
.page-list .page-total input, .page-list .page-total select{height: 26px; border: 1px solid #ddd;}
|
||||
.page-list .page-total input {width: 40px; padding-left:3px;}
|
||||
.page-list .page-total select {width: 50px;}
|
||||
.no-items{
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -90,7 +110,8 @@
|
|||
<script src="editor-app/libs/path_parser.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
<script src="editor-app/libs/pagination/tm.pagination.js" type="text/javascript"></script>
|
||||
<!-- Configuration -->
|
||||
<script src="editor-app/app-cfg.js?v=1"></script>
|
||||
<script src="editor-app/editor-config.js" type="text/javascript"></script>
|
||||
|
@ -112,7 +133,7 @@
|
|||
|
||||
<script src="editor-app/editor-utils.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/toolbar-default-actions.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
<script src="editor-app/configuration/properties-default-controllers.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-execution-listeners-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-event-listeners-controller.js" type="text/javascript"></script>
|
||||
|
|
|
@ -718,7 +718,7 @@
|
|||
"id" : "StartNoneEvent",
|
||||
"title" : "事件",
|
||||
"description" : "A start event without a specific trigger",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n width=\"40\"\n height=\"40\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"16\" oryx:cy=\"16\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\">\n <circle id=\"bg_frame\" cx=\"16\" cy=\"16\" r=\"15\" stroke=\"#585858\" fill=\"#ffffff\" stroke-width=\"1\"/>\n\t<text font-size=\"11\" \n\t\tid=\"text_name\" \n\t\tx=\"16\" y=\"33\" \n\t\toryx:align=\"top center\" \n\t\tstroke=\"#373e48\"\n\t></text>\n </g>\n</svg>",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n width=\"40\"\n height=\"40\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"16\" oryx:cy=\"16\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\">\n <circle id=\"bg_frame\" cx=\"16\" cy=\"16\" r=\"15\" stroke=\"#585858\" fill=\"#24ca58\" stroke-width=\"1\"/>\n\t<text font-size=\"11\" \n\t\tid=\"text_name\" \n\t\tx=\"16\" y=\"33\" \n\t\toryx:align=\"top center\" \n\t\tstroke=\"#373e48\"\n\t></text>\n </g>\n</svg>",
|
||||
"icon" : "startevent/none.png",
|
||||
"groups" : [ "启动事件" ],
|
||||
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "executionlistenerspackage", "initiatorpackage", "formkeydefinitionpackage", "formpropertiespackage" ],
|
||||
|
@ -773,7 +773,7 @@
|
|||
"id" : "UserTask",
|
||||
"title" : "用户活动",
|
||||
"description" : "分配给特定人的任务 ",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\n width=\"102\"\n height=\"82\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"20\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"40\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"60\" oryx:anchors=\"left\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"20\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"40\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"60\" oryx:anchors=\"right\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"40\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\" oryx:minimumSize=\"50 40\">\n\t<rect id=\"text_frame\" oryx:anchors=\"bottom top right left\" x=\"1\" y=\"1\" width=\"94\" height=\"79\" rx=\"10\" ry=\"10\" stroke=\"none\" stroke-width=\"0\" fill=\"none\" />\n\t<rect id=\"bg_frame\" oryx:resize=\"vertical horizontal\" x=\"0\" y=\"0\" width=\"100\" height=\"80\" rx=\"10\" ry=\"10\" stroke=\"#bbbbbb\" stroke-width=\"1\" fill=\"#f9f9f9\" />\n\t\t<text \n\t\t\tfont-size=\"12\" \n\t\t\tid=\"text_name\" \n\t\t\tx=\"50\" \n\t\t\ty=\"40\" \n\t\t\toryx:align=\"middle center\"\n\t\t\toryx:fittoelem=\"text_frame\"\n\t\t\tstroke=\"#373e48\">\n\t\t</text>\n\t\n\t<g id=\"userTask\" transform=\"translate(3,3)\">\n\t\t<path oryx:anchors=\"top left\"\n \t\tstyle=\"fill:#d1b575;stroke:none;\"\n \t\t d=\"m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c 0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17\" \n />\n\t\t\n\t</g>\n \n\t<g id=\"parallel\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" d=\"M46 70 v8 M50 70 v8 M54 70 v8\" stroke-width=\"2\" />\n\t</g>\n\t\n\t<g id=\"sequential\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" stroke-width=\"2\" d=\"M46,76h10M46,72h10 M46,68h10\"/>\n\t</g>\n\t\n\n\t<g id=\"compensation\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" d=\"M 62 74 L 66 70 L 66 78 L 62 74 L 62 70 L 58 74 L 62 78 L 62 74\" stroke-width=\"1\" />\n\t</g>\n </g>\n</svg>",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\n width=\"102\"\n height=\"82\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"20\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"40\" oryx:anchors=\"left\" />\n \t<oryx:magnet oryx:cx=\"1\" oryx:cy=\"60\" oryx:anchors=\"left\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"79\" oryx:anchors=\"bottom\" />\n \t\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"20\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"40\" oryx:anchors=\"right\" />\n \t<oryx:magnet oryx:cx=\"99\" oryx:cy=\"60\" oryx:anchors=\"right\" />\n \t\n \t<oryx:magnet oryx:cx=\"25\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t<oryx:magnet oryx:cx=\"75\" oryx:cy=\"1\" oryx:anchors=\"top\" />\n \t\n \t<oryx:magnet oryx:cx=\"50\" oryx:cy=\"40\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\" oryx:minimumSize=\"50 40\">\n\t<rect id=\"text_frame\" oryx:anchors=\"bottom top right left\" x=\"1\" y=\"1\" width=\"94\" height=\"79\" rx=\"10\" ry=\"10\" stroke=\"none\" stroke-width=\"0\" fill=\"none\" />\n\t<rect id=\"bg_frame\" oryx:resize=\"vertical horizontal\" x=\"0\" y=\"0\" width=\"100\" height=\"80\" rx=\"10\" ry=\"10\" stroke=\"#bbbbbb\" stroke-width=\"1\" fill=\"Yellow\" />\n\t\t<text \n\t\t\tfont-size=\"12\" \n\t\t\tid=\"text_name\" \n\t\t\tx=\"50\" \n\t\t\ty=\"40\" \n\t\t\toryx:align=\"middle center\"\n\t\t\toryx:fittoelem=\"text_frame\"\n\t\t\tstroke=\"#373e48\">\n\t\t</text>\n\t\n\t<g id=\"userTask\" transform=\"translate(3,3)\">\n\t\t<path oryx:anchors=\"top left\"\n \t\tstyle=\"fill:#d1b575;stroke:none;\"\n \t\t d=\"m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c 0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17\" \n />\n\t\t\n\t</g>\n \n\t<g id=\"parallel\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" d=\"M46 70 v8 M50 70 v8 M54 70 v8\" stroke-width=\"2\" />\n\t</g>\n\t\n\t<g id=\"sequential\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" stroke-width=\"2\" d=\"M46,76h10M46,72h10 M46,68h10\"/>\n\t</g>\n\t\n\n\t<g id=\"compensation\">\n\t\t<path oryx:anchors=\"bottom\" fill=\"none\" stroke=\"#bbbbbb\" d=\"M 62 74 L 66 70 L 66 78 L 62 74 L 62 70 L 58 74 L 62 78 L 62 74\" stroke-width=\"1\" />\n\t</g>\n </g>\n</svg>",
|
||||
"icon" : "activity/list/type.user.png",
|
||||
"groups" : [ "活动列表" ],
|
||||
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "asynchronousdefinitionpackage", "exclusivedefinitionpackage", "executionlistenerspackage", "multiinstance_typepackage", "multiinstance_cardinalitypackage", "multiinstance_collectionpackage", "multiinstance_variablepackage", "multiinstance_conditionpackage", "isforcompensationpackage", "usertaskassignmentpackage", "formkeydefinitionpackage", "duedatedefinitionpackage", "prioritydefinitionpackage", "formpropertiespackage", "tasklistenerspackage" ],
|
||||
|
@ -1081,7 +1081,7 @@
|
|||
"id" : "EndNoneEvent",
|
||||
"title" : "结束任务",
|
||||
"description" : "一个无触发器的结束任务",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n width=\"40\"\n height=\"40\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"16\" oryx:cy=\"16\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\">\n <circle id=\"bg_frame\" cx=\"16\" cy=\"16\" r=\"14\" stroke=\"#585858\" fill=\"#ffffff\" stroke-width=\"3\"/>\n\t<text font-size=\"11\" \n\t\tid=\"text_name\" \n\t\tx=\"16\" y=\"32\" \n\t\toryx:align=\"top center\" \n\t\tstroke=\"#373e48\"\n\t></text>\n </g>\n</svg>",
|
||||
"view" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:oryx=\"http://www.b3mn.org/oryx\"\n width=\"40\"\n height=\"40\"\n version=\"1.0\">\n <defs></defs>\n <oryx:magnets>\n \t<oryx:magnet oryx:cx=\"16\" oryx:cy=\"16\" oryx:default=\"yes\" />\n </oryx:magnets>\n <g pointer-events=\"fill\">\n <circle id=\"bg_frame\" cx=\"16\" cy=\"16\" r=\"14\" stroke=\"#585858\" fill=\"#ff0000\" stroke-width=\"3\"/>\n\t<text font-size=\"11\" \n\t\tid=\"text_name\" \n\t\tx=\"16\" y=\"32\" \n\t\toryx:align=\"top center\" \n\t\tstroke=\"#373e48\"\n\t></text>\n </g>\n</svg>",
|
||||
"icon" : "endevent/none.png",
|
||||
"groups" : [ "结束任务列表" ],
|
||||
"propertyPackages" : [ "overrideidpackage", "namepackage", "documentationpackage", "executionlistenerspackage" ],
|
||||
|
|
|
@ -61,4 +61,5 @@ public interface BaseService<T, E extends Serializable> extends BaseMapper<T, E>
|
|||
|
||||
public ReType show(T t, int page, int limit);
|
||||
|
||||
public String showAll(T t);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.len.base.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.len.base.BaseMapper;
|
||||
|
@ -144,46 +145,6 @@ public abstract class BaseServiceImpl<T, E extends Serializable> implements Base
|
|||
return getMappser().selectListByPage(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPrimaryKey(Object o) {
|
||||
return getMappser().deleteByPrimaryKey(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(T t) {
|
||||
return getMappser().delete(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsWithPrimaryKey(Object o) {
|
||||
return getMappser().existsWithPrimaryKey(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T selectByPrimaryKey(Object o) {
|
||||
return getMappser().selectByPrimaryKey(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T selectOne(T t) {
|
||||
return getMappser().selectOne(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(String s) {
|
||||
return getMappser().deleteByIds(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertList(List<T> list) {
|
||||
return getMappser().insertList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertUseGeneratedKeys(T t) {
|
||||
return getMappser().insertUseGeneratedKeys(t);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共展示类
|
||||
*
|
||||
|
@ -205,4 +166,19 @@ public abstract class BaseServiceImpl<T, E extends Serializable> implements Base
|
|||
return new ReType(tPage.getTotal(), tList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String showAll(T t)
|
||||
{
|
||||
List<T> tList = null;
|
||||
try {
|
||||
tList = getMappser().selectListByPage(t);
|
||||
} catch (MyException e) {
|
||||
// logger.error("class:BaseServiceImpl ->method:show->message:" + e.getMessage());
|
||||
log.error("class:BaseServiceImpl ->method:show->message:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
// ReType reType = new ReType( tList);
|
||||
return JSON.toJSONString(tList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,6 +65,15 @@ public class RoleController extends BaseController {
|
|||
return roleService.show(role, Integer.valueOf(page), Integer.valueOf(limit));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "/showaLLRoleList", httpMethod = "GET", notes = "展示角色")
|
||||
@GetMapping(value = "showaLLRoleList")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("role:show")
|
||||
public String showRoleList(SysRole role, Model model) {
|
||||
return roleService.showAll(role);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "showAddRole")
|
||||
public String goAddRole(Model model) {
|
||||
JSONArray jsonArray = menuService.getTreeUtil(null);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.len.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.len.base.BaseController;
|
||||
import com.len.core.annotation.Log;
|
||||
import com.len.core.annotation.Log.LOG_TYPE;
|
||||
|
@ -73,6 +75,20 @@ public class UserController extends BaseController {
|
|||
return userService.show(user, Integer.valueOf(page), Integer.valueOf(limit));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "/listByRoleId", httpMethod = "GET", notes = "展示角色")
|
||||
@GetMapping(value = "listByRoleId")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("user:show")
|
||||
public String showUser(Model model, String roleId,int page, int limit) {
|
||||
JSONObject returnValue = new JSONObject();
|
||||
List<SysUser> users = userService.getUserByRoleId(roleId,page,limit);
|
||||
int counts = userService.countUserByRoleId(roleId,page,limit);
|
||||
returnValue.put("users",users);
|
||||
returnValue.put("totals",counts);
|
||||
return JSON.toJSONString(returnValue);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "showAddUser")
|
||||
public String goAddUser(Model model) {
|
||||
List<Checkbox> checkboxList = userService.getUserRoleByJson(null);
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
|
||||
@Configuration
|
||||
|
@ -16,7 +17,8 @@ public class MySchedulerListener {
|
|||
@Bean(name ="schedulerFactoryBean")
|
||||
public SchedulerFactoryBean schedulerFactory() {
|
||||
SchedulerFactoryBean bean = new SchedulerFactoryBean();
|
||||
bean.setJobFactory(myJobFactory);
|
||||
bean.setJobFactory(myJobFactory);
|
||||
bean.setConfigLocation(new ClassPathResource("quartz.properties"));
|
||||
return bean;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@ import org.apache.ibatis.annotations.Param;
|
|||
import tk.mybatis.mapper.common.BaseMapper;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SysUserMapper extends com.len.base.BaseMapper<SysUser,String> {
|
||||
|
||||
SysUser login(@Param("username") String username);
|
||||
|
@ -23,4 +26,7 @@ public interface SysUserMapper extends com.len.base.BaseMapper<SysUser,String> {
|
|||
* @return
|
||||
*/
|
||||
int rePass(SysUser user);
|
||||
|
||||
List<SysUser> getUserByRoleId(Map map);
|
||||
int countUserByRoleId(Map map);
|
||||
}
|
|
@ -61,4 +61,8 @@ public interface SysUserService extends BaseService<SysUser,String> {
|
|||
*/
|
||||
int rePass(SysUser user);
|
||||
|
||||
|
||||
List<SysUser> getUserByRoleId(String roleId,int page,int limit);
|
||||
|
||||
int countUserByRoleId(String roleId,int page,int limit);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,10 @@ import com.len.util.Checkbox;
|
|||
import com.len.util.JsonUtil;
|
||||
import com.len.util.Md5Util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -180,4 +183,24 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUser,String> implemen
|
|||
public int rePass(SysUser user) {
|
||||
return sysUserMapper.rePass(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> getUserByRoleId(String roleId,int page,int limit)
|
||||
{
|
||||
Map map = new HashMap<>();
|
||||
map.put("roleId",roleId);
|
||||
map.put("page",(page-1)*limit );
|
||||
map.put("limit",limit);
|
||||
return sysUserMapper.getUserByRoleId(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countUserByRoleId(String roleId,int page,int limit)
|
||||
{
|
||||
Map map = new HashMap<>();
|
||||
map.put("roleId",roleId);
|
||||
map.put("page",(page-1)*limit );
|
||||
map.put("limit",limit);
|
||||
return sysUserMapper.countUserByRoleId(map);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
<div class="message">len-脚手架</div>
|
||||
<div id="darkbannerwrap"></div>
|
||||
|
||||
<form method="post" action="/login" class="layui-form" >
|
||||
<form method="post" action="${re.contextPath}/login" class="layui-form" >
|
||||
<input name="username" placeholder="用户名" autocomplete="off" type="text" lay-verify="username" class="layui-input" >
|
||||
<hr class="hr15">
|
||||
<input name="password" lay-verify="password" placeholder="密码" autocomplete="off" type="password" class="layui-input">
|
||||
<hr class="hr15">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" style="width:40px;padding: 9px 0px;">验证码:</label>
|
||||
<label class="layui-form-label" style="width:40px;padding: 9px 0px;">验证码 </label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="code" style="width:150px;height:35px;" autocomplete="off" lay-verify="code" class="layui-input">
|
||||
</div>
|
||||
|
@ -79,7 +79,7 @@
|
|||
layer.msg(msg, {icon: 5,anim:6,offset: 't'});
|
||||
}
|
||||
$("#code").click(function(){
|
||||
var url = "/getCode?"+new Date().getTime();
|
||||
var url = "${re.contextPath}/getCode?"+new Date().getTime();
|
||||
this.src = url;
|
||||
}).click().show();
|
||||
$('#code').on('mouseover',function(){
|
||||
|
|
|
@ -53,14 +53,14 @@
|
|||
<li class="layui-nav-item">
|
||||
<a href="javascript:;">
|
||||
<#assign currentUser = Session["curentUser"]>
|
||||
<img src="/images/${currentUser.photo}" class="layui-nav-img">${currentUser.username}
|
||||
<img src="${re.contextPath}/images/${currentUser.photo}" class="layui-nav-img">${currentUser.username}
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="javascript:;" kit-target data-options="{url:'basic.html',icon:'',title:'基本资料',id:'966'}"><span>基本资料</span></a></dd>
|
||||
<dd><a href="javascript:;">安全设置</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item"><a href="/logout"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
|
||||
<li class="layui-nav-item"><a href="logout"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ To change this template use File | Settings | File Templates.-->
|
|||
shade: 0.4,
|
||||
zIndex: layer.zIndex,
|
||||
title: '图标',
|
||||
content: '/plugin/html/icon.html'
|
||||
content: '../plugin/html/icon.html'
|
||||
});
|
||||
});
|
||||
//自定义验证规则
|
||||
|
|
|
@ -148,7 +148,7 @@ To change this template use File | Settings | File Templates.-->
|
|||
shade: 0.4,
|
||||
zIndex: layer.zIndex,
|
||||
title: '图标',
|
||||
content: '/plugin/html/icon.html'
|
||||
content: '../plugin/html/icon.html'
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -139,4 +139,15 @@
|
|||
<update id="rePass" parameterType="com.len.entity.SysUser">
|
||||
update sys_user set password=#{password,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getUserByRoleId" parameterType="java.util.Map" resultMap="BaseResultMap">
|
||||
select sysuser.id,sysuser.real_name,sysuser.username from sys_user sysuser inner join sys_role_user roleuser on sysuser.id = roleuser.user_id and roleuser.role_id = #{roleId,jdbcType=VARCHAR}
|
||||
limit #{page},#{limit}
|
||||
</select>
|
||||
|
||||
<select id="countUserByRoleId" parameterType="java.util.Map" resultType="java.lang.Integer">
|
||||
select count(1) from sys_user sysuser inner join sys_role_user roleuser on sysuser.id = roleuser.user_id and roleuser.role_id = #{roleId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -3,10 +3,10 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>图标</title>
|
||||
<link rel="stylesheet" href="/plugin/layuitree/layui/css/layui.css">
|
||||
<script type="text/javascript" src="/plugin/jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="/plugin/layer/layer.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="/plugin/layui/layui.all.js" charset="utf-8"></script>
|
||||
<link rel="stylesheet" href="../layuitree/layui/css/layui.css">
|
||||
<script type="text/javascript" src="../jquery/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../layer/layer.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../layui/layui.all.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<script>
|
||||
$(function(){
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/**框架*/
|
||||
var message;
|
||||
layui.config({
|
||||
base: '/plugin/build/js/',
|
||||
base: 'plugin/build/js/',
|
||||
version: '1.0.1'
|
||||
}).use(['app', 'message'], function() {
|
||||
var app = layui.app,
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Default Properties file for use by StdSchedulerFactory
|
||||
# to create a Quartz Scheduler Instance, if a different
|
||||
# properties file is not explicitly specified.
|
||||
#
|
||||
|
||||
org.quartz.scheduler.instanceName: DefaultQuartzScheduler
|
||||
org.quartz.scheduler.rmi.export: false
|
||||
org.quartz.scheduler.rmi.proxy: false
|
||||
org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
|
||||
|
||||
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
|
||||
org.quartz.threadPool.threadCount: 20
|
||||
org.quartz.threadPool.threadPriority: 5
|
||||
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
|
||||
org.quartz.jobStore.misfireThreshold: 60000
|
||||
|
||||
org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
|
||||
|
12
pom.xml
12
pom.xml
|
@ -109,12 +109,12 @@
|
|||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc4</artifactId>
|
||||
<version>4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>com.microsoft.sqlserver</groupId>-->
|
||||
<!--<artifactId>sqljdbc4</artifactId>-->
|
||||
<!--<version>4.0</version>-->
|
||||
<!--<scope>compile</scope>-->
|
||||
<!--</dependency>-->
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
|
|
Loading…
Reference in New Issue