master
ky 6 years ago
parent 0e510ff55e
commit 263389777f

@ -1,5 +1,6 @@
package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result;
import com.gszc.build.ResultBuilder;
import com.gszc.service.CountService;
@ -33,16 +34,30 @@ public class CountController {
@ApiImplicitParam(name = "companyType", value = "公司类型1-有限公司 2-个独、合伙企业)", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "invoiceType", value = "开票类型1-普通发票 2-专用发票)", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "specialInvoiceType", value = "专票类型1-服务业 2-商业),不是专票不用填写", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "money", value = "开票金额", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "oneMoney", value = "第一季度开票金额", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "twoMoney", value = "第二季度开票金额", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "threeMoney", value = "第三季度开票金额", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "fourMoney", value = "第四季度开票金额", dataType = "string", paramType = "query"),
})
public Result VATCount(String companyType,String invoiceType,String specialInvoiceType,double money) {
BigDecimal bigDecimal = null;
public Result VATCount(String companyType,String invoiceType,String specialInvoiceType,double oneMoney,double twoMoney,double threeMoney,double fourMoney) {
BigDecimal oneBigDecimal = null;
BigDecimal twoBigDecimal = null;
BigDecimal threeBigDecimal = null;
BigDecimal fourBigDecimal = null;
JSONObject jsonObject = new JSONObject();
try {
bigDecimal = countService.VATCount(companyType,invoiceType,specialInvoiceType,money);
oneBigDecimal = countService.VATCount(companyType,invoiceType,specialInvoiceType,oneMoney);
twoBigDecimal = countService.VATCount(companyType,invoiceType,specialInvoiceType,twoMoney);
threeBigDecimal = countService.VATCount(companyType,invoiceType,specialInvoiceType,threeMoney);
fourBigDecimal = countService.VATCount(companyType,invoiceType,specialInvoiceType,fourMoney);
jsonObject.put("one",oneBigDecimal);
jsonObject.put("two",twoBigDecimal);
jsonObject.put("three",threeBigDecimal);
jsonObject.put("four",fourBigDecimal);
} catch (Exception e) {
return ResultBuilder.error("参数错误",e).build();
}
return ResultBuilder.withPayload(bigDecimal).build();
return ResultBuilder.withPayload(jsonObject).build();
}
/**

@ -42,11 +42,15 @@ public class MiniCustomController {
}
@PostMapping("/customList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "String"),
@ApiImplicitParam(name = "type", value = "状态 todo待认证 disable办理中 enable已完成", dataType = "String")
})
@ApiOperation(value = "注册公司列表", notes = "注册公司列表")
public Result customList(String userId) {
public Result customList(String userId,String type) {
List<Custom> customs = customService.customList(userId);
List<Custom> customs = customService.customList(userId,type);
return ResultBuilder.withPayload(customs).build();
}

@ -34,11 +34,15 @@ public class MiniInvoiceController {
}
@PostMapping("/invoiceList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "String"),
@ApiImplicitParam(name = "type", value = "状态 disable办理中 enable已完成", dataType = "String")
})
@ApiOperation(value = "开票记录", notes = "开票记录")
public Result invoiceList(String userId) {
public Result invoiceList(String userId,String type) {
List<Invoice> invoiceList = invoiceService.invoiceList(userId);
List<Invoice> invoiceList = invoiceService.invoiceList(userId,type);
return ResultBuilder.withPayload(invoiceList).build();
}

@ -34,7 +34,7 @@ public class PcCustomController {
@ApiOperation(value = "待接单列表", notes = "待接单列表")
public Result pcTodoCustomList(Integer pageNum,Integer pageSize) {
List<Custom> customs = customService.pcTodoCustomList(pageNum,pageSize);
JSONObject customs = customService.pcTodoCustomList(pageNum,pageSize);
return ResultBuilder.withPayload(customs).build();
}
@ -43,7 +43,7 @@ public class PcCustomController {
@ApiOperation(value = "待认证列表", notes = "待认证列表")
public Result pcDisableCustomList(Integer pageNum,Integer pageSize) {
List<Custom> customs = customService.pcDisableCustomList(pageNum,pageSize);
JSONObject customs = customService.pcDisableCustomList(pageNum,pageSize);
return ResultBuilder.withPayload(customs).build();
}
@ -52,7 +52,7 @@ public class PcCustomController {
@ApiOperation(value = "已认证列表", notes = "已认证列表")
public Result pcEnableCustomList(Integer pageNum,Integer pageSize) {
List<Custom> customs = customService.pcEnableCustomList(pageNum,pageSize);
JSONObject customs = customService.pcEnableCustomList(pageNum,pageSize);
return ResultBuilder.withPayload(customs).build();
}
@ -124,7 +124,16 @@ public class PcCustomController {
@ApiOperation(value = "已认证公司详情开票记录", notes = "已认证公司详情开票记录")
public Result enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize) {
List<Invoice> invoiceList = customService.enableCustomDetailInvoiceList(customId, pageNum, pageSize);
JSONObject invoiceList = customService.enableCustomDetailInvoiceList(customId, pageNum, pageSize);
return ResultBuilder.withPayload(invoiceList).build();
}
@PostMapping("/deleteCustom")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "删除公司", notes = "删除公司")
public Result deleteCustom(String customId) {
customService.deleteCustom(customId);
return ResultBuilder.success().build();
}
}

@ -29,7 +29,7 @@ public class PcInvoiceController {
@ApiOperation(value = "待开票列表", notes = "待开票列表")
public Result pcDisableInvoiceList(Integer pageNum,Integer pageSize) {
List<Invoice> invoiceList = invoiceService.pcDisableInvoiceList(pageNum,pageSize);
JSONObject invoiceList = invoiceService.pcDisableInvoiceList(pageNum,pageSize);
return ResultBuilder.withPayload(invoiceList).build();
}
@ -38,7 +38,7 @@ public class PcInvoiceController {
@ApiOperation(value = "已开票列表", notes = "已开票列表")
public Result pcEnableInvoiceList(Integer pageNum,Integer pageSize) {
List<Invoice> invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize);
JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize);
return ResultBuilder.withPayload(invoiceList).build();
}

@ -161,5 +161,6 @@ red yellow blue purple
private Date modifyDate;
@ApiModelProperty(value = "小程序用户id")
private String miniUserId;
@ApiModelProperty(value = "园区")
private String park;
}

@ -20,7 +20,7 @@ import java.util.*;
@Transactional
public class MiniAppService {
final WxMaService wxService = WxMaConfiguration.getMaService("wxb3f8c04dd0f5922f");
final WxMaService wxService = WxMaConfiguration.getMaService("wxb39f114716ec3157");
@Autowired
MiniUserMapper miniUserMapper;

@ -2,6 +2,7 @@ package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.gszc.entity.*;
import com.gszc.mapper.*;
@ -82,8 +83,18 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
return customs;
}
public List<Custom> customList(String userId){
List<Custom> customs = customMapper.selectList(new EntityWrapper<Custom>().eq("mini_user_id", userId));
public List<Custom> customList(String userId,String type){
Wrapper<Custom> miniUserId = new EntityWrapper<Custom>().eq("mini_user_id", userId);
if(null==type){
}else if(type.equals("todo")){
miniUserId.eq("status_code","todo");
}else if(type.equals("disable")){
miniUserId.eq("status_code","disable");
}else if(type.equals("enable")){
miniUserId.eq("status_code","enable");
}
List<Custom> customs = customMapper.selectList(miniUserId);
return customs;
}
@ -102,10 +113,15 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize
* @return
*/
public List<Custom> pcTodoCustomList(Integer pageNum,Integer pageSize){
public JSONObject pcTodoCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "todo"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "todo"));
return customs;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("customs",customs);
return jsonObject;
}
/**
@ -114,10 +130,14 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize
* @return
*/
public List<Custom> pcDisableCustomList(Integer pageNum,Integer pageSize){
public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable"));
return customs;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("customs",customs);
return jsonObject;
}
/**
@ -126,10 +146,14 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
* @param pageSize
* @return
*/
public List<Custom> pcEnableCustomList(Integer pageNum,Integer pageSize){
public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable"));
return customs;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("customs",customs);
return jsonObject;
}
/**
@ -235,9 +259,17 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
return jsonObject;
}
public List<Invoice> enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize){
public JSONObject enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("custom_id", customId));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("custom_id", customId));
return invoiceList;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("invoiceList",invoiceList);
return jsonObject;
}
public void deleteCustom(String customId){
customMapper.deleteById(customId);
}
}

@ -2,6 +2,7 @@ package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.gszc.entity.Custom;
import com.gszc.entity.Invoice;
@ -50,11 +51,19 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
invoiceMapper.insert(invoice);
}
public List<Invoice> invoiceList(String userId){
public List<Invoice> invoiceList(String userId,String type){
List<Invoice> list = new ArrayList<>();
List<Custom> customs = customService.customList(userId);
List<Custom> customs = customService.customList(userId,null);
for(Custom custom:customs){
List<Invoice> invoiceList = invoiceMapper.selectList(new EntityWrapper<Invoice>().eq("custom_id", custom.getId()));
Wrapper<Invoice> customId = new EntityWrapper<Invoice>().eq("custom_id", custom.getId());
if(null==type){
}else if(type.equals("disable")){
customId.eq("status_code","disable");
}else if(type.equals("enable")){
customId.eq("status_code","enable");
}
List<Invoice> invoiceList = invoiceMapper.selectList(customId);
if(invoiceList.size()>0){
list.addAll(invoiceList);
}
@ -99,14 +108,22 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return invoiceHeader;
}
public List<Invoice> pcDisableInvoiceList(Integer pageNum,Integer pageSize){
public JSONObject pcDisableInvoiceList(Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable"));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("status_code", "disable").orderBy("create_date",false));
return invoiceList;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("invoiceList",invoiceList);
return jsonObject;
}
public List<Invoice> pcEnableInvoiceList(Integer pageNum,Integer pageSize){
public JSONObject pcEnableInvoiceList(Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable"));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("status_code", "enable").orderBy("create_date",false));
return invoiceList;
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("invoiceList",invoiceList);
return jsonObject;
}
public void invoiceConfirm(String invoiceId,String trackingCompany,String trackingCode,String trackingImg){

Loading…
Cancel
Save