Commit f7e7a882 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 608f56e9 17215322
......@@ -23,6 +23,7 @@
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>pwc.taxtech.atms</groupId>
<artifactId>atms-dao</artifactId>
......@@ -339,6 +340,24 @@
<artifactId>spring-data-commons</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-rest</artifactId>
<version>${activiti.version}</version>
</dependency>
</dependencies>
<profiles>
......@@ -390,6 +409,7 @@
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.sql</include>
<include>**/*.bpmn</include>
</includes>
<filtering>true</filtering><!-- replace variable attribute or not -->
</resource>
......
package pwc.taxtech.atms.controller;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.approval.ApprovalDto;
import pwc.taxtech.atms.dto.approval.ApprovalTask;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/api/v1/approval")
public class ApprovalController {
private static Logger logger = LoggerFactory.getLogger(ApprovalController.class);
@Autowired
RuntimeService runtimeService;
@Autowired
TaskService taskService;
@Autowired
RepositoryService repositoryService;
@ResponseBody
@RequestMapping(value = "/deploy", method = RequestMethod.POST)
public ResponseEntity deploy() {
repositoryService.createDeployment().addClasspathResource("bpmn/approval.bpmn").deploy();
return ResponseEntity.ok().build();
}
@ResponseBody
@RequestMapping(value = "/commit", method = RequestMethod.POST)
public ApprovalDto approval(@RequestBody ApprovalDto dto) {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("approvalProcess");
dto.setInstaceId(pi.getId());
mocoInsert(dto);//todo use service insert
return dto;
}
@ResponseBody
@RequestMapping(value = "/tasks/{assignee}")
public List<ApprovalTask> data(@PathVariable String assignee) {
List<Task> tasks = taskService.createTaskQuery().taskAssignee(assignee).list();
List<ApprovalTask> list = new ArrayList<>();
for (Task task : tasks) {
ApprovalTask t = new ApprovalTask();
list.add(t.copyfrom(task));
}
return list;
}
@ResponseBody
@RequestMapping(value = "/check/{taskId}")
public String check(@PathVariable String taskId, @RequestParam(required = false) Integer committed,
@RequestParam(required = false) Integer decide) {
Map<String, Object> map = new HashMap<>();
if (committed != null && (committed == 0 || committed == 1)) {
map.put("committed", committed);
taskService.complete(taskId, map);
if (committed == 1) mocoHasCommittedAndOver();
} else if (decide != null && (decide == 0 || decide == 1)) {
map.put("decide", decide);
taskService.complete(taskId, map);
if (decide == 1) mocoAggreAndOver();
else mocoDisAggreAndOver();
}
return taskId;
}
private void mocoHasCommitted() {
}
@RequestMapping(value = "/show/{procDefId}")//获取流程图
public void showImg(@PathVariable String procDefId, HttpServletResponse response) {
try {
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).singleResult();
String diagramResourceName = pd.getDiagramResourceName();
InputStream pic = repositoryService.getResourceAsStream(pd.getDeploymentId(), diagramResourceName);
byte[] b = new byte[1024];
int len = -1;
while ((len = pic.read(b, 0, 1024)) != -1) {
response.getOutputStream().write(b, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@ResponseBody
@RequestMapping(value = "/showImg/{procDefId}/{executionId}")//获取流程坐标
public Rect showImg(@PathVariable String procDefId, @PathVariable String executionId) {
Rect rect = new Rect();
try {
repositoryService.getProcessDefinition(procDefId);
// ActivityImpl img = Workflow.getProcessMap(procDefId,executionId );
// rect.setX(img.getX());
// rect.setY(img.getY());
// rect.setWidth(img.getWidth());
// rect.setHeight(img.getHeight());
} catch (Exception e) {
e.printStackTrace();
}
return rect;
}
static class Rect {
String X;
String Y;
String width;
String height;
public String getX() {
return X;
}
public void setX(String x) {
X = x;
}
public String getY() {
return Y;
}
public void setY(String y) {
Y = y;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
}
private void mocoDisAggreAndOver() {
logger.debug("------------------------update db -----------------------------------");
logger.debug("dis aggre");
logger.debug("------------------------updage db-----------------------------------");
}
private void mocoAggreAndOver() {
logger.debug("------------------------update db-----------------------------------");
logger.debug("aggree");
logger.debug("------------------------update db-----------------------------------");
}
private void mocoHasCommittedAndOver() {
logger.debug("-------------------------update db----------------------------------");
logger.debug("has committed");
logger.debug("-------------------------update db----------------------------------");
}
private void mocoInsert(ApprovalDto dto) {
logger.debug("-------------------------insert db----------------------------------");
logger.debug("save approval {}", dto.toString());
logger.debug("-------------------------insert db----------------------------------");
}
}
package pwc.taxtech.atms.dto.approval;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ApprovalDto {
private String projectId;
private Long reportId;
private String periodDate;
private String instaceId;
private String status;//committed,agreed,disagreed
@Override
public String toString() {
return "ApprovalDto{" +
"projectId='" + projectId + '\'' +
", reportId=" + reportId +
", period=" + periodDate +
", instaceId='" + instaceId + '\'' +
", status='" + status + '\'' +
'}';
}
}
package pwc.taxtech.atms.dto.approval;
import lombok.Getter;
import lombok.Setter;
import org.activiti.engine.task.Task;
import pwc.taxtech.atms.controller.ApprovalController;
@Getter
@Setter
public class ApprovalTask {
private String taskId;
private String name;
private String assignee;
private String executionId;
private String processInstanceId;
private String processDefinitionId;
@Override
public String toString() {
return "ApprovalTask{" +
"taskId='" + taskId + '\'' +
", name='" + name + '\'' +
", assignee='" + assignee + '\'' +
", executionId='" + executionId + '\'' +
", processInstanceId='" + processInstanceId + '\'' +
", processDefinitionId='" + processDefinitionId + '\'' +
'}';
}
public ApprovalTask copyfrom(Task task) {
setTaskId(task.getId());
setName(task.getName());
setAssignee(task.getAssignee());
setExecutionId(task.getExecutionId());
setProcessInstanceId(task.getProcessInstanceId());
setProcessDefinitionId(task.getProcessDefinitionId());
return this;
}
}
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class InputInvoice {
private String id;
private String fpdm;
private String fphm;
private String kprq;
private String gfsh;
private String gfmc;
private String gfdzdh;
private String gfyhzh;
private String xfsh;
private String xfmc;
private String xfdzdh;
private String xfyhzh;
private String jym;
private String fplx;
private String fplc;
private String jqbh;
private String hjje;
private String hjse;
private String jshj;
private String mwq;
private String kpr;
private String skr;
private String fhr;
private String bz;
private String pzh;
private String dzdh;
private String xtly;
private String fpzt;
private String cyzt;
private String rzzt;
private String rzsq;
private String rzsj;
private String rzjg;
private String rzjgms;
private String cjsj;
private String lcbh;
private String fpyx;
private String blyy;
private String lrrq;
private String companyid;
}
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class OutputInvoice {
private String id;
private String fpqqlsh;
private String fpdm;
private String fphm;
private String kprq;
private String fplxdm;
private String ewm;
private String jqbh;
private String jym;
private String gfmc;
private String gfsh;
private String gfdzdh;
private String gfyhzh;
private String xfsh;
private String xfmc;
private String xfdzdh;
private String xfyhzh;
private String bz;
private String skr;
private String fhr;
private String kpr;
private String kddh;
private String kduuid;
private String fplx;
private String kpzt;
private String fpzt;
private String yfpdm;
private String yfphm;
private String gfgsbm;
private String xfgsbm;
private String spbh;
private String xtly;
private String cjsj;
private String hjje;
private String hjse;
private String jshj;
private String xxbbh;
private String dyzt;
private String gdjlh;
private String zkje;
private String zkse;
private String zkjshj;
private String slv;
private String qy;
private String jszt;
private String kdgs;
private String shzt;
private String thkpsq;
private String jsfj;
private String sqr;
private String bscdm;
private String bsc;
private String qydm;
private String sqbh;
private String htbh;
private String sqrq;
private String yzrq;
}
......@@ -16,6 +16,7 @@
<!-- https://springcloud.cc/spring-security-zhcn.html -->
<intercept-url pattern="/api/v1/cache/getallcache" access="permitAll" />
<intercept-url pattern="/api/v1/user/login" access="permitAll" />
<intercept-url pattern="/api/v1/approval/**" access="permitAll" />
<intercept-url pattern="/api/**" access="authenticated" />
<intercept-url pattern="/**" access="permitAll" />
<headers>
......
......@@ -99,4 +99,34 @@
<property name="cacheManager" ref="cacheManagerFactory"/>
</bean>
<!-- atms activit for workflow-->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="databaseSchemaUpdate" value="true"/>
<property name="jobExecutorActivate" value="true"/>
<!-- 以下2个是为了防止生成流程图片时出现乱码 -->
<property name="activityFontName" value="宋体"/>
<property name="labelFontName" value="宋体"/>
</bean>
<!-- 流程引擎 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration"/>
</bean>
<!-- 流程服务 -->
<bean id="repositoryService" factory-bean="processEngine"
factory-method="getRepositoryService"/>
<bean id="runtimeService" factory-bean="processEngine"
factory-method="getRuntimeService"/>
<bean id="taskService" factory-bean="processEngine"
factory-method="getTaskService"/>
<bean id="historyService" factory-bean="processEngine"
factory-method="getHistoryService"/>
<bean id="managementService" factory-bean="processEngine"
factory-method="getManagementService"/>
<bean id="IdentityService" factory-bean="processEngine"
factory-method="getIdentityService"/>
</beans>
\ 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:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/testm1539848247913" 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="m1539848247913" name="" targetNamespace="http://www.activiti.org/testm1539848247913" 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="税务会计"/>
<sequenceFlow id="_4" sourceRef="_2" targetRef="_3"/>
<userTask activiti:assignee="manager" activiti:exclusive="true" id="_5" name="税务经理"/>
<endEvent id="_7" name="EndEvent"/>
<endEvent id="_9" name="EndEvent"/>
<exclusiveGateway gatewayDirection="Unspecified" id="_12" name="ExclusiveGateway"/>
<sequenceFlow id="_13" name="审核" sourceRef="_5" targetRef="_12"/>
<sequenceFlow id="_8" name="通过" sourceRef="_12" targetRef="_7">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_10" name="驳回" sourceRef="_12" targetRef="_9">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${decide==0}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="_11" name="ExclusiveGateway"/>
<sequenceFlow id="_14" name="提审" sourceRef="_3" targetRef="_11"/>
<sequenceFlow id="_15" name="未提交" sourceRef="_11" targetRef="_5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${committed==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="_16" name="已提交" sourceRef="_11" targetRef="_9">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${committed==1}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;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">
<dc:Bounds height="32.0" width="32.0" x="50.0" y="380.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<dc:Bounds height="55.0" width="85.0" x="190.0" y="370.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5">
<dc:Bounds height="55.0" width="85.0" x="410.0" y="165.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_7" id="Shape-_7">
<dc:Bounds height="32.0" width="32.0" x="765.0" y="105.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_9" id="Shape-_9">
<dc:Bounds height="32.0" width="32.0" x="760.0" y="380.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_12" id="Shape-_12" isMarkerVisible="false">
<dc:Bounds height="32.0" width="32.0" x="640.0" y="175.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_11" id="Shape-_11" isMarkerVisible="false">
<dc:Bounds height="32.0" width="32.0" x="440.0" y="380.0"/>
<bpmndi:BPMNLabel>
<dc: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="_5" targetElement="_12">
<di:waypoint x="510.0" y="192.5"/>
<di:waypoint x="640.0" y="191.0"/>
<bpmndi:BPMNLabel>
<dc: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="_11" targetElement="_5">
<di:waypoint x="456.0" y="365.0"/>
<di:waypoint x="456.0" y="220.0"/>
<bpmndi:BPMNLabel>
<dc: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="_3" targetElement="_11">
<di:waypoint x="290.0" y="397.5"/>
<di:waypoint x="440.0" y="396.0"/>
<bpmndi:BPMNLabel>
<dc: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="_9">
<di:waypoint x="487.0" y="396.0"/>
<di:waypoint x="760.0" y="396.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_4" id="BPMNEdge__4" sourceElement="_2" targetElement="_3">
<di:waypoint x="97.0" y="396.0"/>
<di:waypoint x="190.0" y="397.5"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_12" targetElement="_7">
<di:waypoint x="687.0" y="191.0"/>
<di:waypoint x="765.0" y="121.0"/>
<bpmndi:BPMNLabel>
<dc: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="_12" targetElement="_9">
<di:waypoint x="687.0" y="191.0"/>
<di:waypoint x="760.0" y="396.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
......@@ -8,6 +8,11 @@ jdbc2_user=${jdbc2_user}
jdbc2_password=${jdbc2_password}
jdbc2_admin_db=${jdbc2_admin_db}
workflow_jdbc_url=${workflow_jdbc_url}
workflow_jdbc_user=${workflow_jdbc_user}
workflow_jdbc_password=${workflow_jdbc_password}
workflow_jdbc_admin_db=${workflow_jdbc_admin_db}
jdbc_url_demo=${jdbc_url_demo}
mail_jdbc_url=${mail_jdbc_url}
......
......@@ -9,6 +9,11 @@ jdbc2_user=pwc_invoice
jdbc2_password=pwc_invoice
jdbc2_admin_db=pwc_invoice
workflow_jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
workflow_jdbc_user=TAX_ADMIN
workflow_jdbc_password=taxadmin2018
workflow_jdbc_admin_db=tax_admin
jdbc_url_demo=jdbc:mysql://10.158.230.144:3306/demo_db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
......
.*
rebel.xml
!.gitignore
!.mvn
/tmp
/temp
/target
/build
/logs
/bin
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>atms</artifactId>
<groupId>pwc.taxtech.atms</groupId>
<version>0.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>atms-invoice</artifactId>
<properties>
<java.version>1.8</java.version>
<hibernate-tools-maven-plugin.version>0.1.0</hibernate-tools-maven-plugin.version>
<project.properties.encoding>UTF-8</project.properties.encoding>
<project.build.sourceEncoding>${project.properties.encoding}</project.build.sourceEncoding>
<project.properties.license.name>apache_v2</project.properties.license.name>
<project.properties.license.txtName>Apache License, Version 2.0</project.properties.license.txtName>
<project.properties.license.url>http://www.apache.org/licenses/LICENSE-2.0.txt</project.properties.license.url>
<java.version>1.8</java.version>
<junit.version>4.12</junit.version>
<log4j.version>2.8.2</log4j.version>
<lombok.version>1.16.18</lombok.version>
<slf4j.version>1.7.25</slf4j.version>
<commons-lang3.version>3.7</commons-lang3.version>
<commons-io.version>2.6</commons-io.version>
<commons-collections4.version>4.1</commons-collections4.version>
<commons-cli.version>1.4</commons-cli.version>
<maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
<maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<scm.repository.owner>udamken</scm.repository.owner>
<scm.repository.name>mybatter</scm.repository.name>
<scm.repository.repo>${scm.repository.owner}/${scm.repository.name}</scm.repository.repo>
<scm.repository.url>https://www.github.com/${scm.repository.repo}</scm.repository.url>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/ojdbc6.jar</systemPath>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>23.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.40</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.3.RELEASE</version>
<configuration>
<mainClass>pwc.taxtech.invoice.Application</mainClass>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
package pwc.taxtech.invoice;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
private static final Logger log = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) {
SpringApplication.run(Application.class);
}
}
package pwc.taxtech.invoice.common;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PagingDto {
private Integer TotalCount;
private Integer PageIndex;
private Integer PageSize;
public PagingDto(Integer totalCount, Integer pageIndex, Integer pageSize) {
TotalCount = totalCount;
PageIndex = pageIndex;
PageSize = pageSize;
}
}
package pwc.taxtech.invoice.common;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class PagingResultDto<T> {
@JSONField(name = "List")
private List<T> list;
@JSONField(name = "PageInfo")
private PagingDto pageInfo;
private T calculateData;
}
package pwc.taxtech.invoice.input;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Getter
@Setter
@Table(name = "INPUT_INVOICE")
public class InputInvoice {
@Id
@Column(name = "ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private String id;
@Column(name = "FPDM")
private String fpdm;
@Column(name = "FPHM")
private String fphm;
@Column(name = "KPRQ")
private String kprq;
@Column(name = "GFSH")
private String gfsh;
@Column(name = "GFMC")
private String gfmc;
@Column(name = "GFDZDH")
private String gfdzdh;
@Column(name = "GFYHZH")
private String gfyhzh;
@Column(name = "XFSH")
private String xfsh;
@Column(name = "XFMC")
private String xfmc;
@Column(name = "XFDZDH")
private String xfdzdh;
@Column(name = "XFYHZH")
private String xfyhzh;
@Column(name = "JYM")
private String jym;
@Column(name = "FPLX")
private String fplx;
@Column(name = "FPLC")
private String fplc;
@Column(name = "JQBH")
private String jqbh;
@Column(name = "HJJE")
private String hjje;
@Column(name = "HJSE")
private String hjse;
@Column(name = "JSHJ")
private String jshj;
@Column(name = "MWQ")
private String mwq;
@Column(name = "KPR")
private String kpr;
@Column(name = "SKR")
private String skr;
@Column(name = "FHR")
private String fhr;
@Column(name = "BZ")
private String bz;
@Column(name = "PZH")
private String pzh;
@Column(name = "DZDH")
private String dzdh;
@Column(name = "XTLY")
private String xtly;
@Column(name = "FPZT")
private String fpzt;
@Column(name = "CYZT")
private String cyzt;
@Column(name = "RZZT")
private String rzzt;
@Column(name = "RZSQ")
private String rzsq;
@Column(name = "RZSJ")
private String rzsj;
@Column(name = "RZJG")
private String rzjg;
@Column(name = "RZJGMS")
private String rzjgms;
@Column(name = "CJSJ")
private String cjsj;
@Column(name = "LCBH")
private String lcbh;
@Column(name = "FPYX")
private String fpyx;
@Column(name = "BLYY")
private String blyy;
@Column(name = "LRRQ")
private String lrrq;
@Column(name = "COMPANYID")
private String companyid;
}
package pwc.taxtech.invoice.input;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.invoice.common.PagingDto;
import pwc.taxtech.invoice.common.PagingResultDto;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
@RestController
@RequestMapping("/input_invoices")
public class InputInvoiceController {
@Autowired
InputInvoiceRepository repository;
@RequestMapping(method = GET)
public PagingResultDto<InputInvoice> getAll(@RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size) {
if (page < 0) page = 0;
Page<InputInvoice> pageResult = repository.findAll(PageRequest.of(page - 1, size));
PagingResultDto<InputInvoice> pageReturn = new PagingResultDto();
pageReturn.setList(pageResult.getContent());
pageReturn.setPageInfo(new PagingDto(pageResult.getTotalPages(), pageResult.getPageable().getPageNumber(), pageResult.getPageable().getPageSize()));
return pageReturn;
}
}
package pwc.taxtech.invoice.input;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
interface InputInvoiceRepository extends PagingAndSortingRepository<InputInvoice, String> {
}
package pwc.taxtech.invoice.output;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Getter
@Setter
@Table(name = "OUTPUT_INVOICE")
public class OutputInvoice {
@Id
@Column(name = "ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private String id;
@Column(name = "FPQQLSH")
private String fpqqlsh;
@Column(name = "FPDM")
private String fpdm;
@Column(name = "FPHM")
private String fphm;
@Column(name = "KPRQ")
private String kprq;
@Column(name = "FPLXDM")
private String fplxdm;
@Column(name = "EWM")
private String ewm;
@Column(name = "JQBH")
private String jqbh;
@Column(name = "JYM")
private String jym;
@Column(name = "GFMC")
private String gfmc;
@Column(name = "GFSH")
private String gfsh;
@Column(name = "GFDZDH")
private String gfdzdh;
@Column(name = "GFYHZH")
private String gfyhzh;
@Column(name = "XFSH")
private String xfsh;
@Column(name = "XFMC")
private String xfmc;
@Column(name = "XFDZDH")
private String xfdzdh;
@Column(name = "XFYHZH")
private String xfyhzh;
@Column(name = "BZ")
private String bz;
@Column(name = "SKR")
private String skr;
@Column(name = "FHR")
private String fhr;
@Column(name = "KPR")
private String kpr;
@Column(name = "KDDH")
private String kddh;
@Column(name = "KDUUID")
private String kduuid;
@Column(name = "FPLX")
private String fplx;
@Column(name = "KPZT")
private String kpzt;
@Column(name = "FPZT")
private String fpzt;
@Column(name = "YFPDM")
private String yfpdm;
@Column(name = "YFPHM")
private String yfphm;
@Column(name = "GFGSBM")
private String gfgsbm;
@Column(name = "XFGSBM")
private String xfgsbm;
@Column(name = "SPBH")
private String spbh;
@Column(name = "XTLY")
private String xtly;
@Column(name = "CJSJ")
private String cjsj;
@Column(name = "HJJE")
private String hjje;
@Column(name = "HJSE")
private String hjse;
@Column(name = "JSHJ")
private String jshj;
@Column(name = "XXBBH")
private String xxbbh;
@Column(name = "DYZT")
private String dyzt;
@Column(name = "GDJLH")
private String gdjlh;
@Column(name = "ZKJE")
private String zkje;
@Column(name = "ZKSE")
private String zkse;
@Column(name = "ZKJSHJ")
private String zkjshj;
@Column(name = "SLV")
private String slv;
@Column(name = "QY")
private String qy;
@Column(name = "JSZT")
private String jszt;
@Column(name = "KDGS")
private String kdgs;
@Column(name = "SHZT")
private String shzt;
@Column(name = "THKPSQ")
private String thkpsq;
@Column(name = "JSFJ")
private String jsfj;
@Column(name = "SQR")
private String sqr;
@Column(name = "BSCDM")
private String bscdm;
@Column(name = "BSC")
private String bsc;
@Column(name = "QYDM")
private String qydm;
@Column(name = "SQBH")
private String sqbh;
@Column(name = "HTBH")
private String htbh;
@Column(name = "SQRQ")
private String sqrq;
@Column(name = "YZRQ")
private String yzrq;
}
package pwc.taxtech.invoice.output;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.invoice.common.PagingDto;
import pwc.taxtech.invoice.common.PagingResultDto;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
@RestController
@RequestMapping("/output_invoices")
public class OutputInvoiceController {
@Autowired
OutputInvoiceRepository repository;
@RequestMapping(method = GET)
public PagingResultDto<OutputInvoice> getAll(@RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size) {
if (page < 0) page = 0;
Page<OutputInvoice> pageResult = repository.findAll(PageRequest.of(page - 1, size));
PagingResultDto<OutputInvoice> pageReturn = new PagingResultDto();
pageReturn.setList(pageResult.getContent());
pageReturn.setPageInfo(new PagingDto(pageResult.getTotalPages(), pageResult.getPageable().getPageNumber(), pageResult.getPageable().getPageSize()));
return pageReturn;
}
}
package pwc.taxtech.invoice.output;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
interface OutputInvoiceRepository extends PagingAndSortingRepository<OutputInvoice, String> {
}
server.port: 8089
spring:
datasource:
url: jdbc:oracle:thin:@10.158.230.144:11521:XE
username: system
password: taxadmin2018
driver-class-name: oracle.jdbc.driver.OracleDriver
jpa:
show-sql: true
properties.hibernate:
default_schema: pwc_invoice
dialect: org.hibernate.dialect.Oracle10gDialect
hibernate:
ddl-auto: update
naming.physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
webservices.factory('vatApproveService', ['$http', 'apiConfig', function ($http, apiConfig) {
'use strict';
return {
sample: function () {
return $http.get('url', apiConfig.createVat());
},
commitNewApproval: function (param) {
return $http.post('/approval/commit',{
projectId: param.projectId,
periodDate: param.periodDate
}, apiConfig.createVat());
},
queryOutputInvoiceItemList: function (invoiceID) {
return $http.get('/outputInvoiceImport/queryOutputInvoiceItemList/' + invoiceID, apiConfig.createVat());
},
getExportOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/getExportOutputInvoiceList', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
}, apiConfig.createVat({ responseType: 'arraybuffer' }));
},
queryInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewList', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat());
},
queryInputInvoiceItemList: function (inputInvoiceID) {
return $http.get('/inputInvoiceImport/inputInvoiceItemPreviewList/' + inputInvoiceID, apiConfig.createVat());
},
//导出进项发票数据
getExportInputInvoiceList: function (param) {
return $http.post('/inputInvoiceImport/exportQueryData/get', {
PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat({ responseType: 'arraybuffer' }));
},
voucherSelectAdvancedByEntry: function (mainRelation, allJe, pagingInfo, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedByEntry', {
MainRelation: mainRelation,
AllJe: allJe,
PagingInfo: pagingInfo,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
voucherSelectAdvancedByVoucher: function (mainRelation, allJe, pagingInfo, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedByVoucher', {
MainRelation: mainRelation,
AllJe: allJe,
PagingInfo: pagingInfo,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
voucherSelectAdvancedCount: function (mainRelation, isEntryShow, allJe, listQueryCondition) {
return $http.post('/voucher/voucherSelectAdvancedCount', {
MainRelation: mainRelation,
AllJe: allJe,
IsEntryShow: isEntryShow,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getVoucherByConditon: function (mainRelation, allJe, period, vID, group, listQueryCondition) {
return $http.post('/voucher/getVoucherByConditon', {
MainRelation: mainRelation,
AllJe: allJe,
Period: period,
VID: vID,
Group: group,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getSelectWhereString: function (mainRelation, allJe, listQueryCondition) {
return $http.post('/voucher/getSelectWhereString', {
MainRelation: mainRelation,
AllJe: allJe,
ListQueryCondition: listQueryCondition
}, apiConfig.create());
},
getEnterpriseAccount: function () {
return $http.get('/voucher/getEnterpriseAccount', apiConfig.create());
}
};
}]);
\ No newline at end of file
vatModule.controller('VatLayoutController', ['$scope', '$rootScope', '$q', '$log', '$timeout', '$state', '$translate', 'projectService', 'SweetAlert', 'loginContext'
, 'vatSessionService', 'vatCommonService', 'vatWorkflowService', 'application', 'enums', '$uibModal',
, 'vatSessionService', 'vatCommonService', 'vatWorkflowService', 'application', 'enums', '$uibModal','vatApproveService',
function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectService, SweetAlert, loginContext
, vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal) {
, vatSessionService, vatCommonService, vatWorkflowService, application, enums, $uibModal, vatApproveService) {
'use strict';
$log.debug('VatLayoutController.ctor()...');
......@@ -430,6 +430,13 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
}
}
$scope.approve = function(){
var approveParam={};
approveParam.projectId = vatSessionService.project.id;
approveParam.periodDate = vatSessionService.project.periodDate;
vatApproveService.commitNewApproval(approveParam);
}
$scope.showProjectStatus = function () {
var modalInstance = $uibModal.open({
animation: false,
......@@ -684,6 +691,7 @@ function ($scope, $rootScope, $q, $log, $timeout, $state, $translate, projectSer
});
}
function triggerSchedulerJob() {
vatWorkflowService.execute();
}
......
......@@ -19,9 +19,16 @@
<a ng-repeat="menu in menus" ui-sref-active="active" ng-click="setReportSession(menu.name);" ui-sref=".{{menu.name}}"
atms-permission permission-control-type="ngIf" permission-code="{{menu.permission}}">{{menu.state | translate}}</a>
</div>
<div style="float:right;margin-right:150px;">
<button class="btn btn-default btn-primary" ng-click="approve()">
<span>报表提审</span>
</button>
</div>
<!--<button class="btn btn-vat-primary" translate="TriggerMessageSchedulerJob" ng-click="triggerSchedulerJob()"></button>-->
</div>
......
This diff is collapsed.
......@@ -10,7 +10,6 @@
<module>atms-api</module>
<module>atms-web</module>
<module>atms-dao</module>
<module>atms-invoice</module>
</modules>
<properties>
......@@ -30,6 +29,7 @@
<sonar.exclusions>
**/*Mapper.*,**/*Example.*,**/*Test.java,**/*IT.java,**/*Dto.java,**/atms/entitiy/**/*.java,**/atms/thirdparty/**/*.java,**/atms/common/message/**/*.java,**/atms/dto/**/*.java,**/atms/constant/**/*.java
</sonar.exclusions>
<activiti.version>5.21.0</activiti.version>
</properties>
<dependencyManagement>
......
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