1.新增卡券记录接口

2.查询接口,查询条件(client_moniker) 、分页
master
yangkai 6 years ago
parent dc103d5fd2
commit 495bf22196

@ -160,4 +160,7 @@ public interface RetailAppService {
JSONObject ctripCouponInfo(JSONObject device,String coupon_id); JSONObject ctripCouponInfo(JSONObject device,String coupon_id);
JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean);
void saveCouponAccuessLog(int client_id, String coupon_id);
} }

@ -172,6 +172,8 @@ public class RetailAppServiceImp implements RetailAppService {
private ClearingLogMapper clearingLogMapper; private ClearingLogMapper clearingLogMapper;
@Resource @Resource
private CustomerServiceService customerServiceService; private CustomerServiceService customerServiceService;
@Resource
private CouponAccuessLogMapper couponAccuessLogMapper;
private Map<String, AppMsgSender> senderMap = new HashMap<>(); private Map<String, AppMsgSender> senderMap = new HashMap<>();
private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" }; private final String fileName[] = { "client_bank_file", "client_id_file", "client_company_file" };
@ -451,6 +453,36 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override
public JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean) {
JSONObject client = clientMapper.findClientByMoniker(client_moniker);
if (client == null) {
throw new BadRequestException("Partner not exists");
}
PageList<JSONObject> cusCouponLog = couponAccuessLogMapper.getCouponAccuessLog(
client.getIntValue("client_id"), new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc")));
return PageListUtils.buildPageListResult(cusCouponLog);
}
@Override
public void saveCouponAccuessLog(int client_id, String coupon_id) {
JSONObject client = clientMapper.findClient(client_id);
if (client == null) {
throw new BadRequestException("Partner not exists");
}
JSONObject couponAccuessLog = new JSONObject();
couponAccuessLog.put("client_id", client_id);
couponAccuessLog.put("order_id", "非平台订单");
couponAccuessLog.put("coupon_id", coupon_id);
couponAccuessLog.put("customer_openid", "非平台订单");
couponAccuessLog.put("coupon_deal_amount", 0);
couponAccuessLog.put("currency", "AUD");
couponAccuessLog.put("creation_date", new Date());
couponAccuessLog.put("last_update_date", new Date());
couponAccuessLog.put("is_valid", 1);
couponAccuessLogMapper.save(couponAccuessLog);
}
@Override @Override
public void updateClient(JSONObject device, AppClientBean appClientBean) { public void updateClient(JSONObject device, AppClientBean appClientBean) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");

@ -564,4 +564,14 @@ public class RetailAppController {
return retailAppService.ctripCouponInfo(device,couponId); return retailAppService.ctripCouponInfo(device,couponId);
} }
@RequestMapping(value = "/cus/coupon_accuess_log/{client_moniker}", method = RequestMethod.GET)
public JSONObject getCouponLogByClientMoniker(@PathVariable String client_moniker, AppQueryBean appQueryBean) {
return retailAppService.getCouponCusCouponLog(client_moniker, appQueryBean);
}
@RequestMapping(value = "/cus/coupon_accuess_log/{client_id}/save", method = RequestMethod.POST)
public void saveCouponAccuessLog(@PathVariable int client_id, @RequestParam String coupon_id) {
retailAppService.saveCouponAccuessLog(client_id, coupon_id);
}
} }

@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.mappers.log;
import java.util.List; import java.util.List;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -26,4 +28,7 @@ public interface CouponAccuessLogMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> findCouponByOrderId(@Param("order_id") String order_id); List<JSONObject> findCouponByOrderId(@Param("order_id") String order_id);
@AutoSql(type = SqlType.SELECT)
PageList<JSONObject> getCouponAccuessLog(@Param("client_id")int client_id, PageBounds pageBounds);
} }

Loading…
Cancel
Save