|
|
|
@ -58,9 +58,6 @@ import java.util.stream.Collectors; |
|
|
|
|
public class TestController { |
|
|
|
|
private static Logger log = LoggerFactory.getLogger(TestController.class); |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private TradeService huiftTradeService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderGoodsService orderGoodsService; |
|
|
|
|
|
|
|
|
@ -73,24 +70,6 @@ public class TestController { |
|
|
|
|
@Resource |
|
|
|
|
private CmsContentService cmsContentService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderRefundService orderRefundService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询V家园订单交易状态") |
|
|
|
|
public ResponseData thirdPayResult(@RequestParam(value = "preOrderNo" , required = true) String preOrderNo, |
|
|
|
|
@RequestParam(value = "shopCode" , required = true) String shopCode, |
|
|
|
|
@RequestParam(value = "signSecret" , required = true) String signSecret) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(huiftTradeService.thirdPayResult(preOrderNo,shopCode,signSecret)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET) |
|
|
|
@ -134,89 +113,7 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/confirmReceipt",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "订单完成") |
|
|
|
|
public ResponseData confirmReceipt() { |
|
|
|
|
try { |
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
map.put("logisticsStatus" , "SIGN"); |
|
|
|
|
map.put("status" , 2); |
|
|
|
|
|
|
|
|
|
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(map); |
|
|
|
|
|
|
|
|
|
for (BsOrderGoods goods : orderGoodsList) { |
|
|
|
|
|
|
|
|
|
// 判断时间是否是十天前
|
|
|
|
|
|
|
|
|
|
if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) { |
|
|
|
|
orderGoodsService.confirmReceipt(goods.getId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success("成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/orderGoodsConfirmReceiptAgent",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "订单完成") |
|
|
|
|
public ResponseData orderGoodsConfirmReceiptAgent() { |
|
|
|
|
try { |
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
map.put("logisticsStatus" , "SIGN"); |
|
|
|
|
map.put("status" , 2); |
|
|
|
|
|
|
|
|
|
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(map); |
|
|
|
|
|
|
|
|
|
for (BsOrderGoods goods : orderGoodsList) { |
|
|
|
|
|
|
|
|
|
// 判断时间是否是十天前
|
|
|
|
|
|
|
|
|
|
if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) { |
|
|
|
|
orderGoodsService.confirmReceipt(goods.getId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success("成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/refundMovieOrder",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "refundMovieOrder") |
|
|
|
|
public ResponseData refundMovieOrder(@RequestParam(value = "orderNo" , required = true) String orderNo, |
|
|
|
|
@RequestParam(value = "payRealPrice" , required = true) BigDecimal payRealPrice, |
|
|
|
|
@RequestParam(value = "cardNo" , required = true) String cardNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 工会卡支付
|
|
|
|
|
JSONObject consumption = HuiLianTongUnionCardService.consumption(orderNo, cardNo, payRealPrice, "HiSen_phg_goods", "11101667", "", "250122151032399686订单扣款"); |
|
|
|
|
if (!consumption.getString("respCode").equals("0000")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); |
|
|
|
|
} |
|
|
|
|
// 响应参数
|
|
|
|
|
JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data")); |
|
|
|
|
if (consumptionResult.getBoolean("success") != true) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(consumptionResult); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryOrderDetailByJd",method = RequestMethod.GET) |
|
|
|
@ -258,24 +155,7 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/checkSkuSale",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "京东商品价格更新") |
|
|
|
|
public ResponseData checkSkuSale() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
List<GoodsMsg> list = goodsMsgService.getJdList(); |
|
|
|
|
|
|
|
|
|
for (GoodsMsg goods : list) { |
|
|
|
|
jdService.checkSkuSale(goods); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryDeliveryInfoByjd",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -310,26 +190,7 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/sign",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "sign") |
|
|
|
|
public ResponseData sign(@RequestParam(value = "phone" , required = true) String phone, |
|
|
|
|
@RequestParam(value = "appid" , required = true) String appid, |
|
|
|
|
@RequestParam(value = "appSecret" , required = true) String appSecret) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("appid" , appid); |
|
|
|
|
map.put("phone" , phone); |
|
|
|
|
String sign = SignatureUtil.createSign(map , appSecret); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(sign); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/automaticData",method = RequestMethod.GET) |
|
|
|
@ -412,38 +273,6 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/updateGoodsMsg",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "更新商品") |
|
|
|
|
public ResponseData updateGoodsMsg(@RequestParam(value = "skuId", required = false) Long skuId) { |
|
|
|
|
try { |
|
|
|
|
jdService.updateGoodsMsg(skuId); |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/confirmOrder",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "确认订单") |
|
|
|
|
public ResponseData confirmOrder() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
JdPostService.confirmOrder(jdService.getToken() , 304301646288L, "945024316" , "确认订单"); |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryHltBalance",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -463,103 +292,12 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/refundPk",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "退回优惠券包") |
|
|
|
|
public ResponseData refundPk( |
|
|
|
|
@RequestParam(value = "discountPkStockCode", required = false) String discountPkStockCode) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("discountPkStockCode" , discountPkStockCode); |
|
|
|
|
JSONObject returnParam = HaiOilService.refundPk(map); |
|
|
|
|
return ResponseMsgUtil.success(returnParam); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryPkDetailByStockCode",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询券包使用情况") |
|
|
|
|
public ResponseData queryPkDetailByStockCode(@RequestParam(value = "discountPkStockCode", required = false) String discountPkStockCode) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("discountPkStockCode" , discountPkStockCode); |
|
|
|
|
JSONObject returnParam = HaiOilService.queryPkDetailByStockCode(map); |
|
|
|
|
return ResponseMsgUtil.success(returnParam); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/pushPk",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "pushPk") |
|
|
|
|
public ResponseData pushPk() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
// 推送给嗨加油
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("discountPkNo" , "DPK10004"); |
|
|
|
|
map.put("number" , 1); |
|
|
|
|
map.put("phone" , "18090580471"); |
|
|
|
|
JSONObject returnParam = HaiOilService.pushPk(map); |
|
|
|
|
JSONArray dataArray = returnParam.getJSONObject("return_data").getJSONArray("list"); |
|
|
|
|
BsOrderCouponNo couponNo = new BsOrderCouponNo(); |
|
|
|
|
couponNo.setExpireTime(dataArray.getJSONObject(0).getJSONArray("codeList").getJSONObject(0).getDate("expirationDate")); |
|
|
|
|
couponNo.setDeliverTime(new Date()); |
|
|
|
|
couponNo.setChannelOrderNo(returnParam.getJSONObject("return_data").getString("reqId")); |
|
|
|
|
couponNo.setGoodsVpdSourceCouNo(dataArray.getJSONObject(0).getString("discountPkStockCode")); |
|
|
|
|
couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); |
|
|
|
|
return ResponseMsgUtil.success(couponNo); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/resolveResponse",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "resolveResponse") |
|
|
|
|
public ResponseData resolveResponse(@RequestParam(value = "data", required = false) String data) { |
|
|
|
|
try { |
|
|
|
|
JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(data); |
|
|
|
|
// orderRefundService.meiTuanRefund(
|
|
|
|
|
// "R"+DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(3, false) ,
|
|
|
|
|
// "1895338934767706172" ,
|
|
|
|
|
// new BigDecimal("56.14") ,
|
|
|
|
|
// "美团退款"
|
|
|
|
|
// );
|
|
|
|
|
return ResponseMsgUtil.success(consumptionResult); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/cancelOrder",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "cancelOrder") |
|
|
|
|
public ResponseData cancelOrder(@RequestParam(value = "thirdOrderNo", required = false) String thirdOrderNo, |
|
|
|
|
@RequestParam(value = "childOrderNo", required = false) String childOrderNo) { |
|
|
|
|
try { |
|
|
|
|
JdPostService.cancelOrder(jdService.getToken(), Long.valueOf(thirdOrderNo), childOrderNo , "取消订单!"); |
|
|
|
|
return ResponseMsgUtil.success("取消"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getOrderCancelProcessDetail",method = RequestMethod.GET) |
|
|
|
@ -575,18 +313,8 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/deleteMsg",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "deleteMsg") |
|
|
|
|
public ResponseData deleteMsg() { |
|
|
|
|
try { |
|
|
|
|
jdService.deleteMsg(); |
|
|
|
|
return ResponseMsgUtil.success("11"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|