Compare commits

...

4 Commits

  1. 39
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 4
      bweb/src/main/java/com/bweb/controller/goods/GoodsTypeController.java
  3. 4
      cweb/src/main/java/com/cweb/controller/CommonController.java
  4. 29
      cweb/src/main/java/com/cweb/controller/discount/DiscountController.java
  5. 1
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  6. 32
      order/src/main/java/com/order/controller/OrderController.java
  7. 3
      order/src/main/java/com/order/controller/notify/CqNotifyController.java
  8. 16
      service/src/main/java/com/hfkj/common/utils/DateUtil.java
  9. 12
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  10. 2
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  11. 5
      service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java
  12. 6
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  13. 4
      service/src/main/java/com/hfkj/sysenum/order/OrderCouponNoStatusEnum.java

@ -30,6 +30,7 @@ import com.hfkj.service.pay.huift.TradeService;
import com.jd.open.api.sdk.domain.vopsp.CategoryInfoGoodsProvider.response.getCategoryInfoList.GetCategoryInfoGoodsResp;
import com.jd.open.api.sdk.domain.vopsp.SkuInfoGoodsProvider.response.getSkuDetailInfo.GetSkuPoolInfoGoodsResp;
import com.jd.open.api.sdk.domain.vopxx.MsgRecordProvider.response.queryTransByVopNormal.VopBizTransMessage;
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryOrderDetailResponse;
import com.jd.open.api.sdk.response.vopdz.VopAddressConvertFourAreaByDetailStrResponse;
import com.jd.open.api.sdk.response.vopxx.VopMessageQueryTransByVopNormalResponse;
import io.swagger.annotations.Api;
@ -170,7 +171,45 @@ public class TestController {
}
}
@RequestMapping(value="/queryOrderDetailByJd",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "queryOrderDetailByJd")
public ResponseData queryOrderDetailByJd(@RequestParam(value = "childOrderNo" , required = true) String childOrderNo,
@RequestParam(value = "thirdOrderNo" , required = true) Long thirdOrderNo) {
try {
VopOrderQueryOrderDetailResponse orderDetailResponse = JdPostService.queryOrderDetail(jdService.getToken(),thirdOrderNo, childOrderNo);
return ResponseMsgUtil.success(orderDetailResponse);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@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="/getSkuDetailInfo",method = RequestMethod.GET)
@ResponseBody

@ -87,8 +87,10 @@ public class GoodsTypeController {
public ResponseData getList() {
try {
Map<String , Object> map = new HashMap<>();
map.put("status" , 1);
List<GoodsType> list = goodsTypeService.getList(new HashMap<>());
List<GoodsType> list = goodsTypeService.getList(map);
List<GoodsTypeModel> goodsTypeModels = goodsTypeService.getGoodsTypeModelList(list);

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsOrderGoods;
@ -66,7 +67,8 @@ public class CommonController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message"));
}
*/
JSONObject refundObj = HuiLianTongUnionCardService.refund("R241202115359997", "241130223414212711");
String refundOrderNo = "R" + DateUtil.date2String(new Date(), DateUtil.YMDHMS);
JSONObject refundObj = HuiLianTongUnionCardService.refund(refundOrderNo, "241227092905479836");
if (!refundObj.getString("respCode").equals("0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage"));
}

@ -9,6 +9,7 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.haioil.HaiOilService;
@ -147,23 +148,37 @@ public class DiscountController {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
int num = 0;
Map<String , Object> map = new HashMap<>();
map.put("status" , 1);
map.put("phone" , userSession.getUser().getPhone());
JSONObject object = HaiOilService.queryListByPhone(map);
int num = 0;
if (object.getString("return_code").equals("000000")) {
JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList");
num += array.size();
if (userSession.getUser().getPhone() != null) {
map.put("status" , 1);
map.put("phone" , userSession.getUser().getPhone());
JSONObject object = HaiOilService.queryListByPhone(map);
if (object.getString("return_code").equals("000000")) {
JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList");
num += array.size();
}
}
map.put("userId", userSession.getUser().getId());
map.put("status", 1);
List<CouponDiscountUserRel> list = discountUserRelService.getList(map);
for (CouponDiscountUserRel discountUserRel : list) {
if (DateUtil.exceedingCurrentTime(discountUserRel.getUseEndTime())) {
num++;
} else {
discountUserRel.setStatus(0);
discountUserRelService.update(discountUserRel);
}
}
num += list.size();
return ResponseMsgUtil.success(num);

@ -71,7 +71,6 @@ public class GoodsController {
try {
Map<String ,Object> map = new HashMap<>();
map.put("status" , 1);
map.put("type" , type);
List<GoodsType> list = goodsTypeService.getList(map);

@ -364,22 +364,22 @@ public class OrderController {
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId"));
if (userAddress.getProvinceId() == null) {
// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
//
// if (response != null && response.getOpenRpcResult().getSuccess()) {
// userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
// userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
// userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
// userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
// userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
// userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
// userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
// userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
// userAddress.setUpdateTime(new Date());
// deliveryAddressService.update(userAddress);
// } else {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
// }
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
if (response != null && response.getOpenRpcResult().getSuccess()) {
userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
userAddress.setUpdateTime(new Date());
deliveryAddressService.update(userAddress);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
}
}
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();

@ -9,6 +9,7 @@ import com.hfkj.entity.BsOrderCoupon;
import com.hfkj.entity.BsOrderCouponNo;
import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.channel.ChongQingCNPCCouponService;
import com.hfkj.sysenum.order.OrderCouponNoStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -52,7 +53,7 @@ public class CqNotifyController {
BsOrderCouponNo coupon = orderCouponNoService.getDetailByCouNo(body.getString("couponNo"));
if (coupon != null) {
coupon.setFinishTime(DateUtil.format(body.getString("useTime"), "yyyyMMddHHmmss"));
coupon.setStatus(40);
coupon.setStatus(OrderCouponNoStatusEnum.status3.getCode());
orderCouponNoService.editData(coupon);
}

@ -781,6 +781,22 @@ public class DateUtil {
}
}
public static boolean exceedingCurrentTime(Date time) {
// 获取当前时间
Date currentDate = new Date();
// 判断时间是否大于当前时间
Calendar calendar1 = Calendar.getInstance();
calendar1.setTime(currentDate);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTime(time);
// 时间大于当前时间 为true
return calendar1.compareTo(calendar2) < 0;
}
public static void main(String[] args) throws Exception {
String a = "51130319931105651X";

@ -67,6 +67,7 @@ public interface GoodsMsgMapperExt {
" a.goods_brand_name as goodsBrandName," +
" a.title as title," +
" a.list_img as listImg," +
" a.sale_num as saleNum," +
" b.sale_price as salePrice, " +
" b.sale_price as price, " +
" b.third_price as thirdPrice," +
@ -85,12 +86,13 @@ public interface GoodsMsgMapperExt {
" <if test='param.showType != null'> and a.show_type = #{param.showType} </if>" +
" <if test='param.specsId != null'> and b.id in <foreach collection='param.specsId' item='item' index='index' open='(' separator=',' close=')'>#{item}</foreach> </if>" +
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.price == 1'>b.sale_price asc</if>" +
" <if test='param.price == 2'> b.sale_price desc</if>" +
" <if test='param.saleNum == 2'>, a.sale_num desc</if>" +
" group by a.id) c" +
" <if test='param.time != 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 1'>ORDER BY c.createtime desc</if>" +
" <if test='param.time == 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 2'>ORDER BY c.createtime asc</if>" +
" <if test='param.price == 1'>ORDER BY c.salePrice asc</if>" +
" <if test='param.price == 2'>ORDER BY c.salePrice desc</if>" +
" <if test='param.saleNum == 2'>ORDER BY c.saleNum desc</if>" +
" <if test='param.limit != null'>limit #{param.limit}</if>" +
"</script>")
List<JdGoodsModel> getGoodsListCrest(@Param("param") Map<String,Object> param);

@ -315,7 +315,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
}
@Override
public void confirmReceipt(Long orderGoodsId) {
public void confirmReceipt(Long orderGoodsId){
BsOrderGoods orderGoods = queryDetail(orderGoodsId);
if (orderGoods == null ||

@ -263,10 +263,7 @@ public class HuiLianTongUnionCardService {
public static void main(String[] args) {
// {"respMessage":"ok","data":"Gbkl57c3fEBg+E3HfPuQ580JLkHaQPyf1P7My1oYOyJSIG4i8jYxovGVk4V8Rk58mjDswB8Vpy4E\nyj/wi/UNr8TDne094+yu","sign":"47186141FD8B3FB6CCB590F58321D9C6","respCode":"0000","responseId":"1669202185936"}
String data = "Gbkl57c3fEBg+E3HfPuQ55SDLVyAf2Ys3VN1cifAfXIoT1gnbFR0NaiH/z1OIZZiuqlFwDLLu6n4\n" +
"VBkM8fF5jVEekFNLY57NgRfRr4BghKXdIr8hdPJnbfOO0VtjITPrrZWwMDwfYzJulYhBsNGCubov\n" +
"9ruAA0DN0ESoH765nvlH0lI/wdIOvRE7GyTfQzzT68i5p+Qf/k7yjQk22l4KUfuUVM+jMeW95xkd\n" +
"+gVJvWctjBC0DN3zi3CwsVgQwVmj".replace("\\n", "");
String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDwYfnUdBVz6Kj4HS2oCA1TTiqJkCUIYa5M\\n0DolwI0hl/U9NjehIajUMe64vH0PKpI1unzlti6JHq4/oosfPQ2lZVTKIzmRUpEIJz5eUldEn7PO\\nqPXMaPa2paLHY8bLUjlMX6HWbBULM4rXikZhIGa4iRp4RUprEFQ=".replace("\\n", "");
String decodeData = DesUtil.decode(HLT_CARD_SIGN_CODE, data, Charset.forName("UTF-8"));
System.out.println(JSONObject.parseObject(decodeData));

@ -372,7 +372,10 @@ public class BsOrderServiceImpl implements BsOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券");
}
if (discountUserRel.getStatus() != 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态不处于待使用");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已失效");
}
if (new Date().compareTo(discountUserRel.getUseEndTime()) >= 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已过期,无法使用");
}
discountUserRel.setStatus(2);
discountUserRel.setUseTime(new Date());
@ -703,7 +706,6 @@ public class BsOrderServiceImpl implements BsOrderService {
totalSalePrice = totalSalePrice.add(jsonObject.getBigDecimal("salePrice"));
totalDrawModePrice = totalDrawModePrice.add(jsonObject.getBigDecimal("fastDrawModePrice"));
}
}
}
}

@ -31,6 +31,10 @@ public enum OrderCouponNoStatusEnum {
* 已退款
*/
status4(4, "已过期"),
/**
* 已退款
*/
status5(5, "已退款"),
;
private final int code;

Loading…
Cancel
Save