Commit c780ecf3 authored by Ken you's avatar Ken you

update 报表审批流程 ---Ken

parent 02721594
......@@ -73,7 +73,24 @@ public final class Constant {
public static final String APPROVAL_DISAGREED="disagreed";
public static final String ASSIGNEE_MANAGER="manager";
public static final String ASSIGNEE_TAX_BP="tax_bp";
public static final String ASSIGNEE_COMPLIANCE_IA="compliance_ia";
public static final String ASSIGNEE_COMPLIANCE_CHIEF ="compliance_chief";
public static final String ASSIGNEE_ACCOUNTANT="accountant";
//中文角色名
public static final String ROLE_ACCOUNTANT="会计";
public static final String ROLE_COMPLIANCE_CHIEF="合规负责人";
public static final String ROLE_TAX_BP="税务BP";
public static final String ROLE_COMPLIANCE_IA="合规IA";
public static final String[] APPROVAL_ROLEAll={
ROLE_ACCOUNTANT,
ROLE_COMPLIANCE_CHIEF,
ROLE_TAX_BP,
ROLE_COMPLIANCE_IA};
public static final String[] APPROVAL_ROLE2={
ROLE_TAX_BP,
ROLE_COMPLIANCE_IA};
public static class DataSourceName {
public static final String KeyValueDataSource = "KeyValueDataSource";
......
......@@ -53,9 +53,9 @@ public class ApprovalController {
}
@ResponseBody
@RequestMapping(value = "/tasks/{assignee}")
public List<ApprovalTaskInfo> data(@PathVariable String assignee) {//accountant manager
return approvalService.getTask();
@RequestMapping(value = "/tasks/{assignee}/{year}/{month}")
public List<ApprovalTaskInfo> data(@PathVariable String assignee,@PathVariable Integer year,@PathVariable Integer month) {//accountant manager
return approvalService.getTask(year,month);
}
@ResponseBody
......@@ -65,11 +65,18 @@ public class ApprovalController {
}
// @ApiOperation(value = "审批报表")
/**
* 同机构的不同角色不会有相同的用户
* @param projectId
* @param period
* @param decide
* @param comment
*/
@ResponseBody
@RequestMapping(value = "/check/{projectId}/{period}",method = RequestMethod.PUT)
@Secured("vatApproval:check")
public void check(@PathVariable String projectId,@PathVariable Integer period, @RequestParam String decide, @RequestParam String comment) {//only for manager role
approvalService.checkTask(projectId, period, decide,comment);
approvalService.checkTask(projectId, period, decide,comment,"");
}
@ResponseBody
......
......@@ -1067,7 +1067,5 @@ public class UserServiceImpl extends AbstractService {
logger.error(String.format("导出用户信息异常:%s",e.getMessage()));
}
return null;
}
}
package pwc.taxtech.atms.vat.service.impl;
import java.util.Date;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Attachment;
import org.activiti.engine.task.Task;
import org.nutz.lang.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,20 +18,25 @@ import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.RoleMapper;
import pwc.taxtech.atms.dao.TemplateMapper;
import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dao.UserRoleMapper;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.PeriodApproveMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.dpo.ApprovalTaskNodeInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import java.util.*;
import static pwc.taxtech.atms.common.util.SpringContextUtil.periodTemplateMapper;
import java.util.stream.Collectors;
@Service
public class ApprovalService {
......@@ -36,6 +46,8 @@ public class ApprovalService {
@Autowired
TaskService taskService;
@Autowired
HistoryService historyService;
@Autowired
PeriodApproveMapper periodApproveMapper;
@Autowired
PeriodReportMapper reportMapper;
......@@ -43,25 +55,32 @@ public class ApprovalService {
AuthUserHelper authUserHelper;
@Autowired
TemplateMapper templateMapper;
@Autowired
RepositoryService repositoryService;
@Autowired
UserRoleMapper userRoleMapper;
@Autowired
RoleMapper roleMapper;
@Autowired
UserMapper userMapper;
@Transactional
public void startInstanceAndAssignee(ApprovalDto dto) {
repositoryService.createDeployment().addClasspathResource("bpmn/approval1.bpmn").deploy();
PeriodApprove pa = new PeriodApprove();
startInstance(dto, pa);
startAssignee(pa);
createAttache(pa);
//createAttache(pa);
}
public List<ApprovalTaskInfo> getTask() {
return periodApproveMapper.queryApprovalList();
public List<ApprovalTaskInfo> getTask(Integer year,Integer month) {
return getApprovalTaskInfos(periodApproveMapper.queryApprovalList(year, month));
}
private void startInstance(ApprovalDto dto, PeriodApprove pa) {
List<PeriodReport> currentReports = reportMapper.selectOrderReportIds(dto.getProjectId(),dto.getPeriod());
MyAsserts.assertNotEmpty(currentReports, Exceptions.NOT_FOUND_REPORT_EXCEPTION);
pa.setId(UUID.randomUUID().toString());
pa.setPeriod(dto.getPeriod());
pa.setYear(dto.getYear());
......@@ -74,7 +93,7 @@ public class ApprovalService {
});
PeriodApproveExample pae = new PeriodApproveExample();
pae.createCriteria().andProjectIdEqualTo(dto.getProjectId()).andPeriodEqualTo(dto.getPeriod())
PeriodApproveExample.Criteria criteria = pae.createCriteria().andProjectIdEqualTo(dto.getProjectId()).andPeriodEqualTo(dto.getPeriod())
.andYearEqualTo(dto.getYear()).andReportIdsEqualTo(reportIds.toString())
.andTemplateIdsEqualTo(reportTemplateIds.toString()).andStatusEqualTo(Constant.APPROVAL_COMMITTED);
......@@ -95,14 +114,14 @@ public class ApprovalService {
}
private void startAssignee(PeriodApprove pa) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_ACCOUNTANT).processInstanceId(
List<Task> tasks = taskService.createTaskQuery().taskName(Constant.ROLE_ACCOUNTANT).processInstanceId(
pa.getInstanceId()).list();
if (tasks != null && tasks.size() == 1) {
Task task = tasks.get(0);
Map<String, Object> map = new HashMap<>();
map.put("committed", 0);
//设置当前操作人Id
taskService.setAssignee(task.getId(),authUserHelper.getCurrentUserId());
taskService.complete(task.getId(), map);
} else {
logger.warn("task must not null or size eq 1");
......@@ -110,20 +129,26 @@ public class ApprovalService {
}
private void createAttache(PeriodApprove pa) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_MANAGER).processInstanceId(
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_COMPLIANCE_CHIEF).processInstanceId(
pa.getInstanceId()).list();
if (tasks != null && tasks.size() == 1) {
Task task = tasks.get(0);
taskService.createAttachment("java.lang.String", task.getId(), task.getProcessInstanceId(),
"period_approval_uuid", pa.getId(), pa.getId());
"period_approval_uuid", pa.getId(), "用户id");
} else {
logger.warn("task must not null or size eq 1");
}
}
/**
* 合规负责人审批
* @param projectId
* @param period
* @param decide
* @param comment
*/
@Transactional
public void checkTask(String projectId,Integer period, String decide,String comment) {
public void checkTask1(String projectId,Integer period, String decide,String comment) {
PeriodApprove approve= periodApproveMapper.getInstanceIdByProjectIdAndPeriod(projectId,period);
MyAsserts.assertTrue(approve!=null&&approve.getStatus().equals("committed"),Exceptions.NOT_FOUND_INSTANCE_EXCEPTION);
String instanceId = approve.getInstanceId();
......@@ -141,7 +166,7 @@ public class ApprovalService {
default:
throw new BadParameterException("not support decide param type");
}
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_MANAGER).processInstanceId(
List<Task> tasks = taskService.createTaskQuery().taskName(Constant.ROLE_COMPLIANCE_CHIEF).processInstanceId(
instanceId).list();
if (tasks != null && tasks.size() == 1) {
......@@ -151,23 +176,171 @@ public class ApprovalService {
if (attachments != null && attachments.size() == 1) {
String uuid = attachments.get(0).getDescription();
taskService.complete(task.getId(), map);
pa.setId(uuid);
pa.setApprovalBy(authUserHelper.getCurrentUserId() == null ? "Admin" : authUserHelper.getCurrentUserId());
//pa.setApprovalBy(authUserHelper.getCurrentUserId() == null ? "Admin" : authUserHelper.getCurrentUserId());
pa.setApprovalTime(new Date());
pa.setApprovalResualt(comment);
periodApproveMapper.updateByPrimaryKeySelective(pa);
} else {
logger.warn("task must not null or size gt 1");
}
} else {
logger.warn("task must not null or size eq 1");
}
}
/**
* 税务BP和合规IA审批
* @param projectId
* @param period
* @param decide
* @param comment
*/
@Transactional
public void checkTask(String projectId,Integer period, String decide,String comment,String roleNull) {
// 当前用户角色
List<String> roleNames= getCurrentUserRoles();
String role="";
if(roleNames.contains(Constant.ROLE_COMPLIANCE_CHIEF)){
role=Constant.ROLE_COMPLIANCE_CHIEF;
}
if(roleNames.contains(Constant.ROLE_TAX_BP)){
role=Constant.ROLE_TAX_BP;
}
if(roleNames.contains(Constant.ROLE_COMPLIANCE_IA)){
role=Constant.ROLE_COMPLIANCE_IA;
}
if(Strings.isEmpty(role)){
throw new BadParameterException("Sorry ,you are not authorized to approve the current node");
}
PeriodApprove approve= periodApproveMapper.getInstanceIdByProjectIdAndPeriod(projectId,period);
MyAsserts.assertTrue(approve!=null&&approve.getStatus().equals("committed"),Exceptions.NOT_FOUND_INSTANCE_EXCEPTION);
String instanceId = approve.getInstanceId();
Map<String, Object> map = new HashMap<>();
PeriodApprove pa = new PeriodApprove();
pa.setId(approve.getId());
switch (decide) {
case Constant.APPROVAL_AGREED:
pa.setStatus(Constant.APPROVAL_AGREED);
map.put("decide", 1);
break;
case Constant.APPROVAL_DISAGREED:
pa.setStatus(Constant.APPROVAL_DISAGREED);
map.put("decide", 0);
break;
default:
throw new BadParameterException("not support decide param type");
}
List<Task> tasks = taskService.createTaskQuery().taskName(role).processInstanceId(
instanceId).list();
if (tasks != null && tasks.size() == 1) {
Map<String, Object> p = new HashMap<>();
p.put("description","1111");
Task task = tasks.get(0);
//设置操作人id及操作原因
taskService.setAssignee(task.getId(),authUserHelper.getCurrentUserId()+"<>"+comment);
taskService.complete(task.getId(), map);
//只要有驳回都算驳回
if(Constant.APPROVAL_DISAGREED.equals(decide)){
pa.setStatus(Constant.APPROVAL_DISAGREED);
}
pa.setApprovalBy(authUserHelper.getCurrentUserId() == null ? "Admin" : authUserHelper.getCurrentUserId());
pa.setApprovalTime(new Date());
pa.setApprovalResualt(comment);
periodApproveMapper.updateByPrimaryKeySelective(pa);
} else {
logger.warn("task must not null or size eq 1");
throw new ApplicationException("can't find the status approval task or your role is wrong ");
}
//税务BP或者合规IA驳回则返回到上一节点,且删除对方节点
if(Arrays.asList(Constant.APPROVAL_ROLE2).contains(role)&&Constant.APPROVAL_DISAGREED.equals(decide)){
List<Task> tasks1=new ArrayList<>();
if(Constant.ROLE_COMPLIANCE_IA.equals(role)){
tasks1 = taskService.createTaskQuery().taskName(Constant.ROLE_TAX_BP).processInstanceId(
instanceId).list();
if (tasks1 != null && tasks1.size() == 1) {
repositoryService.deleteDeployment(tasks1.get(0).getId());
}
}else{
tasks1 = taskService.createTaskQuery().taskName(Constant.ROLE_COMPLIANCE_IA).processInstanceId(
instanceId).list();
if (tasks1 != null && tasks1.size() == 1) {
repositoryService.deleteDeployment(tasks1.get(0).getId());
}
}
}
currentNode(approve);
}
private void currentNode(PeriodApprove pa){
//历史流程
List<HistoricActivityInstance> histories=historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().desc()
.processInstanceId(pa.getInstanceId())
.list();
logger.debug("show current node history");
histories.forEach(a->{
List<String> assignee=splitAssignee(a.getAssignee());
logger.debug("任务ID: "+a.getId()+" 任务名称: "+a.getActivityName()+" 任务创建时间: "+a.getStartTime()
+" 任务办理人: "+assignee.get(0)+" 原因: "+assignee.get(1)+" 流程实例ID: "+a.getProcessInstanceId()
+" 执行对象ID: "+a.getExecutionId()+" 流程定义ID: "+a.getProcessDefinitionId());
});
//当前流程状态
logger.debug("show current node status");
List<Task> tasks = taskService.createTaskQuery().processInstanceId(
pa.getInstanceId()).list();
tasks.forEach(a->{
List<String> assignee=splitAssignee(a.getAssignee());
logger.debug("任务ID: "+a.getId()+" 任务创建时间: "+a.getCreateTime()+" 任务当前角色: "+a.getName()
+" 任务待办理人: "+assignee.get(0)+" 原因: "+assignee.get(1)+" 流程实例ID: "+a.getProcessInstanceId()
+" 执行对象ID: "+a.getExecutionId()+" 流程定义ID: "+a.getProcessDefinitionId());
});
//更新当前流程状态,此流程已完成
if(histories.size()>0){
if(histories.get(0).getActivityName().equals("EndEvent")&&tasks.size()==0){
pa.setStatus(Constant.APPROVAL_AGREED);
periodApproveMapper.updateByPrimaryKeySelective(pa);
}
}
}
private List<ApprovalTaskInfo> getApprovalTaskInfos(List<ApprovalTaskInfo> approvalTaskInfos){
for (ApprovalTaskInfo approvalTaskInfo : approvalTaskInfos) {
List<ApprovalTaskNodeInfo> approvalTaskNodeInfos=getApprovalTaskNode(approvalTaskInfo.getInstanceId());
approvalTaskInfo.setItems(approvalTaskNodeInfos);
}
return approvalTaskInfos;
}
private List<ApprovalTaskNodeInfo> getApprovalTaskNode(String instanceId){
//历史流程
List<HistoricActivityInstance> histories=historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().desc()
.processInstanceId(instanceId)
.list();
logger.debug("show current node history");
histories.forEach(a->{
List<String> assignee=splitAssignee(a.getAssignee());
logger.debug("任务ID: "+a.getId()+" 任务名称: "+a.getActivityName()+" 任务创建时间: "+a.getStartTime()
+" 任务办理人: "+assignee.get(0)+" 原因: "+assignee.get(1)+" 流程实例ID: "+a.getProcessInstanceId()
+" 执行对象ID: "+a.getExecutionId()+" 流程定义ID: "+a.getProcessDefinitionId());
});
List<ApprovalTaskNodeInfo> approvalTaskNodeInfos=new ArrayList<>();
List<HistoricActivityInstance> histories1= histories.stream().filter(a->Arrays.asList(Constant.APPROVAL_ROLEAll).contains(a.getActivityName())).collect(Collectors.toList());
for(HistoricActivityInstance item:histories1){
ApprovalTaskNodeInfo approvalTaskNodeInfo=new ApprovalTaskNodeInfo();
approvalTaskNodeInfo.setStartTime(item.getStartTime());
approvalTaskNodeInfo.setRole(item.getActivityName());
List<String> assignee=splitAssignee(item.getAssignee());
approvalTaskNodeInfo.setUserId(assignee.get(0));
approvalTaskNodeInfo.setComment(assignee.get(1));
approvalTaskNodeInfo.setUserName(getUserName(assignee.get(0)));
approvalTaskNodeInfos.add(approvalTaskNodeInfo);
}
return approvalTaskNodeInfos;
}
private String getUserName(String id){
User user=userMapper.selectByPrimaryKey(id);
return user==null?"":user.getUserName();
}
public Template getTemplateInfo(Long templateId) {
......@@ -177,4 +350,43 @@ public class ApprovalService {
public String getApprovalStatus(String projectId, Integer period) {
return periodApproveMapper.getStatusByProjectIdAndPeriod(projectId,period);
}
//分割操作人及原因
private List<String> splitAssignee(String assignee){
if(assignee==null){
return Arrays.asList("","");
}
List<String> bb=Arrays.asList(assignee.split("<>"));
List<String> aa=new ArrayList<>(bb);
if(aa.size()==0){
aa.add("");
aa.add("");
}
if(aa.size()==1){
aa.add("");
}
return aa;
}
/**
* 根据projectid获取当前用户在该机构的角色
* @return
*/
private List<String> getCurrentUserRoles(){
UserRoleExample userRoleExample=new UserRoleExample();
userRoleExample.createCriteria().andUserIdEqualTo(authUserHelper.getCurrentUserId());
List<UserRole> userRols=userRoleMapper.selectByExample(userRoleExample);
List<String> roleNames=new ArrayList<>();
if(userRols.size()>0){
List<String> roleIds=userRols.stream().map(UserRole::getRoleId).collect(Collectors.toList()) ;
RoleExample roleExample=new RoleExample();
roleExample.createCriteria().andIdIn(roleIds);
List<Role> roles=roleMapper.selectByExample(roleExample);
if (roles.size() > 0) {
roleNames=roles.stream().map(Role::getName).collect(Collectors.toList());
}
}
return roleNames;
}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1553596687364" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="approvalProcess" isClosed="false" isExecutable="true" name="ApprovalProcess" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:assignee="accountant" activiti:exclusive="true" id="_3" name="会计"/>
<userTask activiti:assignee="compliance_chief" activiti:exclusive="true" id="_4" name="合规负责人"/>
<sequenceFlow id="_6" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_7" name="提交" sourceRef="_3" targetRef="_4"/>
<parallelGateway gatewayDirection="Unspecified" id="_9" name="ParallelGateway"/>
<userTask activiti:assignee="tax_bp" activiti:exclusive="true" id="_11" name="税务BP"/>
<userTask activiti:assignee="compliance_ia" activiti:exclusive="true" id="_12" name="合规IA"/>
<sequenceFlow id="_13" sourceRef="_9" targetRef="_11"/>
<sequenceFlow id="_14" sourceRef="_9" targetRef="_12"/>
<parallelGateway gatewayDirection="Unspecified" id="_20" name="ParallelGateway"/>
<sequenceFlow id="_21" name="通过" sourceRef="_11" targetRef="_20">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_22" name="通过" sourceRef="_12" targetRef="_20">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<endEvent id="_26" name="EndEvent"/>
<sequenceFlow id="_28" name="审批" sourceRef="_20" targetRef="_26"/>
<sequenceFlow id="_29" name="驳回" sourceRef="_11" targetRef="_4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_5" name="驳回" sourceRef="_12" targetRef="_4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="_8" name="ExclusiveGateway"/>
<sequenceFlow id="_15" name="通过" sourceRef="_8" targetRef="_9">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_17" name="审批" sourceRef="_4" targetRef="_8"/>
<sequenceFlow id="_10" name="驳回" sourceRef="_8" targetRef="_3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram documentation="background=#32424A;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="approvalProcess">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="-5.0" y="155.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="65.0" y="140.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="170.0" y="75.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_9" id="Shape-_9">
<omgdc:Bounds height="32.0" width="32.0" x="440.0" y="125.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_11" id="Shape-_11">
<omgdc:Bounds height="55.0" width="85.0" x="525.0" y="10.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_12" id="Shape-_12">
<omgdc:Bounds height="55.0" width="85.0" x="525.0" y="270.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_20" id="Shape-_20">
<omgdc:Bounds height="32.0" width="32.0" x="650.0" y="150.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_26" id="Shape-_26">
<omgdc:Bounds height="32.0" width="32.0" x="740.0" y="150.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_8" id="Shape-_8" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="290.0" y="265.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="_9" targetElement="_11">
<omgdi:waypoint x="472.0" y="141.0"/>
<omgdi:waypoint x="525.0" y="37.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_15" id="BPMNEdge__15" sourceElement="_8" targetElement="_9">
<omgdi:waypoint x="322.0" y="281.0"/>
<omgdi:waypoint x="440.0" y="141.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_14" id="BPMNEdge__14" sourceElement="_9" targetElement="_12">
<omgdi:waypoint x="472.0" y="141.0"/>
<omgdi:waypoint x="525.0" y="297.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_28" id="BPMNEdge__28" sourceElement="_20" targetElement="_26">
<omgdi:waypoint x="682.0" y="166.0"/>
<omgdi:waypoint x="740.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_17" id="BPMNEdge__17" sourceElement="_4" targetElement="_8">
<omgdi:waypoint x="255.0" y="102.5"/>
<omgdi:waypoint x="290.0" y="281.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_29" id="BPMNEdge__29" sourceElement="_11" targetElement="_4">
<omgdi:waypoint x="525.0" y="37.5"/>
<omgdi:waypoint x="255.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_5" id="BPMNEdge__5" sourceElement="_12" targetElement="_4">
<omgdi:waypoint x="525.0" y="297.5"/>
<omgdi:waypoint x="255.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_3">
<omgdi:waypoint x="27.0" y="171.0"/>
<omgdi:waypoint x="65.0" y="167.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_3" targetElement="_4">
<omgdi:waypoint x="150.0" y="167.5"/>
<omgdi:waypoint x="170.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_22" id="BPMNEdge__22" sourceElement="_12" targetElement="_20">
<omgdi:waypoint x="610.0" y="297.5"/>
<omgdi:waypoint x="650.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_21" id="BPMNEdge__21" sourceElement="_11" targetElement="_20">
<omgdi:waypoint x="610.0" y="37.5"/>
<omgdi:waypoint x="650.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_10" id="BPMNEdge__10" sourceElement="_8" targetElement="_3">
<omgdi:waypoint x="290.0" y="281.0"/>
<omgdi:waypoint x="150.0" y="167.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
package pwc.taxtech.atms.service.impl;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.vat.service.impl.ApprovalService;
public class BpmTest extends CommonIT {
private static final Logger logger = LoggerFactory.getLogger(BpmTest.class);
@Autowired
RuntimeService runtimeService;
@Autowired
TaskService taskService;
@Autowired
ApprovalService approvalService;
@Test
public void testStart(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
approvalService.startInstanceAndAssignee(dto);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_CHIEF);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_TAX_BP);
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"agreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
@Test
public void testApproval(){
ApprovalDto dto=new ApprovalDto();
dto.setProjectId("220c976c-f527-4abe-ad4a-3c2f863854c8");
dto.setPeriodDate("2019.2");
// approvalService.checkTask("220c976c-f527-4abe-ad4a-3c2f863854c8",2,"disagreed","aaa", Constant.ROLE_COMPLIANCE_IA);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1553596687364" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="approvalProcess" isClosed="false" isExecutable="true" name="ApprovalProcess" processType="None">
<startEvent id="_2" name="StartEvent"/>
<userTask activiti:assignee="accountant" activiti:exclusive="true" id="_3" name="会计"/>
<userTask activiti:assignee="compliance_chief" activiti:exclusive="true" id="_4" name="合规负责人"/>
<sequenceFlow id="_6" name="连线" sourceRef="_2" targetRef="_3"/>
<sequenceFlow id="_7" name="提交" sourceRef="_3" targetRef="_4"/>
<parallelGateway gatewayDirection="Unspecified" id="_9" name="ParallelGateway"/>
<userTask activiti:assignee="tax_bp" activiti:exclusive="true" id="_11" name="税务BP"/>
<userTask activiti:assignee="compliance_ia" activiti:exclusive="true" id="_12" name="合规IA"/>
<sequenceFlow id="_13" sourceRef="_9" targetRef="_11"/>
<sequenceFlow id="_14" sourceRef="_9" targetRef="_12"/>
<parallelGateway gatewayDirection="Unspecified" id="_20" name="ParallelGateway"/>
<sequenceFlow id="_22" name="通过" sourceRef="_12" targetRef="_20">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<endEvent id="_26" name="EndEvent"/>
<sequenceFlow id="_28" name="审批" sourceRef="_20" targetRef="_26"/>
<sequenceFlow id="_29" name="驳回" sourceRef="_11" targetRef="_4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_5" name="驳回" sourceRef="_12" targetRef="_4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="_8" name="ExclusiveGateway"/>
<sequenceFlow id="_15" name="通过" sourceRef="_8" targetRef="_9">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_17" name="审批" sourceRef="_4" targetRef="_8"/>
<sequenceFlow id="_10" name="驳回" sourceRef="_8" targetRef="_3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_16" name="通过" sourceRef="_11" targetRef="_20">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram documentation="background=#32424A;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="approvalProcess">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="-5.0" y="155.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="55.0" width="85.0" x="65.0" y="140.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="170.0" y="75.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_9" id="Shape-_9">
<omgdc:Bounds height="32.0" width="32.0" x="440.0" y="125.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_11" id="Shape-_11">
<omgdc:Bounds height="55.0" width="85.0" x="525.0" y="10.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_12" id="Shape-_12">
<omgdc:Bounds height="55.0" width="85.0" x="525.0" y="270.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_20" id="Shape-_20">
<omgdc:Bounds height="32.0" width="32.0" x="650.0" y="150.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_26" id="Shape-_26">
<omgdc:Bounds height="32.0" width="32.0" x="740.0" y="150.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_8" id="Shape-_8" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="290.0" y="265.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="_9" targetElement="_11">
<omgdi:waypoint x="472.0" y="141.0"/>
<omgdi:waypoint x="525.0" y="37.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_15" id="BPMNEdge__15" sourceElement="_8" targetElement="_9">
<omgdi:waypoint x="322.0" y="281.0"/>
<omgdi:waypoint x="440.0" y="141.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_14" id="BPMNEdge__14" sourceElement="_9" targetElement="_12">
<omgdi:waypoint x="472.0" y="141.0"/>
<omgdi:waypoint x="525.0" y="297.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_28" id="BPMNEdge__28" sourceElement="_20" targetElement="_26">
<omgdi:waypoint x="682.0" y="166.0"/>
<omgdi:waypoint x="740.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_17" id="BPMNEdge__17" sourceElement="_4" targetElement="_8">
<omgdi:waypoint x="255.0" y="102.5"/>
<omgdi:waypoint x="290.0" y="281.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_16" id="BPMNEdge__16" sourceElement="_11" targetElement="_20">
<omgdi:waypoint x="610.0" y="37.5"/>
<omgdi:waypoint x="650.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_29" id="BPMNEdge__29" sourceElement="_11" targetElement="_4">
<omgdi:waypoint x="525.0" y="37.5"/>
<omgdi:waypoint x="255.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_5" id="BPMNEdge__5" sourceElement="_12" targetElement="_4">
<omgdi:waypoint x="525.0" y="297.5"/>
<omgdi:waypoint x="255.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_3">
<omgdi:waypoint x="27.0" y="171.0"/>
<omgdi:waypoint x="65.0" y="167.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_3" targetElement="_4">
<omgdi:waypoint x="150.0" y="167.5"/>
<omgdi:waypoint x="170.0" y="102.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_22" id="BPMNEdge__22" sourceElement="_12" targetElement="_20">
<omgdi:waypoint x="610.0" y="297.5"/>
<omgdi:waypoint x="650.0" y="166.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_10" id="BPMNEdge__10" sourceElement="_8" targetElement="_3">
<omgdi:waypoint x="290.0" y="281.0"/>
<omgdi:waypoint x="150.0" y="167.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -10,6 +9,8 @@ import pwc.taxtech.atms.vat.dpo.ApprovalTaskInfo;
import pwc.taxtech.atms.vat.entity.PeriodApprove;
import pwc.taxtech.atms.vat.entity.PeriodApproveExample;
import java.util.List;
@Mapper
public interface PeriodApproveMapper extends MyVatMapper {
/**
......@@ -129,8 +130,11 @@ public interface PeriodApproveMapper extends MyVatMapper {
" INNER JOIN project p ON pa.project_id = p.ID " +
" JOIN user u1 ON pa.create_by = u1.id " +
" LEFT JOIN user u2 ON pa.approval_by = u2.id " +
"WHERE 1=1 <if test=\"year != 0\"> AND pa.YEAR = #{year,jdbcType=DECIMAL} </if>" +
"<if test=\"month != 0\"> AND pa.PERIOD = #{month,jdbcType=DECIMAL} </if>" +
" order by pa.create_time desc "+
"</script>")
List<ApprovalTaskInfo> queryApprovalList();
List<ApprovalTaskInfo> queryApprovalList(@Param("year") Integer year, @Param("month") Integer month);
@Select("" +
"SELECT " +
......@@ -142,7 +146,7 @@ public interface PeriodApproveMapper extends MyVatMapper {
String getStatusByProjectIdAndPeriod(@Param("projectId") String projectId, @Param("period") Integer period);
@Select("" +
"SELECT " +
"SELECT p.id AS id ," +
" p.instance_id AS instanceId ,p.status AS status " +
"FROM " +
" ( SELECT * FROM period_approve WHERE project_id = #{projectId} AND period = #{period} ORDER BY create_time DESC ) p " +
......
package pwc.taxtech.atms.vat.dpo;
import java.sql.Date;
import java.util.List;
public class ApprovalTaskInfo {
private String organizationId;
......@@ -17,6 +18,16 @@ public class ApprovalTaskInfo {
private String reportPaths;
private String reportIds;
private String templateIds;
//详细流程
private List<ApprovalTaskNodeInfo> items;
public List<ApprovalTaskNodeInfo> getItems() {
return items;
}
public void setItems(List<ApprovalTaskNodeInfo> items) {
this.items = items;
}
public String getProjectName() {
return projectName;
......
package pwc.taxtech.atms.vat.dpo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class ApprovalTaskNodeInfo {
private String userId;
private String userName;
private String comment;
@JsonFormat(pattern="yyyy-MM-dd HH:ss:mm",timezone="GMT+8")
private Date startTime;
private String role;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
@Override
public String toString() {
return "ApprovalTaskNodeInfo{" +
"userId='" + userId + '\'' +
", userName='" + userName + '\'' +
", comment='" + comment + '\'' +
", startTime=" + startTime +
", role='" + role + '\'' +
'}';
}
}
......@@ -92,7 +92,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, PROJECT_ID, PERIOD, REPORT_IDS, REPORT_PATHS, "STATUS", INSTANCE_ID, "YEAR",
ID, PROJECT_ID, PERIOD, REPORT_IDS, REPORT_PATHS, STATUS, INSTANCE_ID, YEAR,
TEMPLATE_IDS, CREATE_BY, CREATE_TIME, APPROVAL_BY, APPROVAL_TIME, APPROVAL_RESUALT
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample" resultMap="BaseResultMap">
......@@ -105,7 +105,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from PERIOD_APPROVE
from period_approve
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -120,7 +120,7 @@
-->
select
<include refid="Base_Column_List" />
from PERIOD_APPROVE
from period_approve
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
......@@ -128,7 +128,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from PERIOD_APPROVE
delete from period_approve
where ID = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample">
......@@ -136,7 +136,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from PERIOD_APPROVE
delete from period_approve
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -146,9 +146,9 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into PERIOD_APPROVE (ID, PROJECT_ID, PERIOD,
REPORT_IDS, REPORT_PATHS, "STATUS",
INSTANCE_ID, "YEAR", TEMPLATE_IDS,
insert into period_approve (ID, PROJECT_ID, PERIOD,
REPORT_IDS, REPORT_PATHS, STATUS,
INSTANCE_ID, YEAR, TEMPLATE_IDS,
CREATE_BY, CREATE_TIME, APPROVAL_BY,
APPROVAL_TIME, APPROVAL_RESUALT)
values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=DECIMAL},
......@@ -162,7 +162,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into PERIOD_APPROVE
insert into period_approve
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
......@@ -180,13 +180,13 @@
REPORT_PATHS,
</if>
<if test="status != null">
"STATUS",
STATUS,
</if>
<if test="instanceId != null">
INSTANCE_ID,
</if>
<if test="year != null">
"YEAR",
YEAR,
</if>
<if test="templateIds != null">
TEMPLATE_IDS,
......@@ -257,7 +257,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from PERIOD_APPROVE
select count(*) from period_approve
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -267,7 +267,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update PERIOD_APPROVE
update period_approve
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=VARCHAR},
......@@ -285,13 +285,13 @@
REPORT_PATHS = #{record.reportPaths,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
"STATUS" = #{record.status,jdbcType=VARCHAR},
STATUS = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.instanceId != null">
INSTANCE_ID = #{record.instanceId,jdbcType=VARCHAR},
</if>
<if test="record.year != null">
"YEAR" = #{record.year,jdbcType=DECIMAL},
YEAR = #{record.year,jdbcType=DECIMAL},
</if>
<if test="record.templateIds != null">
TEMPLATE_IDS = #{record.templateIds,jdbcType=VARCHAR},
......@@ -321,15 +321,15 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update PERIOD_APPROVE
update period_approve
set ID = #{record.id,jdbcType=VARCHAR},
PROJECT_ID = #{record.projectId,jdbcType=VARCHAR},
PERIOD = #{record.period,jdbcType=DECIMAL},
REPORT_IDS = #{record.reportIds,jdbcType=VARCHAR},
REPORT_PATHS = #{record.reportPaths,jdbcType=VARCHAR},
"STATUS" = #{record.status,jdbcType=VARCHAR},
STATUS = #{record.status,jdbcType=VARCHAR},
INSTANCE_ID = #{record.instanceId,jdbcType=VARCHAR},
"YEAR" = #{record.year,jdbcType=DECIMAL},
YEAR = #{record.year,jdbcType=DECIMAL},
TEMPLATE_IDS = #{record.templateIds,jdbcType=VARCHAR},
CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -345,7 +345,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update PERIOD_APPROVE
update period_approve
<set>
<if test="projectId != null">
PROJECT_ID = #{projectId,jdbcType=VARCHAR},
......@@ -360,13 +360,13 @@
REPORT_PATHS = #{reportPaths,jdbcType=VARCHAR},
</if>
<if test="status != null">
"STATUS" = #{status,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR},
</if>
<if test="instanceId != null">
INSTANCE_ID = #{instanceId,jdbcType=VARCHAR},
</if>
<if test="year != null">
"YEAR" = #{year,jdbcType=DECIMAL},
YEAR = #{year,jdbcType=DECIMAL},
</if>
<if test="templateIds != null">
TEMPLATE_IDS = #{templateIds,jdbcType=VARCHAR},
......@@ -394,14 +394,14 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update PERIOD_APPROVE
update period_approve
set PROJECT_ID = #{projectId,jdbcType=VARCHAR},
PERIOD = #{period,jdbcType=DECIMAL},
REPORT_IDS = #{reportIds,jdbcType=VARCHAR},
REPORT_PATHS = #{reportPaths,jdbcType=VARCHAR},
"STATUS" = #{status,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR},
INSTANCE_ID = #{instanceId,jdbcType=VARCHAR},
"YEAR" = #{year,jdbcType=DECIMAL},
YEAR = #{year,jdbcType=DECIMAL},
TEMPLATE_IDS = #{templateIds,jdbcType=VARCHAR},
CREATE_BY = #{createBy,jdbcType=VARCHAR},
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
......@@ -420,7 +420,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from PERIOD_APPROVE
from period_approve
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......
......@@ -850,6 +850,20 @@
"TBEBITForm":"TB EBIT Form",
"ClickEnsureTip": "Click Ensure Button!",
"ApproveCommitted":"Committed",
"ApproveAgreed":"Agreed",
"ApproveDisAgreed":"Disagreed",
"ApproveProjectName":"Project Name",
"ApprovePeriod":"Period",
"ApproveCommiteUser":"Commite User",
"ApproveUser":"Approve User",
"ApproveStatus":"Status",
"ApproveComment":"Approve Comment",
"ApproveStratTime":"Strat Time",
"ApproveEndTime":"Approved Time",
"ApproveTaskList":"Approve Task List",
"ApproveRole":"Approve Role",
"ConditionColumnNum": "Search Condition Column Num",
"Condition": "Search Condition",
"RevenueTypeConfiguration":"Revenue Type Config"
......
......@@ -905,7 +905,19 @@
"MenuBrazilianTax": "巴西税务分析",
"MenuOtherCountries": "其他国家税务分析",
"ApproveCommitted":"审核中",
"ApproveAgreed":"通过",
"ApproveDisAgreed":"驳回",
"ApproveProjectName":"项目名称",
"ApprovePeriod":"期间",
"ApproveCommiteUser":"提审人",
"ApproveUser":"审批人",
"ApproveStatus":"提审状态",
"ApproveComment":"审批意见",
"ApproveStratTime":"提审时间",
"ApproveEndTime":"审批时间",
"ApproveTaskList":"审批列表",
"ApproveRole":"审批角色",
"true": "是",
"false": "否",
......
......@@ -5,6 +5,10 @@
return $http.get('url', apiConfig.createVat());
},
startApproveDeploy : function() {
return $http.post('/approval/deploy', apiConfig.createVat());
},
commitNewApproval: function (param) {
return $http.post('/approval/commit',{
projectId: param.projectId,
......@@ -12,9 +16,9 @@
}, apiConfig.createVat());
},
approvalTasks: function () {
approvalTasks: function (year, month) {
var assignee='accountant';
return $http.get('/approval/tasks/'+assignee, apiConfig.createVat());
return $http.get('/approval/tasks/'+assignee+"/"+year+"/"+month, apiConfig.createVat());
},
getApprovalTemplateInfo:function(templateId){
......
......@@ -147,27 +147,13 @@
$scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length });
var notBeginTemp = _.filter(temp, function (i) {
if (i.serviceTypeID === enums.serviceType.VAT)
return ((i.projectStatusList === null || (i.projectStatusList !== null && i.projectStatusList[vatSessionService.month] === undefined) || (i.projectStatusList !== null && i.projectStatusList[vatSessionService.month] === 10)));
else
return ((i.projectStatusList === null || (i.projectStatusList !== null && Object.keys(i.projectStatusList).length === 0) || i.projectStatusList[Object.keys(i.projectStatusList)[Object.keys(i.projectStatusList).length - 1]] === 10));
});
return i.status === 'disagreed';
})
if (notBeginTemp) {
$scope.notBeginNum = notBeginTemp.length;
}
var completedTemp = _.filter(temp, function (i) {
if (i.serviceTypeID === enums.serviceType.VAT) {
if (i.projectStatusList && i.projectStatusList[vatSessionService.month] != null) {
return i.projectStatusList[vatSessionService.month] === 100;
}
}
else {
if (i.projectStatusList && i.projectStatusList.length > 0) {
return i.projectStatusList[Object.keys(i.projectStatusList)[Object.keys(i.projectStatusList).length - 1]] === 100;
}
}
return i.status === 'agreed';
});
if (completedTemp) {
$scope.completedNum = completedTemp.length;
......@@ -290,6 +276,7 @@
if (isDateUpdated) {
$timeout(function () {
$scope.conditionChange = !$scope.conditionChange;
loadApprovalFromDB(tempYear, tempMonth);
});
}
......@@ -297,6 +284,9 @@
$scope.query();
}
} else {
$scope.conditionChange = !$scope.conditionChange;
loadApprovalFromDB(0,0);
}
};
......@@ -554,9 +544,14 @@
}
}
var loadApprovalFromDB = function () {
vatApproveService.approvalTasks().success(function (data) {
$scope.startApprove = function(){
vatApproveService.startApproveDeploy();
}
var loadApprovalFromDB = function (year, month) {
vatApproveService.approvalTasks(year, month).success(function (data) {
if (data) {
$scope.allResults=[];
data.forEach(function (p) {
if (PWC.isHavePermissionForOrg(p.organizationId, vatSessionService.userPermission))
{
......@@ -565,29 +560,53 @@
});
$scope.queryResults = _.clone($scope.allResults);
$scope.query();
$scope.gridOptions = {
bindingOptions: {
"dataSource": "queryResults"
},
loadPanel: {
text: $translate.instant('DataLoading'),
},
noDataText: $translate.instant('NoDataText'),
keyExpr: "instanceId",
showBorders: true,
paging: {
pageSize: 10
},
columns: [
{ caption: '项目名称', width: '12%', dataField: "projectName"},
{ caption: '期间', width: '7%', dataField: "period"},
{ caption: '提审人', width: '10%', dataField: "createBy"},
{ caption: '审批人', width: '10%', dataField: "approvalBy"},
{ caption: '审批状态', width: '10%',
{
dataField: 'projectName',
width: '22%',
caption: $translate.instant('ApproveProjectName'),
cellTemplate: function (container, options) {
try {
$('<a class="invoiceNumber-link">').text(options.value)
.on('click', function () {
$scope.goToService(options.data);
})
.appendTo(container);
}
catch (e) {
$log.error(e);
}
}
},
{ caption: $translate.instant('ApprovePeriod'), width: '5%', dataField: "period"},
{ caption: $translate.instant('ApproveCommiteUser'), width: '10%', dataField: "createBy"},
{ caption: $translate.instant('ApproveUser'), width: '10%', dataField: "approvalBy"},
{ caption: $translate.instant('ApproveStatus'), width: '10%',
calculateCellValue: function(data) {
if(data.status=='disagreed'){
return '驳回';
return $translate.instant('ApproveDisAgreed');
}else if(data.status == 'agreed'){
return '通过';
return $translate.instant('ApproveAgreed');
}else if(data.status == 'committed'){
return '审核中';
return $translate.instant('ApproveCommitted');
}
}
},
{ caption: '审批意见', width: '15%',
{ caption: $translate.instant('ApproveComment'), width: '20%',
calculateCellValue: function(data) {
if(data.approvalResult == 'undefined'){
return '';
......@@ -596,13 +615,59 @@
}
}
},
{ caption: '提审时间', width: '7.5%', dataField: "createTime"},
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
{ caption: $translate.instant('ApproveStratTime'), width: '11%', dataField: "createTime"},
{ caption: $translate.instant('ApproveEndTime'), width: '11%', dataField: "approvalTime"}
],
onRowClick: function (e) {
$scope.goToService(e.data);
}
masterDetail: {
enabled: true,
template: "detail"
},
detailGridOptions: function (order) {
return {
dataSource: new DevExpress.data.DataSource({
load: function (loadOptions) {
var deferred = $q.defer();
var itemList = [];
itemList=order.items;
deferred.resolve({
data: itemList,
totalCount: itemList.length
});
return deferred.promise;
}
}),
noDataText: $translate.instant('NoDataText'),
columnAutoWidth: true,
allowColumnResizing: true,
showBorders: true,
//height: 'auto',
loadPanel: {
text: $translate.instant('DataLoading'),
},
columns: [
{
dataField: 'role',
width: '15%',
caption: $translate.instant('ApproveRole'),
},
{
dataField: 'userName',
width: '10%',
caption: $translate.instant('ApproveCommiteUser'),
},
{
dataField: 'comment',
width: '40%',
caption: $translate.instant('ApproveComment'),
},
{
dataField: 'startTime',
width: '15%',
caption: $translate.instant('ApproveStratTime'),
}
]
}
},
};
}
});
......@@ -646,7 +711,7 @@
});
vatSessionService.userPermission = userPermission;
orgDisplay.main();
loadApprovalFromDB();
loadApprovalFromDB(vatSessionService.year, vatSessionService.month);
});
})();
}
......
......@@ -43,22 +43,23 @@
</div>
<div class="new-right-header">
<div class="head-row">
<span class="total-projects">报表审批</span>
<span class="total-projects">{{'MenuListApproval' | translate}}</span>
</div>
<div class="project-staus">
<span style="padding-right: 10px;" class="result-style">{{projectMsg}}</span>
<span style="padding-right:10px;">提审中</span><span class="num-style">{{ongoingNum}}</span>
<span style="padding-right:10px;padding-left:20px;">通过</span><span
class="num-style">{{notBeginNum}}</span>
<span style="padding-right:10px;padding-left:20px;">驳回</span><span
<span style="padding-right:10px;">{{'ApproveCommitted' | translate}}</span><span class="num-style">{{ongoingNum}}</span>
<span style="padding-right:10px;padding-left:20px;">{{'ApproveAgreed' | translate}}</span><span
class="num-style">{{completedNum}}</span>
<span style="padding-right:10px;padding-left:20px;">{{'ApproveDisAgreed' | translate}}</span><span
class="num-style">{{notBeginNum}}</span>
</div>
<div class="task-list">
<span class="taskMsg" ng-show="serviceTypeId !=='12'">审批列表</span>
<span class="taskMsg" ng-show="serviceTypeId !=='12'">{{'ApproveTaskList' | translate}}</span>
</div>
</div>
<div class="new-right-body">
<div class="right-header">
<button style="display: none; " ng-click="startApprove()">start </button>
<div class="overview-picker">
<input type="text" id="overviewDatepicker" class="datepicker vat-subheader" style="width:120px;"
readonly="readonly"/>
......@@ -66,12 +67,10 @@
</div>
<span class="clear"></span>
</div>
<div class="vat-preview-input-invoice" id="mainPreviewDiv">
<div id="mainAreaDiv" class="main-area">
<div class="inputInvoiceGrid" id="grid" dx-data-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span
translate="NoDataAvailable"></span>
</div>
<div id ="approveGridContainer" dx-data-grid="gridOptions" dx-item-alias="approval">
<div data-options="dxTemplate: {name: 'detail'}">
<div class="internal-grid-container">
<div dx-data-grid="gridOptions.detailGridOptions(approval.data)"></div>
</div>
</div>
</div>
......
#approveGridContainer {
height: 420px;
margin-left: 20px;
margin-right: 50px;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment