master
wangning 7 years ago
parent b476f2f898
commit 85e9c392f9

@ -6,6 +6,7 @@ import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.bill.bean.NewBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService;
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
@ -304,7 +305,7 @@ public class RetailAppController {
billService.updateBillStatus(bill_id,"2");
}
@RequestMapping(value = "/bills/orders/{bill_id}",method = RequestMethod.GET)
public List<JSONObject> getBillOrders(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
return billOrderService.getByBillId(bill_id,device.getIntValue("client_id"));
public List<JSONObject> getBillOrders(@PathVariable("bill_id")String bill_id, QueryBillOrderBean queryBillOrderBean,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
return billOrderService.query(bill_id,device.getIntValue("client_id"),queryBillOrderBean);
}
}

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.bill.bean;
import com.alibaba.fastjson.JSONObject;
/**
* Created by wangning on 26/02/2018.
*/
@ -7,4 +9,33 @@ public class QueryBillOrderBean {
private String status;
private int page = 1;
private int limit = 20;
public JSONObject toParams(){
JSONObject param = new JSONObject();
param.put("status",status);
return param;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
}

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.bill.core;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
@ -11,5 +13,5 @@ public interface BillOrderService {
List<JSONObject> getByBillId(String bill_id, int client_id);
List<JSONObject> query(String bill_id, int page, int limit);
List<JSONObject> query(String bill_id,int client_id, QueryBillOrderBean queryBillOrderBean);
}

@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.mappers.bill.BillMapper;
import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper;
@ -42,4 +43,14 @@ public class BillOrderServiceImpl implements BillOrderService {
}
return wechatBillOrders;
}
@Override
public List<JSONObject> query(String bill_id,int client_id, QueryBillOrderBean queryBillOrderBean) {
JSONObject bill = billMapper.findOne(bill_id);
if(bill.getIntValue("client_id")!= client_id){
throw new BadRequestException("You have no right to check this bill");
}
return billOrderMapper.query(bill_id,queryBillOrderBean.toParams());
}
}

@ -29,6 +29,7 @@ public interface BillOrderMapper {
JSONObject findByClientId(@Param("client_id") int client_id);
@AutoSql(type = SqlType.SELECT)
JSONObject findByBillId(@Param("bill_id") String bill_id);
List<JSONObject> findByBillId(@Param("bill_id") String bill_id);
List<JSONObject> query(@Param("bill_id") String bill_id, @Param("param") JSONObject jsonObject);
}

@ -11,4 +11,13 @@
r.nickname,r.headimg
from pmt_bill_order o left join sys_customer_relation_alipay r on r.alipay_uid = o.customer_id and o.channel = 'Alipay' and o.bill_id = #{bill_id}
</select>
<select id="query" resultType="com.alibaba.fastjson.JSONObject">
select * from pmt_bill_order
where
bill_id = #{bill_id}
<if test="param.status != null">
order_status = #{param.status}
</if>
</select>
</mapper>
Loading…
Cancel
Save