|
@@ -121,7 +121,13 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
|
|
|
// 新的积分
|
|
|
BigDecimal adultQuotedPoints = new BigDecimal(cheapAirlinePrice.getData().get("AdultQuotedPoints").toString());
|
|
|
- BigDecimal oldAdultQuotedPoints = new BigDecimal(oldScpolicy.getBigScore());
|
|
|
+ BigDecimal oldAdultQuotedPoints = null;
|
|
|
+ String bigScore = oldScpolicy.getBigScore();
|
|
|
+ if(StringUtil.isNotBlank(bigScore)){
|
|
|
+ oldAdultQuotedPoints = new BigDecimal(bigScore);
|
|
|
+ }else {
|
|
|
+ oldAdultQuotedPoints = new BigDecimal(0);
|
|
|
+ }
|
|
|
monitor.put("adultQuotedPoints", adultQuotedPoints.doubleValue());
|
|
|
monitor.put("oldAdultQuotedPoints", oldAdultQuotedPoints.doubleValue());
|
|
|
|
|
@@ -248,14 +254,14 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
//进行入库
|
|
|
log.info("需要进行修改政策");
|
|
|
monitor.put("status", "修改政策");
|
|
|
- update(bigAirlineInfomation.getFormCity(), bigAirlineInfomation.getToCity(), bigAirlineInfomation.getFromDate(), flightNumbers.toString(), webAdultPrice_cny, bigAdultPrice_cny, bigPrice.getData().get("AdultQuotedPoints").toString(), config, scPolicyService, triptoCustomAddpriceService);
|
|
|
+ update(bigAirlineInfomation.getFormCity(), bigAirlineInfomation.getToCity(), bigAirlineInfomation.getFromDate(), flightNumbers.toString(), webAdultPrice_cny, bigAdultPrice_cny, bigPrice.getData().get("AdultQuotedPoints").toString(), config,bigPrice.getMaxSeats(), scPolicyService, triptoCustomAddpriceService);
|
|
|
|
|
|
|
|
|
} else {
|
|
|
//修改状态为失效
|
|
|
log.info("需要进行修改状态为失效");
|
|
|
monitor.put("status", "设置失效");
|
|
|
- updateStatus(bigAirlineInfomation.getFormCity(), bigAirlineInfomation.getToCity(), bigAirlineInfomation.getFromDate(), flightNumbers.toString(), config, scPolicyService, triptoCustomAddpriceService);
|
|
|
+ updateStatus(bigAirlineInfomation.getFormCity(), bigAirlineInfomation.getToCity(), bigAirlineInfomation.getFromDate(), flightNumbers.toString(), webAdultPrice_cny, bigAdultPrice_cny, bigPrice.getData().get("AdultQuotedPoints").toString(), config,bigPrice.getMaxSeats(), scPolicyService, triptoCustomAddpriceService);
|
|
|
}
|
|
|
monitors.add(monitor);
|
|
|
}
|
|
@@ -363,8 +369,9 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
* @param totalPoint
|
|
|
* @param config
|
|
|
* @param scPolicyService
|
|
|
+ * @param maxSears 座位数
|
|
|
*/
|
|
|
- public void update(String formCity, String toCity, String fromDate, String allFlightNumber, BigDecimal webCNY, BigDecimal bigCNY, String totalPoint, Config config, ScPolicyService scPolicyService, TriptoCustomAddpriceService triptoCustomAddpriceService) {
|
|
|
+ public void update(String formCity, String toCity, String fromDate, String allFlightNumber, BigDecimal webCNY, BigDecimal bigCNY, String totalPoint, Config config,Integer maxSears, ScPolicyService scPolicyService, TriptoCustomAddpriceService triptoCustomAddpriceService) {
|
|
|
|
|
|
|
|
|
try {
|
|
@@ -385,19 +392,22 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
scPolicy.setFlightNumberLimitType(1);
|
|
|
|
|
|
|
|
|
- scPolicy.setOriginalPrice(webCNY);
|
|
|
+
|
|
|
scPolicy.setLowPrice(new BigDecimal(10));
|
|
|
scPolicy.setUpPrice(new BigDecimal(99999999));
|
|
|
scPolicy.setAdjustType("0");
|
|
|
- scPolicy.setFinalPrice(new BigDecimal(bigCNY.intValue() + config.getAddPrice()));
|
|
|
- scPolicy.setFileNo("积分自维");
|
|
|
+
|
|
|
+ scPolicy.setStatus(3);
|
|
|
scPolicy.setAddOrSubtractMoney("0");
|
|
|
scPolicy.setAddTime(DateUtil.getFormatDate(new Date(), DatePattren.TIME_FORMAT));
|
|
|
scPolicy.setScore(String.valueOf(bigCNY.doubleValue()));
|
|
|
+ scPolicy.setFileNo("积分自维");
|
|
|
+ scPolicy.setOriginalPrice(webCNY);
|
|
|
scPolicy.setPolicySource("point");
|
|
|
scPolicy.setCabinScope("0");
|
|
|
- scPolicy.setStatus(3);
|
|
|
+ scPolicy.setFinalPrice(new BigDecimal(bigCNY.intValue() + config.getAddPrice()));
|
|
|
scPolicy.setBigScore(totalPoint);
|
|
|
+ scPolicy.setBigSeatCount(maxSears);
|
|
|
logger.info(SysLogger.builder().logFilePath("log").isCreateFile(true).name("add_old_policy").message(JSONObject.toJSONString(scPolicy)).build());
|
|
|
scPolicyService.updateByPrimaryKeySelective(scPolicy);
|
|
|
log.info("新政策表开始更新,更新参数为-->{}", JSON.toJSONString(scPolicy));
|
|
@@ -411,11 +421,7 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
try {
|
|
|
//插入新的政策表
|
|
|
TriptoCustomAddprice triptoCustomAddprice = new TriptoCustomAddprice();
|
|
|
- triptoCustomAddprice.setName("system");
|
|
|
- triptoCustomAddprice.setFilename("积分自维"); //文件编号
|
|
|
- triptoCustomAddprice.setPlatform("ltd/lqe/tuniu/meituan/tongcheng/ali");//
|
|
|
- triptoCustomAddprice.setEnable(3);//1 有;效 0 无效 3 挂起
|
|
|
- triptoCustomAddprice.setMethod("AKNEW");
|
|
|
+
|
|
|
triptoCustomAddprice.setDptAirport(formCity);
|
|
|
triptoCustomAddprice.setArrAirport(toCity);
|
|
|
triptoCustomAddprice.setFlyStartday(fromDate);
|
|
@@ -423,24 +429,34 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
triptoCustomAddprice.setFlightNo(allFlightNumber);
|
|
|
|
|
|
List<TriptoCustomAddprice> triptoCustomAddprices = triptoCustomAddpriceService.listPageTriptoCustomAddprice(triptoCustomAddprice);
|
|
|
+
|
|
|
+ log.info("旧政策表查询到的条数--》{},参数为-=->{}",triptoCustomAddprices.size(),JSON.toJSONString(triptoCustomAddprice));
|
|
|
if (triptoCustomAddprices != null && triptoCustomAddprices.size() > 0) {
|
|
|
+
|
|
|
Integer id = triptoCustomAddprices.get(0).getId();
|
|
|
+// triptoCustomAddprice.setName("system");
|
|
|
+// triptoCustomAddprice.setPlatform("ltd/lqe/tuniu/meituan/tongcheng/ali");//
|
|
|
+// triptoCustomAddprice.setMethod("AKNEW");
|
|
|
+ System.out.println("triptoCustomAddpricesId ---"+triptoCustomAddprices);
|
|
|
+ triptoCustomAddprice.setEnable(3);//1 有;效 0 无效 3 挂起
|
|
|
triptoCustomAddprice.setExcludeFlyStartday("");
|
|
|
triptoCustomAddprice.setExcludeFlyEndday("");
|
|
|
triptoCustomAddprice.setFlightNoStatus(2);//1,适用 2,排除 3,全部
|
|
|
|
|
|
triptoCustomAddprice.setIsSalePrice(1);//1 固定价格 2 区间价
|
|
|
- triptoCustomAddprice.setSalePrice(Double.valueOf(bigCNY.intValue() + config.getAddPrice()));//销售价格
|
|
|
triptoCustomAddprice.setAddPrice(0);//加减钱
|
|
|
triptoCustomAddprice.setAddPricePercent(0.0);//调整百分比
|
|
|
- triptoCustomAddprice.setWebrmbPrice(webCNY.doubleValue());//官网人民币总参考价格
|
|
|
- triptoCustomAddprice.setBigrmbPrice(bigCNY.doubleValue());//积分人民币总参考价格
|
|
|
triptoCustomAddprice.setPriceDifference(0.0);//差价参考
|
|
|
triptoCustomAddprice.setPriceFrom(0.0);
|
|
|
triptoCustomAddprice.setPriceTo(0.0);
|
|
|
triptoCustomAddprice.setPriceRange(0.0);
|
|
|
triptoCustomAddprice.setPricePercent(0.0);
|
|
|
-
|
|
|
+ triptoCustomAddprice.setId(id);
|
|
|
+ triptoCustomAddprice.setSalePrice(Double.valueOf(bigCNY.intValue() + config.getAddPrice()));//销售价格
|
|
|
+ triptoCustomAddprice.setFilename("积分自维"); //文件编号
|
|
|
+ triptoCustomAddprice.setWebrmbPrice(webCNY.doubleValue());//官网人民币总参考价格
|
|
|
+ triptoCustomAddprice.setBigrmbPrice(bigCNY.doubleValue());//积分人民币总参考价格
|
|
|
+ triptoCustomAddprice.setBigSeatCount(maxSears);
|
|
|
triptoCustomAddprice.setModifytime(DateUtil.getFormatDate(new Date(), DatePattren.TIME_FORMAT));
|
|
|
triptoCustomAddprice.setMark("bigapp积分:" + totalPoint);
|
|
|
logger.info(SysLogger.builder().logFilePath("log").isCreateFile(true).name("add_new_policy").message(JSONObject.toJSONString(triptoCustomAddprice)).build());
|
|
@@ -460,7 +476,7 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
/**
|
|
|
* 修改状态
|
|
|
*/
|
|
|
- public void updateStatus(String formCity, String toCity, String fromDate, String allFlightNumber, Config config, ScPolicyService scPolicyService, TriptoCustomAddpriceService triptoCustomAddpriceService) {
|
|
|
+ public void updateStatus(String formCity, String toCity, String fromDate, String allFlightNumber, BigDecimal webCNY, BigDecimal bigCNY, String totalPoint, Config config,Integer maxSears,ScPolicyService scPolicyService, TriptoCustomAddpriceService triptoCustomAddpriceService) {
|
|
|
try {
|
|
|
ScPolicy scPolicy = new ScPolicy();
|
|
|
scPolicy.setAirSourceGroupId(1);
|
|
@@ -476,6 +492,15 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
scPolicy.setId(id);
|
|
|
scPolicy.setFileNo("积分自维");
|
|
|
scPolicy.setStatus(0);
|
|
|
+ scPolicy.setAddTime(DateUtil.getFormatDate(new Date(), DatePattren.TIME_FORMAT));
|
|
|
+ scPolicy.setScore(String.valueOf(bigCNY.doubleValue()));
|
|
|
+ scPolicy.setFileNo("积分自维");
|
|
|
+ scPolicy.setOriginalPrice(webCNY);
|
|
|
+ scPolicy.setPolicySource("point");
|
|
|
+ scPolicy.setCabinScope("0");
|
|
|
+ scPolicy.setFinalPrice(new BigDecimal(bigCNY.intValue() + config.getAddPrice()));
|
|
|
+ scPolicy.setBigScore(totalPoint);
|
|
|
+ scPolicy.setBigSeatCount(maxSears);
|
|
|
logger.info(SysLogger.builder().logFilePath("log").isCreateFile(true).name("add_old_policy").message(JSONObject.toJSONString(scPolicy)).build());
|
|
|
scPolicyService.updateByPrimaryKeySelective(scPolicy);
|
|
|
log.info("新政策表状态开始更新,更新参数为-->{}", JSON.toJSONString(scPolicy));
|
|
@@ -489,11 +514,7 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
try {
|
|
|
//插入新的政策表
|
|
|
TriptoCustomAddprice triptoCustomAddprice = new TriptoCustomAddprice();
|
|
|
- triptoCustomAddprice.setName("system");
|
|
|
- triptoCustomAddprice.setFilename("积分自维"); //文件编号
|
|
|
- triptoCustomAddprice.setPlatform("ltd/lqe/tuniu/meituan/tongcheng/ali");//
|
|
|
- triptoCustomAddprice.setEnable(0);//1 有;效 0 无效 3 挂起
|
|
|
- triptoCustomAddprice.setMethod("AKNEW");
|
|
|
+
|
|
|
triptoCustomAddprice.setDptAirport(formCity);
|
|
|
triptoCustomAddprice.setArrAirport(toCity);
|
|
|
triptoCustomAddprice.setFlyStartday(fromDate);
|
|
@@ -504,7 +525,17 @@ public class SmallAirLineServiceImpl implements SmallAirLineService {
|
|
|
if (triptoCustomAddprices != null && triptoCustomAddprices.size() > 0) {
|
|
|
Integer id = triptoCustomAddprices.get(0).getId();
|
|
|
triptoCustomAddprice.setId(id);
|
|
|
-
|
|
|
+ triptoCustomAddprice.setEnable(0);//1 有;效 0 无效 3 挂起
|
|
|
+ triptoCustomAddprice.setName("system");
|
|
|
+ triptoCustomAddprice.setPlatform("ltd/lqe/tuniu/meituan/tongcheng/ali");//
|
|
|
+ triptoCustomAddprice.setMethod("AKNEW");
|
|
|
+ triptoCustomAddprice.setSalePrice(Double.valueOf(bigCNY.intValue() + config.getAddPrice()));//销售价格
|
|
|
+ triptoCustomAddprice.setFilename("积分自维"); //文件编号
|
|
|
+ triptoCustomAddprice.setWebrmbPrice(webCNY.doubleValue());//官网人民币总参考价格
|
|
|
+ triptoCustomAddprice.setBigrmbPrice(bigCNY.doubleValue());//积分人民币总参考价格
|
|
|
+ triptoCustomAddprice.setBigSeatCount(maxSears);
|
|
|
+ triptoCustomAddprice.setModifytime(DateUtil.getFormatDate(new Date(), DatePattren.TIME_FORMAT));
|
|
|
+ triptoCustomAddprice.setMark("bigapp积分:" + totalPoint);
|
|
|
logger.info(SysLogger.builder().logFilePath("log").isCreateFile(true).name("add_new_policy").message(JSONObject.toJSONString(triptoCustomAddprice)).build());
|
|
|
triptoCustomAddpriceService.updateByPrimaryKeySelective(triptoCustomAddprice);
|
|
|
|