Merge branch 'develop'

master
taylor.dang 6 years ago
commit 7cdad1807d

@ -162,7 +162,9 @@ public interface RetailAppService {
JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean); JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean);
void saveCouponAccuessLog(int client_id, String coupon_id); void saveCouponAccuessLog(int client_id, String coupon_id, String remark);
JSONObject getStyle(); JSONObject getStyle();
void cancelCouponAccuessLog(String accuess_id, String remark);
} }

@ -479,7 +479,7 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override @Override
public void saveCouponAccuessLog(int client_id, String coupon_id) { public void saveCouponAccuessLog(int client_id, String coupon_id, String remark) {
JSONObject client = clientMapper.findClient(client_id); JSONObject client = clientMapper.findClient(client_id);
if (client == null) { if (client == null) {
throw new BadRequestException("Partner not exists"); throw new BadRequestException("Partner not exists");
@ -487,14 +487,15 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject couponAccuessLog = new JSONObject(); JSONObject couponAccuessLog = new JSONObject();
Date date = new Date(); Date date = new Date();
couponAccuessLog.put("client_id", client_id); couponAccuessLog.put("client_id", client_id);
couponAccuessLog.put("order_id", "非平台订单"); couponAccuessLog.put("order_id", "NON_PLATFORM_ORDER");
couponAccuessLog.put("coupon_id", "CTRIP_"+coupon_id); couponAccuessLog.put("coupon_id", "CTRIP_"+coupon_id);
couponAccuessLog.put("customer_openid", "非平台订单"); couponAccuessLog.put("customer_openid", "NON_PLATFORM_ORDER");
couponAccuessLog.put("coupon_deal_amount", 0); couponAccuessLog.put("coupon_deal_amount", 0);
couponAccuessLog.put("currency", "AUD"); couponAccuessLog.put("currency", "AUD");
couponAccuessLog.put("creation_date", date); couponAccuessLog.put("creation_date", date);
couponAccuessLog.put("last_update_date", date); couponAccuessLog.put("last_update_date", date);
couponAccuessLog.put("is_valid", 1); couponAccuessLog.put("is_valid", 1);
couponAccuessLog.put("remark", remark);
couponAccuessLogMapper.save(couponAccuessLog); couponAccuessLogMapper.save(couponAccuessLog);
} }
@ -503,6 +504,18 @@ public class RetailAppServiceImp implements RetailAppService {
return royalPayCMSSupport.getStyle(); return royalPayCMSSupport.getStyle();
} }
@Override
public void cancelCouponAccuessLog(String accuess_id, String remark) {
JSONObject couponAccuessLog = new JSONObject();
couponAccuessLog.put("accuess_id", accuess_id);
couponAccuessLog.put("is_valid", 0);
couponAccuessLog.put("last_update_date", new Date());
if (StringUtils.isNotEmpty(remark)) {
couponAccuessLog.put("remark", remark);
}
couponAccuessLogMapper.update(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");

@ -33,13 +33,7 @@ import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -557,8 +551,8 @@ public class RetailAppController {
} }
@RequestMapping(value = "/cus/coupon_accuess_log/{coupon_id}", method = RequestMethod.POST) @RequestMapping(value = "/cus/coupon_accuess_log/{coupon_id}", method = RequestMethod.POST)
public void saveCouponAccuessLog(@PathVariable String coupon_id, @RequestParam int client_id) { public void saveCouponAccuessLog(@PathVariable String coupon_id, @RequestParam int client_id, String remark) {
retailAppService.saveCouponAccuessLog(client_id, coupon_id); retailAppService.saveCouponAccuessLog(client_id, coupon_id, remark);
} }
@RequestMapping(value = "/style", method = RequestMethod.GET) @RequestMapping(value = "/style", method = RequestMethod.GET)
@ -566,4 +560,9 @@ public class RetailAppController {
return retailAppService.getStyle(); return retailAppService.getStyle();
} }
@RequestMapping(value = "/cus/coupon_accuess_log/{accuess_id}", method = RequestMethod.PUT)
public void updateCouponAccuessLog(@PathVariable String accuess_id, String remark) {
retailAppService.cancelCouponAccuessLog(accuess_id, remark);
}
} }

@ -6,7 +6,7 @@
accuess_id,client_id,customer_openid,order_id, accuess_id,client_id,customer_openid,order_id,
TRIM(LEADING #{keyword} FROM coupon_id) coupon_id, TRIM(LEADING #{keyword} FROM coupon_id) coupon_id,
coupon_deal_amount,min_pay_amount,currency,creation_date, coupon_deal_amount,min_pay_amount,currency,creation_date,
last_update_date,is_valid,transaction_id,transaction_refund_id,refund_id last_update_date,is_valid,transaction_id,transaction_refund_id,refund_id,remark
FROM cus_coupon_accuess_log FROM cus_coupon_accuess_log
WHERE locate(#{keyword},coupon_id) = 1 AND client_id = #{client_id} WHERE locate(#{keyword},coupon_id) = 1 AND client_id = #{client_id}
</select> </select>

Loading…
Cancel
Save