ky 5 years ago
parent 5100a3637a
commit 2846d1695b

@ -0,0 +1,62 @@
package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result;
import com.gszc.build.ResultBuilder;
import com.gszc.service.impl.CustomServiceImpl;
import com.gszc.service.impl.PcUserServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "工商注册 API", tags = {"后台公司api 2.0"})
@RestController
@RequestMapping("/pc/custom")
public class PcCustomV2Controller {
@Autowired
CustomServiceImpl customService;
@Autowired
PcUserServiceImpl pcUserService;
@PostMapping("/queryCustomCount")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "查看待接单、待认证公司数量", notes = "查看待接单、待认证公司数量")
public Result queryCustomCount() {
JSONObject customs = customService.queryCustomCount();
return ResultBuilder.withPayload(customs).build();
}
@PostMapping("/pcLogoutCustomList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "已注销列表", notes = "已注销列表")
public Result pcEnableCustomList(Integer pageNum,Integer pageSize) {
JSONObject customs = customService.pcLogoutCustomList(pageNum,pageSize);
return ResultBuilder.withPayload(customs).build();
}
@PostMapping("/pcDeleteCustomList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "已删除列表", notes = "已删除列表")
public Result pcDeleteCustomList(Integer pageNum,Integer pageSize) {
JSONObject customs = customService.pcDeleteCustomList(pageNum,pageSize);
return ResultBuilder.withPayload(customs).build();
}
@PostMapping("/revertCustom")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "删除公司还原", notes = "删除公司还原")
public Result revertCustom(String customId) {
customService.revertCustom(customId);
return ResultBuilder.success().build();
}
}

@ -36,9 +36,9 @@ public class PcInvoiceController {
@PostMapping("/pcEnableInvoiceList")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "已开票列表", notes = "已开票列表")
public Result pcEnableInvoiceList(Integer pageNum,Integer pageSize,String copycatId) {
public Result pcEnableInvoiceList(Integer pageNum,Integer pageSize,String copycatId,String keyword,Long beginTime,Long endTime) {
JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize,copycatId);
JSONObject invoiceList = invoiceService.pcEnableInvoiceList(pageNum,pageSize,copycatId,keyword,beginTime,endTime);
return ResultBuilder.withPayload(invoiceList).build();
}

@ -0,0 +1,33 @@
package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result;
import com.gszc.build.ResultBuilder;
import com.gszc.service.impl.InvoiceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "工商注册 API", tags = {"后台开票api 2.0"})
@RestController
@RequestMapping("/pc/invoice")
public class PcInvoiceV2Controller {
@Autowired
InvoiceServiceImpl invoiceService;
@PostMapping("/queryInvoiceCount")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "查看待开票数量", notes = "查看待开票数量")
public Result queryInvoiceCount(String copycatId) {
JSONObject customs = invoiceService.queryInvoiceCount(copycatId);
return ResultBuilder.withPayload(customs).build();
}
}

@ -88,7 +88,7 @@ disable 认证不通过
todo
logout
*/
@ApiModelProperty(value = "状态 enable 认证通过 disable 认证不通过 todo 待接单 logout 已注销")
@ApiModelProperty(value = "状态 enable 认证通过 disable 认证不通过 todo 待接单 logout 已注销 delete-已删除")
private String statusCode;
/**

@ -349,7 +349,11 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
}
public void deleteCustom(String customId){
customMapper.deleteById(customId);
Custom custom = new Custom();
custom.setId(customId);
custom.setModifyDate( new Date());
custom.setStatusCode("delete");
customMapper.updateById(custom);
}
public void logoutCustom(String customId){
@ -381,4 +385,59 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
jsonObject.put("count",count);
return jsonObject;
}
public JSONObject queryCustomCount(){
Integer todoCount = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "todo"));
Integer disableCount = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable"));
JSONObject jsonObject = new JSONObject();
jsonObject.put("todoCount",todoCount);
jsonObject.put("disableCount",disableCount);
return jsonObject;
}
/**
*
* @param pageNum
* @param pageSize
* @return
*/
public JSONObject pcLogoutCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "logout"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "logout").orderBy("create_date", false));
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("customs",customs);
return jsonObject;
}
/**
*
* @param pageNum
* @param pageSize
* @return
*/
public JSONObject pcDeleteCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "delete"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "delete").orderBy("create_date", false));
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("customs",customs);
return jsonObject;
}
/**
*
* @param customId
*/
public void revertCustom(String customId){
Custom custom = new Custom();
custom.setId(customId);
custom.setModifyDate( new Date());
custom.setStatusCode("todo");
customMapper.updateById(custom);
}
}

@ -193,15 +193,21 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return jsonObject;
}
public JSONObject pcEnableInvoiceList(Integer pageNum, Integer pageSize, String copycatId) {
public JSONObject pcEnableInvoiceList(Integer pageNum, Integer pageSize, String copycatId,String keyword,Long beginTime,Long endTime) {
Integer count = null;
List<Invoice> invoiceList;
if (null == copycatId) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable"));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").orderBy("create_date", false));
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().like("company_name",keyword).between("create_date",beginTime,endTime));
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())).orderBy("create_date", false));
} else {
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().eq("copycat_id", copycatId));
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().eq("copycat_id", copycatId).like("company_name",keyword).between("create_date",beginTime,endTime));
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
@ -253,4 +259,21 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
return orderTracesByJson;
}
public JSONObject queryInvoiceCount(String copycatId) {
Integer count = null;
if (null == copycatId) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable"));
} else {
List<Custom> customList = customMapper.selectList(new EntityWrapper<Custom>().eq("copycat_id", copycatId));
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "disable").in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("count", count);
return jsonObject;
}
}

Loading…
Cancel
Save