diff --git a/src/main/java/com/gszc/controller/CountController.java b/src/main/java/com/gszc/controller/CountController.java index 954ac97..3ce25ec 100644 --- a/src/main/java/com/gszc/controller/CountController.java +++ b/src/main/java/com/gszc/controller/CountController.java @@ -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(); } /** diff --git a/src/main/java/com/gszc/controller/MiniCustomController.java b/src/main/java/com/gszc/controller/MiniCustomController.java index 2a4bbb0..1ab2bb2 100644 --- a/src/main/java/com/gszc/controller/MiniCustomController.java +++ b/src/main/java/com/gszc/controller/MiniCustomController.java @@ -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 customs = customService.customList(userId); + List customs = customService.customList(userId,type); return ResultBuilder.withPayload(customs).build(); } diff --git a/src/main/java/com/gszc/controller/MiniInvoiceController.java b/src/main/java/com/gszc/controller/MiniInvoiceController.java index 22d8daa..bf4debf 100644 --- a/src/main/java/com/gszc/controller/MiniInvoiceController.java +++ b/src/main/java/com/gszc/controller/MiniInvoiceController.java @@ -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 invoiceList = invoiceService.invoiceList(userId); + List invoiceList = invoiceService.invoiceList(userId,type); return ResultBuilder.withPayload(invoiceList).build(); } diff --git a/src/main/java/com/gszc/controller/PcCustomController.java b/src/main/java/com/gszc/controller/PcCustomController.java index eb0093e..13a4ca1 100644 --- a/src/main/java/com/gszc/controller/PcCustomController.java +++ b/src/main/java/com/gszc/controller/PcCustomController.java @@ -34,7 +34,7 @@ public class PcCustomController { @ApiOperation(value = "待接单列表", notes = "待接单列表") public Result pcTodoCustomList(Integer pageNum,Integer pageSize) { - List 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 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 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 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(); + } } diff --git a/src/main/java/com/gszc/controller/PcInvoiceController.java b/src/main/java/com/gszc/controller/PcInvoiceController.java index cc30492..3b89a04 100644 --- a/src/main/java/com/gszc/controller/PcInvoiceController.java +++ b/src/main/java/com/gszc/controller/PcInvoiceController.java @@ -29,7 +29,7 @@ public class PcInvoiceController { @ApiOperation(value = "待开票列表", notes = "待开票列表") public Result pcDisableInvoiceList(Integer pageNum,Integer pageSize) { - List 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 invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize); + JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize); return ResultBuilder.withPayload(invoiceList).build(); } diff --git a/src/main/java/com/gszc/entity/Custom.java b/src/main/java/com/gszc/entity/Custom.java index 513ebcb..e1fbe95 100644 --- a/src/main/java/com/gszc/entity/Custom.java +++ b/src/main/java/com/gszc/entity/Custom.java @@ -161,5 +161,6 @@ red yellow blue purple private Date modifyDate; @ApiModelProperty(value = "小程序用户id") private String miniUserId; - + @ApiModelProperty(value = "园区") + private String park; } diff --git a/src/main/java/com/gszc/service/MiniAppService.java b/src/main/java/com/gszc/service/MiniAppService.java index 9943abb..f31498e 100644 --- a/src/main/java/com/gszc/service/MiniAppService.java +++ b/src/main/java/com/gszc/service/MiniAppService.java @@ -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; diff --git a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java index 7fad30f..b0e8f00 100644 --- a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java @@ -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 impleme return customs; } - public List customList(String userId){ - List customs = customMapper.selectList(new EntityWrapper().eq("mini_user_id", userId)); + public List customList(String userId,String type){ + Wrapper miniUserId = new EntityWrapper().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 customs = customMapper.selectList(miniUserId); return customs; } @@ -102,10 +113,15 @@ public class CustomServiceImpl extends ServiceImpl impleme * @param pageSize * @return */ - public List pcTodoCustomList(Integer pageNum,Integer pageSize){ + public JSONObject pcTodoCustomList(Integer pageNum,Integer pageSize){ + Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "todo")); List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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 impleme * @param pageSize * @return */ - public List pcDisableCustomList(Integer pageNum,Integer pageSize){ + public JSONObject pcDisableCustomList(Integer pageNum,Integer pageSize){ + Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "disable")); List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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 impleme * @param pageSize * @return */ - public List pcEnableCustomList(Integer pageNum,Integer pageSize){ + public JSONObject pcEnableCustomList(Integer pageNum,Integer pageSize){ + Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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 impleme return jsonObject; } - public List enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize){ + public JSONObject enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize){ + Integer count = invoiceMapper.selectCount(new EntityWrapper().eq("custom_id", customId)); List invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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); } } diff --git a/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java b/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java index 8158bd4..78ca018 100644 --- a/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/InvoiceServiceImpl.java @@ -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 impl invoiceMapper.insert(invoice); } - public List invoiceList(String userId){ + public List invoiceList(String userId,String type){ List list = new ArrayList<>(); - List customs = customService.customList(userId); + List customs = customService.customList(userId,null); for(Custom custom:customs){ - List invoiceList = invoiceMapper.selectList(new EntityWrapper().eq("custom_id", custom.getId())); + Wrapper customId = new EntityWrapper().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 invoiceList = invoiceMapper.selectList(customId); if(invoiceList.size()>0){ list.addAll(invoiceList); } @@ -99,14 +108,22 @@ public class InvoiceServiceImpl extends ServiceImpl impl return invoiceHeader; } - public List pcDisableInvoiceList(Integer pageNum,Integer pageSize){ + public JSONObject pcDisableInvoiceList(Integer pageNum,Integer pageSize){ + Integer count = invoiceMapper.selectCount(new EntityWrapper().eq("status_code", "disable")); List invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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 pcEnableInvoiceList(Integer pageNum,Integer pageSize){ + public JSONObject pcEnableInvoiceList(Integer pageNum,Integer pageSize){ + Integer count = invoiceMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); List invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().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){