完善抄送,待阅,已阅功能
This commit is contained in:
parent
46e59aa381
commit
186b525816
@ -2,13 +2,12 @@ package ink.wgink.module.activiti.controller.api.oa;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaHistoryTaskDTO;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaProcdefDTO;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaProcessLogDTO;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaTaskDTO;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.*;
|
||||
import ink.wgink.module.activiti.service.oa.IOaCcService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -18,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: OaController
|
||||
@ -33,6 +33,8 @@ public class OaController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IOaService oaService;
|
||||
@Autowired
|
||||
private IOaCcService oaCcService;
|
||||
|
||||
@ApiOperation(value = "流程定义分页列表", notes = "流程定义分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ -73,6 +75,13 @@ public class OaController extends DefaultBaseController {
|
||||
return oaService.listPageTaskOfMine(page.getPage(), page.getRows());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的任务(待办)总数", notes = "我的任务(待办)总数接口")
|
||||
@GetMapping("count-task-of-mine")
|
||||
public SuccessResultData<Long> countTaskOfMine() {
|
||||
Long count = oaService.countTaskOfMine();
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的历史任务(已办)列表", notes = "我的历史任务(已办)列表接口")
|
||||
@GetMapping("list-history-task-of-mine")
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskOfMine() {
|
||||
@ -95,4 +104,46 @@ public class OaController extends DefaultBaseController {
|
||||
return oaService.listProcessLog(processInstanceId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待阅分页列表", notes = "我的待阅分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-unread-of-mine")
|
||||
public SuccessResultList<List<OaCcDTO>> listPageUnReadOfMine(ListPage page) {
|
||||
Map<String, Object> requestParams = requestParams();
|
||||
requestParams.put("sort", "gmtCreate");
|
||||
requestParams.put("order", "desc");
|
||||
page.setParams(requestParams);
|
||||
return oaCcService.listPageOfMineByIsRead(0, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的已阅分页列表", notes = "我的已阅分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-read-of-mine")
|
||||
public SuccessResultList<List<OaCcDTO>> listPageReadOfMine(ListPage page) {
|
||||
Map<String, Object> requestParams = requestParams();
|
||||
requestParams.put("sort", "gmtModified");
|
||||
requestParams.put("order", "desc");
|
||||
page.setParams(requestParams);
|
||||
return oaCcService.listPageOfMineByIsRead(1, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待阅总数", notes = "我的待阅总数接口")
|
||||
@GetMapping("count-unread-of-mine")
|
||||
public SuccessResultData<Integer> countUnReadOfMine() {
|
||||
Integer count = oaCcService.countReadOfMine(0);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的已读总数", notes = "我的已读总数接口")
|
||||
@GetMapping("count-read-of-mine")
|
||||
public SuccessResultData<Integer> countReadOfMine() {
|
||||
Integer count = oaCcService.countReadOfMine(1);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
package ink.wgink.module.activiti.controller.api.oa;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.UpdateTaskAssigneeVO;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.form.service.design.IFormFieldService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -33,8 +34,6 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IOaFormReportService oaFormReportService;
|
||||
@Autowired
|
||||
private IFormFieldService formFieldService;
|
||||
|
||||
@ApiOperation(value = "保存表单(发起流程)", notes = "保存表单(发起流程)接口")
|
||||
@ApiImplicitParams({
|
||||
@ -82,9 +81,9 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
})
|
||||
@PutMapping("update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}")
|
||||
public synchronized SuccessResult updateGoBack(@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("nodeId") String nodeId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("nodeId") String nodeId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
String reason = params.get(IOaFormReportService.KEY_REASON);
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new ParamsException("回退原因不能为空");
|
||||
@ -100,8 +99,8 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
})
|
||||
@PutMapping("update-forced-end/process-instance-id/{processInstanceId}/task-id/{taskId}")
|
||||
public synchronized SuccessResult updateForcedEnd(@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
@PathVariable("taskId") String taskId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
String reason = params.get(IOaFormReportService.KEY_REASON);
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new ParamsException("结束原因不能为空");
|
||||
@ -110,6 +109,18 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新代理人", notes = "更新代理人接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "path")
|
||||
})
|
||||
@PutMapping("update-assignee/task-id/{taskId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public synchronized SuccessResult updateAssignee(@PathVariable("taskId") String taskId, @RequestBody UpdateTaskAssigneeVO updateTaskAssigneeVO) {
|
||||
oaFormReportService.updateTaskAssignee(taskId, updateTaskAssigneeVO.getAssignee());
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@GetMapping("get/code/{formCode}/version/{formVersion}/uid/{uid}")
|
||||
public Map<String, Object> get(@PathVariable("formCode") String formCode, @PathVariable("formVersion") Integer formVersion, @PathVariable("uid") String uid) {
|
||||
return oaFormReportService.get(formCode, formVersion, uid);
|
||||
|
@ -2,12 +2,19 @@ package ink.wgink.module.activiti.controller.route.oa;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportRouteService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* @ClassName: OaController
|
||||
* @Description: Oa管理
|
||||
@ -17,9 +24,12 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
*/
|
||||
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "oa管理")
|
||||
@Controller
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/oa")
|
||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/oa")
|
||||
public class OaRouteController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IOaFormReportRouteService oaFormReportRouteService;
|
||||
|
||||
@GetMapping("list-procdef")
|
||||
public ModelAndView listProcdef() {
|
||||
ModelAndView mv = new ModelAndView("oa/list-procdef");
|
||||
@ -31,6 +41,7 @@ public class OaRouteController extends DefaultBaseController {
|
||||
ModelAndView mv = new ModelAndView("oa/list-task-of-mine");
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("list-history-task-of-mine")
|
||||
public ModelAndView listHistoryOfMine() {
|
||||
ModelAndView mv = new ModelAndView("oa/list-history-task-of-mine");
|
||||
@ -43,4 +54,26 @@ public class OaRouteController extends DefaultBaseController {
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("list-unread-of-mine")
|
||||
public ModelAndView listUnreadOfMine() {
|
||||
ModelAndView mv = new ModelAndView("oa/list-unread-of-mine");
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("list-read-of-mine")
|
||||
public ModelAndView listReadOfMine() {
|
||||
ModelAndView mv = new ModelAndView("oa/list-read-of-mine");
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("update-read/code/{formCode}/version/{formVersion}/cc-id/{ccId}")
|
||||
public void updateRead(@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@PathVariable("ccId") String ccId,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
oaFormReportRouteService.updateRead(formCode, formVersion, ccId, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package ink.wgink.module.activiti.dao.oa;
|
||||
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.exceptions.UpdateException;
|
||||
import ink.wgink.interfaces.init.IInitBaseTable;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaCcDTO;
|
||||
import ink.wgink.module.activiti.pojo.pos.oa.OaCcPO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IFormReportCcDao
|
||||
* @Description: 抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 11:13
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface IOaCcDao extends IInitBaseTable {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param params
|
||||
* @throws SaveException
|
||||
*/
|
||||
void save(Map<String, Object> params) throws SaveException;
|
||||
|
||||
/**
|
||||
* 更新阅读状态
|
||||
*
|
||||
* @param params
|
||||
* @throws UpdateException
|
||||
*/
|
||||
void updateRead(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<OaCcPO> listPO(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<OaCcDTO> list(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer count(Map<String, Object> params) throws SearchException;
|
||||
}
|
@ -34,6 +34,10 @@ public class OaFormReportUnWantedValueBO {
|
||||
* 需要记录的字段列表
|
||||
*/
|
||||
private List<OaFormReportRecordFieldVO> recordFields;
|
||||
/**
|
||||
* 抄送列表
|
||||
*/
|
||||
private List<String> ccs;
|
||||
|
||||
public List<String> getAssignees() {
|
||||
return assignees == null ? new ArrayList() : assignees;
|
||||
@ -74,4 +78,12 @@ public class OaFormReportUnWantedValueBO {
|
||||
public void setRecordFields(List<OaFormReportRecordFieldVO> recordFields) {
|
||||
this.recordFields = recordFields;
|
||||
}
|
||||
|
||||
public List<String> getCcs() {
|
||||
return ccs == null ? new ArrayList() : ccs;
|
||||
}
|
||||
|
||||
public void setCcs(List<String> ccs) {
|
||||
this.ccs = ccs;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package ink.wgink.module.activiti.pojo.dtos.oa;
|
||||
|
||||
import ink.wgink.module.activiti.pojo.pos.oa.OaCcPO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* @ClassName: OaFormReportCcDTO
|
||||
* @Description: 表单上报抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 11:16
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@ApiModel
|
||||
public class OaCcDTO extends OaCcPO {
|
||||
|
||||
private String mainTitle;
|
||||
private String userName;
|
||||
private String creatorName;
|
||||
|
||||
public String getMainTitle() {
|
||||
return mainTitle == null ? "" : mainTitle.trim();
|
||||
}
|
||||
|
||||
public void setMainTitle(String mainTitle) {
|
||||
this.mainTitle = mainTitle;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getCreatorName() {
|
||||
return creatorName == null ? "" : creatorName.trim();
|
||||
}
|
||||
|
||||
public void setCreatorName(String creatorName) {
|
||||
this.creatorName = creatorName;
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package ink.wgink.module.activiti.pojo.pos.oa;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: OaFormReportCcDTO
|
||||
* @Description: 表单上报抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 11:16
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@ApiModel
|
||||
public class OaCcPO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7980007577691380590L;
|
||||
private String ccId;
|
||||
private String formCode;
|
||||
private Integer formVersion;
|
||||
private String processInstanceId;
|
||||
private String reportUid;
|
||||
private String userId;
|
||||
private Integer isRead;
|
||||
private String gmtCreate;
|
||||
private String creator;
|
||||
private String gmtModified;
|
||||
|
||||
public String getCcId() {
|
||||
return ccId == null ? "" : ccId.trim();
|
||||
}
|
||||
|
||||
public void setCcId(String ccId) {
|
||||
this.ccId = ccId;
|
||||
}
|
||||
|
||||
public String getFormCode() {
|
||||
return formCode == null ? "" : formCode.trim();
|
||||
}
|
||||
|
||||
public void setFormCode(String formCode) {
|
||||
this.formCode = formCode;
|
||||
}
|
||||
|
||||
public Integer getFormVersion() {
|
||||
return formVersion == null ? 0 : formVersion;
|
||||
}
|
||||
|
||||
public void setFormVersion(Integer formVersion) {
|
||||
this.formVersion = formVersion;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId == null ? "" : processInstanceId.trim();
|
||||
}
|
||||
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getReportUid() {
|
||||
return reportUid == null ? "" : reportUid.trim();
|
||||
}
|
||||
|
||||
public void setReportUid(String reportUid) {
|
||||
this.reportUid = reportUid;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId == null ? "" : userId.trim();
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getIsRead() {
|
||||
return isRead == null ? 0 : isRead;
|
||||
}
|
||||
|
||||
public void setIsRead(Integer isRead) {
|
||||
this.isRead = isRead;
|
||||
}
|
||||
|
||||
public String getGmtCreate() {
|
||||
return gmtCreate == null ? "" : gmtCreate.trim();
|
||||
}
|
||||
|
||||
public void setGmtCreate(String gmtCreate) {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getGmtModified() {
|
||||
return gmtModified == null ? "" : gmtModified.trim();
|
||||
}
|
||||
|
||||
public void setGmtModified(String gmtModified) {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package ink.wgink.module.activiti.pojo.vos.oa;
|
||||
|
||||
/**
|
||||
* @ClassName: OaFormReportCcVO
|
||||
* @Description: 表单上报抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 09:28
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class OaCcVO {
|
||||
|
||||
private String formCode;
|
||||
private Integer formVersion;
|
||||
private String processInstanceId;
|
||||
private String reportUid;
|
||||
private String userId;
|
||||
|
||||
public String getFormCode() {
|
||||
return formCode == null ? "" : formCode.trim();
|
||||
}
|
||||
|
||||
public void setFormCode(String formCode) {
|
||||
this.formCode = formCode;
|
||||
}
|
||||
|
||||
public Integer getFormVersion() {
|
||||
return formVersion == null ? 0 : formVersion;
|
||||
}
|
||||
|
||||
public void setFormVersion(Integer formVersion) {
|
||||
this.formVersion = formVersion;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId == null ? "" : processInstanceId.trim();
|
||||
}
|
||||
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getReportUid() {
|
||||
return reportUid == null ? "" : reportUid.trim();
|
||||
}
|
||||
|
||||
public void setReportUid(String reportUid) {
|
||||
this.reportUid = reportUid;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId == null ? "" : userId.trim();
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package ink.wgink.module.activiti.pojo.vos.oa;
|
||||
|
||||
import ink.wgink.annotation.CheckEmptyAnnotation;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @ClassName: UpdateTaskAssigneeVO
|
||||
* @Description: 更新任务代理人
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 17:15
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@ApiModel
|
||||
public class UpdateTaskAssigneeVO {
|
||||
|
||||
@ApiModelProperty(name = "assignee", value = "代理人")
|
||||
@CheckEmptyAnnotation(name = "代理人")
|
||||
private String assignee;
|
||||
|
||||
public String getAssignee() {
|
||||
return assignee == null ? "" : assignee.trim();
|
||||
}
|
||||
|
||||
public void setAssignee(String assignee) {
|
||||
this.assignee = assignee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"assignee\":\"")
|
||||
.append(assignee).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -28,12 +28,10 @@ public interface IActivitiModelService {
|
||||
* 排他网关条件关键字
|
||||
*/
|
||||
String EXCLUSIVE_GATEWAY_CONDITION_KEY = "exc";
|
||||
|
||||
/**
|
||||
* 并行网关条件关键字
|
||||
*/
|
||||
String PARALLEL_GATEWAY_CONDITION_KEY = "par";
|
||||
|
||||
/**
|
||||
* 候选人集合
|
||||
*/
|
||||
|
@ -0,0 +1,113 @@
|
||||
package ink.wgink.module.activiti.service.oa;
|
||||
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaCcDTO;
|
||||
import ink.wgink.module.activiti.pojo.pos.oa.OaCcPO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaCcVO;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: IFormCcService
|
||||
* @Description: 表单抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 11:28
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public interface IOaCcService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param oaCcVO
|
||||
*/
|
||||
void save(OaCcVO oaCcVO);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
* @param processInstanceId
|
||||
* @param reportUid
|
||||
* @param userIds
|
||||
*/
|
||||
void save(String formCode, Integer formVersion, String processInstanceId, String reportUid, List<String> userIds);
|
||||
|
||||
/**
|
||||
* 更新阅读状态
|
||||
*
|
||||
* @param ccId
|
||||
* @param isRead
|
||||
*/
|
||||
void updateRead(String ccId, int isRead);
|
||||
|
||||
/**
|
||||
* 抄送列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<OaCcPO> listPO(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 抄送列表
|
||||
*
|
||||
* @param reportUid
|
||||
* @return
|
||||
*/
|
||||
List<OaCcPO> listPOByReportUid(String reportUid);
|
||||
|
||||
/**
|
||||
* 抄送列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<OaCcDTO> list(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 抄送列表
|
||||
*
|
||||
* @param reportUid
|
||||
* @return
|
||||
*/
|
||||
List<OaCcDTO> listByReportUid(String reportUid);
|
||||
|
||||
/**
|
||||
* 抄送分页列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaCcDTO>> listPage(ListPage page);
|
||||
|
||||
/**
|
||||
* 抄送分页列表
|
||||
*
|
||||
* @param reportUid
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaCcDTO>> listPageByReportUid(String reportUid, ListPage page);
|
||||
|
||||
/**
|
||||
* 我的抄送列表
|
||||
*
|
||||
* @param isRead
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(Integer isRead, ListPage page);
|
||||
|
||||
/**
|
||||
* 我的
|
||||
*
|
||||
* @param isRead
|
||||
* @return
|
||||
*/
|
||||
Integer countReadOfMine(int isRead);
|
||||
|
||||
}
|
@ -49,6 +49,17 @@ public interface IOaFormReportRouteService {
|
||||
*/
|
||||
void show(String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
/**
|
||||
* 查询页面
|
||||
*
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
* @param httpSession
|
||||
* @param httpServletRequest
|
||||
* @param httpServletResponse
|
||||
*/
|
||||
void updateRead(String formCode, Integer formVersion, String ccId, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
/**
|
||||
* APP新增页面
|
||||
*
|
||||
@ -85,4 +96,5 @@ public interface IOaFormReportRouteService {
|
||||
*/
|
||||
void appShow(String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ public interface IOaFormReportService {
|
||||
String KEY_SELECT_TYPE = "selectType";
|
||||
String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
|
||||
String KEY_RECORD_FIELDS = "recordFields";
|
||||
/**
|
||||
* 抄送
|
||||
*/
|
||||
String KEY_CCS = "ccs";
|
||||
String KEY_REASON = "reason";
|
||||
/**
|
||||
* 签批关键字后缀
|
||||
@ -126,6 +130,14 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
void updateForcedEnd(String processInstanceId, String currentTaskId, String reason);
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param taskId
|
||||
* @param assignee
|
||||
*/
|
||||
void updateTaskAssignee(String taskId, String assignee);
|
||||
|
||||
/**
|
||||
* 表单详情
|
||||
*
|
||||
@ -176,5 +188,4 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
SuccessResultList<List<Map<String, Object>>> listPage(String formCode, Integer formVersion, ListPage page);
|
||||
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,13 @@ public interface IOaService {
|
||||
*/
|
||||
List<OaTaskDTO> listTaskOfMine();
|
||||
|
||||
/**
|
||||
* 我的任务(待办)总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Long countTaskOfMine();
|
||||
|
||||
/**
|
||||
* 我的任务(待办)分页列表
|
||||
*
|
||||
@ -72,4 +79,5 @@ public interface IOaService {
|
||||
* @return
|
||||
*/
|
||||
List<OaProcessLogDTO> listProcessLog(String processInstanceId);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,208 @@
|
||||
package ink.wgink.module.activiti.service.oa.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.module.activiti.dao.oa.IOaCcDao;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaCcDTO;
|
||||
import ink.wgink.module.activiti.pojo.pos.oa.OaCcPO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaCcVO;
|
||||
import ink.wgink.module.activiti.service.oa.IOaCcService;
|
||||
import ink.wgink.module.form.service.design.IFormDesignService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.UUIDUtil;
|
||||
import ink.wgink.util.map.HashMapUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @ClassName: FormCcServiceImpl
|
||||
* @Description: 表单抄送
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/9 11:28
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class OaCcServiceImpl extends DefaultBaseService implements IOaCcService {
|
||||
|
||||
@Autowired
|
||||
private IOaCcDao oaCcDao;
|
||||
@Autowired
|
||||
private IUserBaseService userBaseService;
|
||||
@Autowired
|
||||
private IFormReportService formReportService;
|
||||
|
||||
|
||||
@Override
|
||||
public void save(OaCcVO oaCcVO) {
|
||||
String formCcId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(oaCcVO);
|
||||
params.put("ccId", formCcId);
|
||||
params.put("isRead", 0);
|
||||
setSaveInfo(params);
|
||||
oaCcDao.save(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(String formCode, Integer formVersion, String processInstanceId, String reportUid, List<String> userIds) {
|
||||
if (userIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<OaCcPO> oaCcPOS = listPOByReportUid(reportUid);
|
||||
for (String userId : userIds) {
|
||||
if (StringUtils.isBlank(userId)) {
|
||||
continue;
|
||||
}
|
||||
boolean isExist = false;
|
||||
for (OaCcPO oaCcPO : oaCcPOS) {
|
||||
if (StringUtils.equals(userId, oaCcPO.getUserId())) {
|
||||
isExist = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isExist) {
|
||||
continue;
|
||||
}
|
||||
OaCcVO oaCcVO = new OaCcVO();
|
||||
oaCcVO.setFormCode(formCode);
|
||||
oaCcVO.setFormVersion(formVersion);
|
||||
oaCcVO.setProcessInstanceId(processInstanceId);
|
||||
oaCcVO.setReportUid(reportUid);
|
||||
oaCcVO.setUserId(userId);
|
||||
save(oaCcVO);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRead(String ccId, int isRead) {
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("ccId", ccId);
|
||||
params.put("isRead", isRead);
|
||||
setUpdateInfo(params);
|
||||
oaCcDao.updateRead(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaCcPO> listPO(Map<String, Object> params) {
|
||||
params = params == null ? getHashMap(0) : params;
|
||||
return oaCcDao.listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaCcPO> listPOByReportUid(String reportUid) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("reportUid", reportUid);
|
||||
return listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaCcDTO> list(Map<String, Object> params) {
|
||||
params = params == null ? getHashMap(0) : params;
|
||||
List<OaCcDTO> oaCcDTOS = oaCcDao.list(params);
|
||||
setMainTitle(oaCcDTOS);
|
||||
setUserName(oaCcDTOS);
|
||||
return oaCcDTOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaCcDTO> listByReportUid(String reportUid) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("reportUid", reportUid);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPage(ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<OaCcDTO> oaCcDTOS = oaCcDao.list(page.getParams());
|
||||
setMainTitle(oaCcDTOS);
|
||||
setUserName(oaCcDTOS);
|
||||
PageInfo<OaCcDTO> pageInfo = new PageInfo<>(oaCcDTOS);
|
||||
return new SuccessResultList<>(oaCcDTOS, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPageByReportUid(String reportUid, ListPage page) {
|
||||
page.getParams().put("reportUid", reportUid);
|
||||
return listPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(Integer isRead, ListPage page) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
page.getParams().put("userId", userId);
|
||||
page.getParams().put("isRead", isRead);
|
||||
return listPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countReadOfMine(int isRead) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("userId", userId);
|
||||
params.put("isRead", isRead);
|
||||
return oaCcDao.count(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主标题
|
||||
*
|
||||
* @param oaCcDTOS
|
||||
*/
|
||||
private void setMainTitle(List<OaCcDTO> oaCcDTOS) {
|
||||
if (oaCcDTOS.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
oaCcDTOS.forEach(oaCcDTO -> {
|
||||
Map<String, Object> reportMap = formReportService.get(oaCcDTO.getFormCode(), oaCcDTO.getFormVersion(), oaCcDTO.getReportUid());
|
||||
Object mainTitleObj = reportMap.get(IFormDesignService.FIELD_MAIN_TITLE);
|
||||
if (mainTitleObj == null) {
|
||||
oaCcDTO.setMainTitle("您有一条待阅内容");
|
||||
return;
|
||||
}
|
||||
String mainTitle = mainTitleObj.toString();
|
||||
if (StringUtils.isBlank(mainTitle)) {
|
||||
oaCcDTO.setMainTitle("您有一条待阅内容");
|
||||
return;
|
||||
}
|
||||
oaCcDTO.setMainTitle(mainTitle);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户名
|
||||
*
|
||||
* @param oaCcDTOS
|
||||
*/
|
||||
private void setUserName(List<OaCcDTO> oaCcDTOS) {
|
||||
if (oaCcDTOS.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> userIdSet = new HashSet<>();
|
||||
oaCcDTOS.forEach(oaCcDTO -> {
|
||||
userIdSet.add(oaCcDTO.getUserId());
|
||||
});
|
||||
List<UserDTO> userDTOs = userBaseService.listByUserIds(new ArrayList<>(userIdSet));
|
||||
if (userDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
oaCcDTOS.forEach(oaCcDTO -> {
|
||||
for (UserDTO userDTO : userDTOs) {
|
||||
if (StringUtils.equals(oaCcDTO.getCreator(), userDTO.getUserId())) {
|
||||
oaCcDTO.setCreatorName(userDTO.getUserName());
|
||||
}
|
||||
if (StringUtils.equals(oaCcDTO.getUserId(), userDTO.getUserId())) {
|
||||
oaCcDTO.setUserName(userDTO.getUserName());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -68,6 +68,8 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
private INodeFieldService nodeFieldService;
|
||||
@Autowired
|
||||
private INodeButtonService nodeButtonService;
|
||||
@Autowired
|
||||
private IOaCcService oaCcService;
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
@ -142,6 +144,12 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
formReportRouteService.show(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRead(String formCode, Integer formVersion, String ccId, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
oaCcService.updateRead(ccId, 1);
|
||||
show(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appSave(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
|
@ -14,6 +14,7 @@ import ink.wgink.module.activiti.pojo.bos.oa.OaFormReportUnWantedValueBO;
|
||||
import ink.wgink.module.activiti.pojo.bos.oa.TaskCommentBO;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.OaFormReportRecordFieldVO;
|
||||
import ink.wgink.module.activiti.service.activiti.IActivitiModelService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaCcService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.form.service.design.IFormFieldService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
@ -63,6 +64,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
private ManagementService managementService;
|
||||
@Autowired
|
||||
private IActivitiModelService activitiModelService;
|
||||
@Autowired
|
||||
private IOaCcService formCcService;
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params) {
|
||||
@ -82,8 +85,6 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
|
||||
LOG.debug("保存表单");
|
||||
String uid = formReportService.saveAndReturnId(formCode, formVersion, params);
|
||||
LOG.debug("保存附件");
|
||||
LOG.debug("保存");
|
||||
LOG.debug("定义流程发起人");
|
||||
Map<String, Object> variables = getHashMap(2);
|
||||
variables.put(KEY_FORM_CODE, formCode);
|
||||
@ -108,10 +109,10 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
setFormReportAssignee(oaFormReportUnWantedValueBO.getSelectType(), oaFormReportUnWantedValueBO.getAssignees(), params);
|
||||
}
|
||||
setRecordFields(task.getProcessInstanceId(), task.getId(), oaFormReportUnWantedValueBO.getRecordFields(), userId, userName, params);
|
||||
// 保存代理人昵称
|
||||
params.put(KEY_ASSIGNEE_USER_NAME, userName);
|
||||
// 保存表单日志
|
||||
taskService.complete(task.getId(), params);
|
||||
LOG.debug("保存抄送");
|
||||
formCcService.save(formCode, formVersion, processInstance.getProcessInstanceId(), uid, oaFormReportUnWantedValueBO.getCcs());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,10 +147,10 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
setFormReportAssignee(oaFormReportUnWantedValueBO.getSelectType(), oaFormReportUnWantedValueBO.getAssignees(), params);
|
||||
}
|
||||
setRecordFields(currentTask.getProcessInstanceId(), taskId, oaFormReportUnWantedValueBO.getRecordFields(), userId, userName, params);
|
||||
// 保存代理人昵称
|
||||
params.put(KEY_ASSIGNEE_USER_NAME, userName);
|
||||
// 保存表单日志
|
||||
taskService.complete(taskId, params);
|
||||
LOG.debug("保存抄送");
|
||||
formCcService.save(formCode, formVersion, currentTask.getProcessInstanceId(), uid, oaFormReportUnWantedValueBO.getCcs());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -336,6 +337,11 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskAssignee(String taskId, String assignee) {
|
||||
taskService.setAssignee(taskId, assignee);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存记录的字段列表
|
||||
*
|
||||
@ -389,12 +395,14 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
Boolean isNextEndEvent = Boolean.parseBoolean(reportParams.get(IOaFormReportService.KEY_IS_NEXT_END_EVENT).toString());
|
||||
Object excObj = reportParams.get(IActivitiModelService.EXCLUSIVE_GATEWAY_CONDITION_KEY);
|
||||
List<OaFormReportRecordFieldVO> oaFormReportRecordFieldVOs = JSONArray.parseArray(JSON.toJSONString(reportParams.get(IOaFormReportService.KEY_RECORD_FIELDS)), OaFormReportRecordFieldVO.class);
|
||||
List<String> ccVOs = (List<String>) reportParams.get(IOaFormReportService.KEY_CCS);
|
||||
// 移除无效的内容
|
||||
reportParams.remove(IOaFormReportService.KEY_ASSIGNEES);
|
||||
reportParams.remove(IOaFormReportService.KEY_SELECT_TYPE);
|
||||
reportParams.remove(IOaFormReportService.KEY_IS_NEXT_END_EVENT);
|
||||
reportParams.remove(IOaFormReportService.KEY_RECORD_FIELDS);
|
||||
reportParams.remove(IActivitiModelService.EXCLUSIVE_GATEWAY_CONDITION_KEY);
|
||||
reportParams.remove(IOaFormReportService.KEY_CCS);
|
||||
// 归类到对象
|
||||
OaFormReportUnWantedValueBO oaFormReportUnWantedValueBO = new OaFormReportUnWantedValueBO();
|
||||
oaFormReportUnWantedValueBO.setAssignees(assignees);
|
||||
@ -402,6 +410,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
oaFormReportUnWantedValueBO.setNextEndEvent(isNextEndEvent);
|
||||
oaFormReportUnWantedValueBO.setExc(excObj == null ? "" : excObj.toString());
|
||||
oaFormReportUnWantedValueBO.setRecordFields(oaFormReportRecordFieldVOs);
|
||||
oaFormReportUnWantedValueBO.setCcs(ccVOs);
|
||||
return oaFormReportUnWantedValueBO;
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,13 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
return listOaTask(tasks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
return taskQuery.count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(int page, int rows) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
|
@ -31,6 +31,7 @@
|
||||
`btn_forced_end` int(1) DEFAULT '0' COMMENT '强制结束按钮',
|
||||
`btn_print` int(1) DEFAULT '0' COMMENT '打印按钮',
|
||||
`btn_cc` int(1) DEFAULT '0' COMMENT '抄送按钮',
|
||||
`btn_transfer` int(1) DEFAULT '0' COMMENT '转交按钮',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `node_button_id` (`node_button_id`),
|
||||
KEY `model_id` (`model_id`,`model_version`),
|
||||
@ -53,7 +54,8 @@
|
||||
btn_go_back,
|
||||
btn_forced_end,
|
||||
btn_print,
|
||||
btn_cc
|
||||
btn_cc,
|
||||
btn_transfer
|
||||
) VALUES(
|
||||
#{nodeButtonId},
|
||||
#{modelId},
|
||||
@ -65,7 +67,8 @@
|
||||
#{btnGoBack},
|
||||
#{btnForcedEnd},
|
||||
#{btnPrint},
|
||||
#{btnCc}
|
||||
#{btnCc},
|
||||
#{btnTransfer}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -106,6 +109,9 @@
|
||||
</if>
|
||||
<if test="btnCc != null">
|
||||
btn_cc = #{btnCc},
|
||||
</if>
|
||||
<if test="btnTransfer != null">
|
||||
btn_transfer = #{btnTransfer},
|
||||
</if>
|
||||
node_button_id = #{nodeButtonId}
|
||||
WHERE
|
||||
@ -147,7 +153,8 @@
|
||||
btn_go_back,
|
||||
btn_forced_end,
|
||||
btn_print,
|
||||
btn_cc
|
||||
btn_cc,
|
||||
btn_transfer
|
||||
FROM
|
||||
oa_node_button
|
||||
WHERE
|
||||
|
@ -0,0 +1,215 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="ink.wgink.module.activiti.dao.oa.IOaCcDao">
|
||||
|
||||
<resultMap id="oaCcPO" type="ink.wgink.module.activiti.pojo.pos.oa.OaCcPO">
|
||||
<id column="cc_id" property="ccId"/>
|
||||
<result column="form_code" property="formCode"/>
|
||||
<result column="form_version" property="formVersion"/>
|
||||
<result column="process_instance_id" property="processInstanceId"/>
|
||||
<result column="report_uid" property="reportUid"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="is_read" property="isRead"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="oaCcDTO" type="ink.wgink.module.activiti.pojo.dtos.oa.OaCcDTO">
|
||||
<id column="cc_id" property="ccId"/>
|
||||
<result column="form_code" property="formCode"/>
|
||||
<result column="form_version" property="formVersion"/>
|
||||
<result column="process_instance_id" property="processInstanceId"/>
|
||||
<result column="report_uid" property="reportUid"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="is_read" property="isRead"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 建表 -->
|
||||
<update id="createTable">
|
||||
CREATE TABLE IF NOT EXISTS `oa_cc` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`cc_id` char(36) DEFAULT NULL COMMENT '主键',
|
||||
`form_code` varchar(255) DEFAULT NULL COMMENT '表单编码',
|
||||
`form_version` int(11) DEFAULT NULL COMMENT '表单版本',
|
||||
`process_instance_id` char(36) DEFAULT NULL COMMENT '流程实例ID',
|
||||
`report_uid` char(36) DEFAULT NULL COMMENT '上报uid',
|
||||
`user_id` char(36) DEFAULT NULL COMMENT '抄送人ID',
|
||||
`is_read` int(1) DEFAULT '0' COMMENT '是否已读',
|
||||
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`creator` char(36) DEFAULT NULL COMMENT '创建人',
|
||||
`gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`modifier` char(36) DEFAULT NULL COMMENT '修改人',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `cc_id` (`cc_id`),
|
||||
KEY `form_code` (`form_code`,`form_version`),
|
||||
KEY `process_instance_id` (`process_instance_id`),
|
||||
KEY `report_uid` (`report_uid`),
|
||||
KEY `user_id` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='表单抄送';
|
||||
</update>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO oa_cc(
|
||||
cc_id,
|
||||
form_code,
|
||||
form_version,
|
||||
process_instance_id,
|
||||
report_uid,
|
||||
user_id,
|
||||
is_read,
|
||||
gmt_create,
|
||||
creator,
|
||||
gmt_modified,
|
||||
modifier
|
||||
) VALUES(
|
||||
#{ccId},
|
||||
#{formCode},
|
||||
#{formVersion},
|
||||
#{processInstanceId},
|
||||
#{reportUid},
|
||||
#{userId},
|
||||
#{isRead},
|
||||
#{gmtCreate},
|
||||
#{creator},
|
||||
#{gmtModified},
|
||||
#{modifier}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新阅读状态 -->
|
||||
<update id="updateRead" parameterType="map">
|
||||
UPDATE
|
||||
oa_cc
|
||||
SET
|
||||
is_read = #{isRead},
|
||||
gmt_modified = #{gmtModified},
|
||||
modifier = #{modifier}
|
||||
WHERE
|
||||
cc_id = #{ccId}
|
||||
</update>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="listPO" parameterType="map" resultMap="oaCcPO">
|
||||
SELECT
|
||||
cc_id,
|
||||
form_code,
|
||||
form_version,
|
||||
process_instance_id,
|
||||
report_uid,
|
||||
user_id,
|
||||
is_read,
|
||||
gmt_create,
|
||||
gmt_modified,
|
||||
creator
|
||||
FROM
|
||||
oa_cc
|
||||
<where>
|
||||
<if test="formCode != null and formCode != ''">
|
||||
form_code = #{formCode}
|
||||
</if>
|
||||
<if test="formVersion != null">
|
||||
AND
|
||||
form_version = #{formVersion}
|
||||
</if>
|
||||
<if test="processInstanceId != null and processInstanceId != ''">
|
||||
AND
|
||||
process_instance_id = #{processInstanceId}
|
||||
</if>
|
||||
<if test="reportUid != null and reportUid != ''">
|
||||
AND
|
||||
report_uid = #{reportUid}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
user_id = #{userId}
|
||||
</if>
|
||||
<if test="isRead != null">
|
||||
AND
|
||||
is_read = #{isRead}
|
||||
</if>
|
||||
</where>
|
||||
<if test="sort != null and (sort == 'gmtCreate')">
|
||||
ORDER BY
|
||||
<if test="sort == 'gmtCreate'">
|
||||
gmt_create ${order}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="list" parameterType="map" resultMap="oaCcDTO">
|
||||
SELECT
|
||||
cc_id,
|
||||
form_code,
|
||||
form_version,
|
||||
process_instance_id,
|
||||
report_uid,
|
||||
user_id,
|
||||
is_read,
|
||||
gmt_create,
|
||||
gmt_modified,
|
||||
creator
|
||||
FROM
|
||||
oa_cc
|
||||
<where>
|
||||
<if test="formCode != null and formCode != ''">
|
||||
form_code = #{formCode}
|
||||
</if>
|
||||
<if test="formVersion != null">
|
||||
AND
|
||||
form_version = #{formVersion}
|
||||
</if>
|
||||
<if test="processInstanceId != null and processInstanceId != ''">
|
||||
AND
|
||||
process_instance_id = #{processInstanceId}
|
||||
</if>
|
||||
<if test="reportUid != null and reportUid != ''">
|
||||
AND
|
||||
report_uid = #{reportUid}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
user_id = #{userId}
|
||||
</if>
|
||||
<if test="isRead != null">
|
||||
AND
|
||||
is_read = #{isRead}
|
||||
</if>
|
||||
</where>
|
||||
<if test="sort != null and (sort == 'gmtCreate')">
|
||||
ORDER BY
|
||||
<if test="sort == 'gmtCreate'">
|
||||
gmt_create ${order}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 统计 -->
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
oa_cc
|
||||
<where>
|
||||
<if test="formCode != null and formCode != ''">
|
||||
form_code = #{formCode}
|
||||
</if>
|
||||
<if test="formVersion != null">
|
||||
AND
|
||||
form_version = #{formVersion}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
user_id = #{userId}
|
||||
</if>
|
||||
<if test="isRead != null">
|
||||
AND
|
||||
is_read = #{isRead}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -69,7 +69,8 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
|
||||
btnGoBack: 0,
|
||||
btnForcedEnd: 0,
|
||||
btnCc: 0,
|
||||
btnPrint: 0
|
||||
btnPrint: 0,
|
||||
btnTransfer: 0
|
||||
},
|
||||
oaUserTaskListeners: []
|
||||
}
|
||||
|
@ -477,6 +477,18 @@
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center">6</td>
|
||||
<td>转交</td>
|
||||
<td>
|
||||
<label class="radio-inline">
|
||||
<input ng-model="oaNodeManage.formButton.btnTransfer" type="radio" value="0"> 关闭
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input ng-model="oaNodeManage.formButton.btnTransfer" type="radio" value="1"> 开启
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -57,15 +57,6 @@
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'taskId', width:150, title: '主键', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'taskName', width:200, title: '流程名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
|
@ -57,15 +57,6 @@
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'id', width:300, title: '流程定义ID', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'version', width:80, title: '版本', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
|
@ -1,173 +0,0 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
#runtimeProcessImageBox {position: relative;}
|
||||
#operationBtnBox {position: absolute; top: 0; left: 0;}
|
||||
.row-title {background-color: #f2f2f2;}
|
||||
.log-sign-box {}
|
||||
.log-sign-box span {margin-right: 10px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">流转日志</li>
|
||||
<li>流转图</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div id="processLog" class="layui-tab-item layui-show"></div>
|
||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
||||
<div id="runtimeProcessImageBox">
|
||||
<img id="runtimeProcessImage" alt="流转图" style="height: 100%"/>
|
||||
</div>
|
||||
<div id="operationBtnBox" class="layui-btn-group">
|
||||
<button id="searchPlus" type="button" class="layui-btn layui-btn-xs" title="放大">
|
||||
<i class="fa fa-search-plus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchMinus" type="button" class="layui-btn layui-btn-xs layui-btn-default" title="缩小">
|
||||
<i class="fa fa-search-minus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchDefault" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="还原">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate'], function(){
|
||||
var $ = layui.$;
|
||||
var win = $(window)
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var processInstanceId = params.processInstanceId;
|
||||
var formCode = params.formCode;
|
||||
var formVersion = params.formCode;
|
||||
var uid = params.formCode;
|
||||
var processImageEnlargeScale = 0;
|
||||
|
||||
function initLog() {
|
||||
top.restAjax.get(top.restAjax.path('api/oa/list-process-log/process-instance-id/{processInstanceId}', [processInstanceId]), {}, null, function(code, data) {
|
||||
var ul = '<ul class="layui-timeline">';
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
// 处理签批内容
|
||||
var taskVariables = item.taskVariables;
|
||||
var signDom = '';
|
||||
for(var key in taskVariables) {
|
||||
if(key.indexOf('RECORD:') != 0) {
|
||||
continue;
|
||||
}
|
||||
var sign = JSON.parse(taskVariables[key]);
|
||||
signDom += '<div class="log-sign-box">' +
|
||||
'<span class="log-sign title" style="font-weight: bold;">【'+ key.replace('RECORD:', '') +'】</span>' +
|
||||
'<span class="log-sign content">内容:'+ sign.content +'</span>' +
|
||||
'<span class="log-sign time">时间:'+ sign.time +'</span>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
var li = [
|
||||
'<li class="layui-timeline-item">',
|
||||
' <i class="layui-icon layui-timeline-axis"></i>',
|
||||
' <div class="layui-timeline-content layui-text">',
|
||||
' <h3 class="layui-timeline-title">'+ item.startTime +'</h3>',
|
||||
' <table class="layui-table">',
|
||||
' <colgroup>',
|
||||
' <col width="100">',
|
||||
' <col>',
|
||||
' </colgroup>',
|
||||
' <tbody>',
|
||||
' <tr>',
|
||||
' <td class="row-title">任务名称</td>',
|
||||
' <td>'+ item.taskName +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">节点状态</td>',
|
||||
' <td>'+ (item.taskStatus == 'alreadyDone' ? '已办' : '待办') +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">结束时间</td>',
|
||||
' <td>'+ item.endTime +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">耗时</td>',
|
||||
' <td>'+ item.usedTime +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">处理人</td>',
|
||||
' <td>'+ item.userNames +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">签批</td>',
|
||||
' <td>',
|
||||
signDom,
|
||||
' </td>',
|
||||
' </tr>',
|
||||
' </tbody>',
|
||||
' </table>',
|
||||
' </div>',
|
||||
'</li>'
|
||||
].join('');
|
||||
ul += li;
|
||||
}
|
||||
ul += '</ul>';
|
||||
$('#processLog').append(ul);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
function initRuntimeProcessImage() {
|
||||
$('#runtimeProcessImage').attr('src', 'route/activiti/model/get-runtime-process-image/'+ processInstanceId);
|
||||
}
|
||||
|
||||
function init() {
|
||||
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
||||
height: (win.height() - 82) +'px',
|
||||
overflow: 'auto'
|
||||
});
|
||||
initLog();
|
||||
initRuntimeProcessImage();
|
||||
}
|
||||
init();
|
||||
|
||||
function setProcessImageSize() {
|
||||
$('#runtimeProcessImage').css('height', 100 + processImageEnlargeScale +'%');
|
||||
}
|
||||
|
||||
$('#searchPlus').click(function() {
|
||||
processImageEnlargeScale += 10;
|
||||
setProcessImageSize();
|
||||
})
|
||||
$('#searchMinus').click(function() {
|
||||
processImageEnlargeScale -= 10;
|
||||
setProcessImageSize();
|
||||
})
|
||||
$('#searchDefault').click(function() {
|
||||
processImageEnlargeScale = 0;
|
||||
setProcessImageSize();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,156 @@
|
||||
<!doctype html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'} ">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/oa/listpage-read-of-mine';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 50,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'mainTitle', width:300, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'creatorName', width: 150, title: '发送人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'gmtCreate', width:180, title: '发送时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'gmtModified', width:180, title: '阅读时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 100, title: '操作', align:'center',
|
||||
templet: function(row) {
|
||||
return '<div class="layui-btn-group">' +
|
||||
'<button class="layui-btn layui-btn-xs layui-btn-primary" lay-event="readEvent">查看</button>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 50,
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
if(layEvent === 'readEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa-form-report/show/code/{formCode}/version/{formVersion}?uid={reportUid}&processInstanceId={processInstanceId}', [data.formCode, data.formVersion, data.reportUid, data.processInstanceId]),
|
||||
title: '详情',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -57,15 +57,6 @@
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'taskId', width:150, title: '任务主键', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'processName', width:150, title: '流程名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
|
@ -0,0 +1,149 @@
|
||||
<!doctype html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'} ">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var tableUrl = 'api/oa/listpage-unread-of-mine';
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 50,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'mainTitle', width:300, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'creatorName', width: 150, title: '发送人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'gmtCreate', width:180, title: '发送时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 100, title: '操作', align:'center',
|
||||
templet: function(row) {
|
||||
return '<div class="layui-btn-group">' +
|
||||
'<button class="layui-btn layui-btn-xs layui-btn-primary" lay-event="readEvent">查看</button>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where: {},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 50,
|
||||
});
|
||||
}
|
||||
initTable();
|
||||
// 事件 - 页面变化
|
||||
$win.on('resize', function() {
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function() {
|
||||
reloadTable();
|
||||
}, 500);
|
||||
});
|
||||
// 事件 - 搜索
|
||||
$(document).on('click', '#search', function() {
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
if(layEvent === 'readEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa/update-read/code/{formCode}/version/{formVersion}/cc-id/{ccId}?uid={reportUid}&processInstanceId={processInstanceId}', [data.formCode, data.formVersion, data.ccId, data.reportUid, data.processInstanceId]),
|
||||
title: '详情',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -932,7 +932,8 @@ layui.config({
|
||||
}
|
||||
}
|
||||
});
|
||||
var SYSTEM_KEY_ARRAY = ['id', 'uid', 'gmt_create', 'creator', 'gmt_modified', 'modifier', 'is_delete', 'MAIN_TITLE', 'attachments', 'attachmentBtn', 'showAttachmentBtn', 'goBackBtn'];
|
||||
// 系统关键字
|
||||
var SYSTEM_KEY_ARRAY = ['id', 'uid', 'gmt_create', 'creator', 'gmt_modified', 'modifier', 'is_delete', 'MAIN_TITLE', 'attachments', 'attachmentBtn', 'showAttachmentBtn', 'goBackBtn', 'printBtn', 'forcedEndBtn', 'ccs', 'ccBtn', 'transferBtn'];
|
||||
// 更新 option json
|
||||
$(document).off('blur', '#columnProperty .layui-input').on('blur', '#columnProperty .layui-input', function () {
|
||||
if ($(this).attr("name") !== undefined) {
|
||||
|
@ -25,6 +25,23 @@ function OaFormUtil(layui) {
|
||||
formData.field.recordFields = recordFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置抄送列表
|
||||
* @param formData
|
||||
*/
|
||||
this.setCcs = function(formData) {
|
||||
if(!formData.field.ccs) {
|
||||
formData.field.ccs = [];
|
||||
return;
|
||||
}
|
||||
var ccs = formData.field.ccs.split(',');
|
||||
var ccArray = [];
|
||||
for(var i = 0, item; item = ccs[i++];) {
|
||||
ccArray.push(item);
|
||||
}
|
||||
formData.field.ccs = ccArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置签字列表
|
||||
* @param formData
|
||||
@ -313,6 +330,9 @@ function OaFormUtil(layui) {
|
||||
if(formButton.btnCc) {
|
||||
buttons += '<button id="ccBtn" type="button" class="layui-btn layui-btn-xs layui-btn-normal confirm-btn">抄送</button>';
|
||||
}
|
||||
if(formButton.btnTransfer) {
|
||||
buttons += '<button id="transferBtn" type="button" class="layui-btn layui-btn-xs layui-btn-normal confirm-btn">转交</button>';
|
||||
}
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-btn layui-btn-xs layui-btn-default confirm-btn">上传附件</button>';
|
||||
}
|
||||
@ -579,13 +599,15 @@ function OaFormUtil(layui) {
|
||||
$(document.body).on('click', '#ccBtn', function() {
|
||||
function getCcArray() {
|
||||
var selectedUserIdArray = [];
|
||||
if(!$('#ccs').val()) {
|
||||
return selectedUserIdArray;
|
||||
}
|
||||
var ccsArray = $('#ccs').val().split(',');
|
||||
for(var i = 0, item; item = ccsArray[i++];) {
|
||||
if(!item) {
|
||||
continue;
|
||||
}
|
||||
var ccArray = item.split(':');
|
||||
selectedUserIdArray.push(ccArray[0]);
|
||||
selectedUserIdArray.push(item);
|
||||
}
|
||||
return selectedUserIdArray;
|
||||
}
|
||||
@ -603,7 +625,7 @@ function OaFormUtil(layui) {
|
||||
if (ccs.length > 0) {
|
||||
ccs += ',';
|
||||
}
|
||||
ccs += item.userId + ':' + item.userName.replace(/[\,\:]/g, ',');
|
||||
ccs += item.userId;
|
||||
}
|
||||
$('#ccs').val(ccs);
|
||||
}
|
||||
|
@ -107,6 +107,7 @@
|
||||
// 提交前处理
|
||||
formUtil.clearUploadField(formData);
|
||||
oaFormUtil.setEditHistoryFields(formData, fields);
|
||||
oaFormUtil.setCcs(formData);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.post(restAjax.path('api/oa-form-report/save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}', [
|
||||
|
@ -158,6 +158,7 @@
|
||||
// 提交前处理
|
||||
formUtil.clearUploadField(formData);
|
||||
oaFormUtil.setEditHistoryFields(formData, fields);
|
||||
oaFormUtil.setCcs(formData);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.put(restAjax.path('api/oa-form-report/update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}/uid/{uid}', [
|
||||
|
Loading…
Reference in New Issue
Block a user