add cancle time

master
wangning 7 years ago
parent 7728c15c81
commit bf69dfbfe5

@ -286,8 +286,6 @@ public class RetailAppController {
}
@RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET)
public JSONObject getAdDetail(@PathVariable String article_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
device = new JSONObject();
device.put("client_id",9);
return retailAppService.getAdDetail(device,article_id);
}
@ -295,32 +293,22 @@ public class RetailAppController {
@RequestMapping(value = "/bills/{bill_id}",method = RequestMethod.GET)
public JSONObject getBill(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
device = new JSONObject();
device.put("client_id",9);
return billService.getBillDetail(bill_id,device.getIntValue("client_id"));
}
@RequestMapping(value = "/bills/list",method = RequestMethod.GET)
public JSONObject getBills(QueryBillBean queryBillBean,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
device = new JSONObject();
device.put("client_id",9);
return billService.queryBills(device.getIntValue("client_id"),queryBillBean);
}
@RequestMapping(value = "/bills",method = RequestMethod.PUT)
public void addBill(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody NewBillBean newBillBean){
device = new JSONObject();
device.put("client_id",9);
billService.save(device.getIntValue("client_id"),newBillBean);
}
@RequestMapping(value = "/bills/{bill_id}/close",method = RequestMethod.POST)
public void closeBill(@PathVariable("bill_id")String bill_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
device = new JSONObject();
device.put("client_id",9);
billService.updateBillStatus(bill_id,"2",device.getIntValue("client_id"));
}
@RequestMapping(value = "/bills/orders/{bill_id}",method = RequestMethod.GET)
public List<JSONObject> getBillOrders(@PathVariable("bill_id")String bill_id, QueryBillOrderBean queryBillOrderBean,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){
device = new JSONObject();
device.put("client_id",9);
return billOrderService.query(bill_id,device.getIntValue("client_id"),queryBillOrderBean);
}
}

@ -13,6 +13,9 @@ public class NewBillBean {
private String remark;
private int ineffective_hour;
public String getRemark() {
return remark;
}
@ -36,4 +39,12 @@ public class NewBillBean {
public void setPrice(BigDecimal price) {
this.price = price;
}
public int getIneffective_hour() {
return ineffective_hour;
}
public void setIneffective_hour(int ineffective_hour) {
this.ineffective_hour = ineffective_hour;
}
}

@ -1,14 +1,13 @@
package au.com.royalpay.payment.manage.bill.core.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
@ -29,12 +28,14 @@ public class BillServiceImpl implements BillService {
@Override
public void save(int client_id,NewBillBean newBillBean) {
Date now = new Date();
JSONObject record = new JSONObject();
record.put("client_id",client_id);
record.put("price",newBillBean.getPrice());
record.put("currency",newBillBean.getCurrency());
record.put("remark",newBillBean.getRemark());
record.put("create_time", new Date());
record.put("create_time", now);
record.put("cancle_time",DateUtils.addHours(now,newBillBean.getIneffective_hour()));
record.put("status", 1);
billMapper.save(record);
}

@ -3,13 +3,13 @@
<mapper namespace="au.com.royalpay.payment.manage.mappers.bill.BillMapper">
<select id="listWithOrderAnalysis" resultType="com.alibaba.fastjson.JSONObject" >
select b.bill_id,b.create_time,b.remark,b.price,count(o.bill_order_id) order_counts,sum(o.order_total_amount) order_total_amount from pmt_bill b right join pmt_bill_order o on b.bill_id = o.bill_id and o.order_status = 1
select b.bill_id,b.status,b.currency,DATE_FORMAT(b.create_time,'%Y-%c-%e') create_date, DATE_FORMAT(b.create_time,'%H:%m:%s') create_time,b.remark,b.price,count(o.bill_order_id) order_counts,sum(o.order_total_amount) order_total_amount from pmt_bill b right join pmt_bill_order o on b.bill_id = o.bill_id and o.order_status = 1
<where>
<if test="param.status != null">
and o.status = #{param.status}
</if>
</where>
group by b.bill_id,b.create_time,b.remark,b.price
group by b.bill_id,create_time,create_date,b.remark,b.price,b.status,b.currency
order by b.create_time desc
</select>
</mapper>
Loading…
Cancel
Save