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

add

parent 8e2726d7
......@@ -322,6 +322,12 @@
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.4</version>
</dependency>
</dependencies>
<profiles>
......
package pwc.taxtech.atms.controller.input;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import pwc.taxtech.atms.controller.BaseController;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
import pwc.taxtech.atms.entitiy.InputInvoice;
import pwc.taxtech.atms.service.InvoiceManageService;
import java.util.List;
@Controller
@RequestMapping(value = "api/v1/invoiceManage")
public class InvoiceManageController extends BaseController {
@Autowired
private InvoiceManageService invoiceManageService;
@ResponseBody
@RequestMapping(value = "getInputInvoiceList", method = RequestMethod.POST)
public CamelPagingResultDto<InputInvoice> getInputInvoiceList(@RequestBody InputInvoiceQueryDto inputInvoiceQueryDto) {
//todo 参数校验
CamelPagingResultDto resultDto = new CamelPagingResultDto();
try {
List<InputInvoice> list = invoiceManageService.getInputInvoiceList(inputInvoiceQueryDto);
resultDto.setList(list);
//todo 业务代码
} catch (Exception e) {
logger.error("getInputInvoiceList error.",e);
}
return resultDto;
}
}
package pwc.taxtech.atms.dto.input;
import com.alibaba.fastjson.annotation.JSONField;
public class CamelPagingDto {
private Integer totalCount;
private Integer pageIndex;
private Integer pageSize;
public Integer getTotalCount() {
return totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Integer getPageIndex() {
return pageIndex;
}
public void setPageIndex(Integer pageIndex) {
this.pageIndex = pageIndex;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
package pwc.taxtech.atms.dto.input;
import java.util.List;
public class CamelPagingResultDto<T> {
private List<T> list;
private CamelPagingDto pageInfo;
private T calculateData;
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public CamelPagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public T getCalculateData() {
return calculateData;
}
public void setCalculateData(T calculateData) {
this.calculateData = calculateData;
}
}
package pwc.taxtech.atms.dto.input;
public class InputInvoiceQueryDto {
//todo 添加其他参数
private CamelPagingDto pagingDto;
public CamelPagingDto getPagingDto() {
return pagingDto;
}
public void setPagingDto(CamelPagingDto pagingDto) {
this.pagingDto = pagingDto;
}
}
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
import pwc.taxtech.atms.entitiy.InputInvoice;
import java.util.List;
public interface InvoiceManageService {
/**
* 条件分页查询
* @param inputInvoiceQueryDto param
* @return list
*/
List<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto);
}
package pwc.taxtech.atms.service.impl;
public class DistributedIDService {
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.SnowFlake;
import javax.annotation.PostConstruct;
@Service
public class DistributedIDService extends BaseService {
@Value("${distributed_id_datacenter}")
private Integer dataCenterId;
@Value("${distributed_id_machine}")
private Integer machineId;
private SnowFlake snowFlake;
@PostConstruct
public void init() {
snowFlake = new SnowFlake(dataCenterId, machineId);
}
/**
* 获取ID
*
* @return long
*/
public long nextId() {
return snowFlake.nextId();
}
}
package pwc.taxtech.atms.service.impl;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dto.input.InputInvoiceQueryDto;
import pwc.taxtech.atms.entitiy.InputInvoice;
import pwc.taxtech.atms.service.InvoiceManageService;
import java.util.List;
@Service
public class InvoiceManageServiceImpl extends BaseService implements InvoiceManageService {
@Override
public List<InputInvoice> getInputInvoiceList(InputInvoiceQueryDto inputInvoiceQueryDto) {
return null;
}
}
......@@ -18,4 +18,8 @@ jwt.powerToken=${jwt.powerToken}
ftp.host=${ftp.host}
ftp.port=${ftp.port}
ftp.user=${ftp.user}
ftp.pwd=${ftp.pwd}
\ No newline at end of file
ftp.pwd=${ftp.pwd}
#Distributed ID Generate
distributed_id_datacenter=${distributed_id_datacenter}
distributed_id_machine=${distributed_id_machine}
\ No newline at end of file
......@@ -17,4 +17,8 @@ jwt.powerToken=xxxx
ftp.host=cnshaappulv004.asia.pwcinternal.com
ftp.port=21
ftp.user=ftpuser
ftp.pwd=12345678
\ No newline at end of file
ftp.pwd=12345678
#Distributed ID Generate
distributed_id_datacenter=1
distributed_id_machine=1
\ No newline at end of file
......@@ -17,4 +17,8 @@ jwt.powerToken=
ftp.host=cnshaappulv004.asia.pwcinternal.com
ftp.port=21
ftp.user=ftpuser
ftp.pwd=12345678
\ No newline at end of file
ftp.pwd=12345678
#Distributed ID Generate
distributed_id_datacenter=1
distributed_id_machine=1
\ No newline at end of file
......@@ -17,4 +17,8 @@ jwt.powerToken=xxxx
ftp.host=cnshaappulv004.asia.pwcinternal.com
ftp.port=21
ftp.user=ftpuser
ftp.pwd=12345678
\ No newline at end of file
ftp.pwd=12345678
#Distributed ID Generate
distributed_id_datacenter=1
distributed_id_machine=1
\ 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