5 changed files with 96 additions and 89 deletions
@ -1,71 +0,0 @@ |
|||||
package cn.chjyj.szwh.controller.admin; |
|
||||
|
|
||||
import cn.chjyj.szwh.controller.BaseController; |
|
||||
import cn.chjyj.szwh.service.InvoiceService; |
|
||||
import com.alibaba.fastjson.JSON; |
|
||||
import com.alibaba.fastjson.JSONObject; |
|
||||
import org.apache.commons.lang3.StringUtils; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
import java.util.HashMap; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
/** |
|
||||
* 售后服务 |
|
||||
* 发票管理 |
|
||||
*/ |
|
||||
@RestController |
|
||||
@RequestMapping("/admin/order.InvoiceManagement") |
|
||||
public class AdminInvoiceManagementController extends BaseController { |
|
||||
/** |
|
||||
* 发票 |
|
||||
*/ |
|
||||
@Autowired |
|
||||
private InvoiceService invoiceService; |
|
||||
|
|
||||
@RequestMapping("/list") |
|
||||
public JSONObject list(@RequestBody String rejson){ |
|
||||
JSONObject request = JSON.parseObject(rejson); |
|
||||
Map query =new HashMap<>(); |
|
||||
String invoiceNumber = request.getString("invoice_number"); |
|
||||
if(StringUtils.isNotBlank(invoiceNumber)){ |
|
||||
query.put("ticketid",invoiceNumber); |
|
||||
} |
|
||||
|
|
||||
String seller = request.getString("seller"); |
|
||||
if(StringUtils.isNotBlank(seller)){ |
|
||||
query.put("saller",seller); |
|
||||
} |
|
||||
String buy = request.getString("buy"); |
|
||||
if(StringUtils.isNotBlank(buy)){ |
|
||||
query.put("u.name",buy); |
|
||||
} |
|
||||
|
|
||||
String batchcode = request.getString("batchcode"); |
|
||||
if(StringUtils.isNotBlank(batchcode)){ |
|
||||
query.put("ticket.batchcode",batchcode); |
|
||||
} |
|
||||
|
|
||||
String status = request.getString("status"); |
|
||||
if(StringUtils.isNotBlank(status)){ |
|
||||
query.put("order.status",status); |
|
||||
} |
|
||||
|
|
||||
String createtime = request.getString("createtime"); |
|
||||
//分页
|
|
||||
String page = request.getString("page"); |
|
||||
int ipage = StringUtils.isBlank(page)?1:Integer.valueOf(page); |
|
||||
|
|
||||
String limit = request.getString("limit"); |
|
||||
int ilimit = StringUtils.isBlank(limit)?20:Integer.valueOf(limit); |
|
||||
Map mp = invoiceService.getOrderTicketList(query,ipage,ilimit); |
|
||||
|
|
||||
jsonObject.put("data",mp); |
|
||||
jsonObject.put("code",200); |
|
||||
jsonObject.put("msg","成功"); |
|
||||
return jsonObject; |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,43 @@ |
|||||
|
package cn.chjyj.szwh.mapper; |
||||
|
|
||||
|
import cn.chjyj.szwh.dto.OrderTicketDTO; |
||||
|
import org.junit.Test; |
||||
|
import org.junit.runner.RunWith; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
import org.springframework.test.context.junit4.SpringRunner; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
import static org.junit.Assert.*; |
||||
|
|
||||
|
@SpringBootTest |
||||
|
@RunWith(SpringRunner.class) |
||||
|
public class TicketMapperTest { |
||||
|
@Autowired |
||||
|
private TicketMapper ticketMapper; |
||||
|
|
||||
|
@Test |
||||
|
public void getTicketLikeTid() { |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void getOrderTicketList() { |
||||
|
Map mp =new HashMap<>(); |
||||
|
int start=0; |
||||
|
int limit=10; |
||||
|
List<OrderTicketDTO> ottlist = ticketMapper.getOrderTicketList(mp,start,limit); |
||||
|
for(OrderTicketDTO ott:ottlist){ |
||||
|
System.out.println(ott.getPdfUrl()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void countOrderTicket() { |
||||
|
Map mp =new HashMap(); |
||||
|
int tt = ticketMapper.countOrderTicket(mp); |
||||
|
System.out.println(tt); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue