记得上下班打卡 | git大法好,push需谨慎

Commit a3ade554 authored by 张国柄's avatar 张国柄

~opt;

parent daf529a8
...@@ -84,13 +84,13 @@ public class GoblinFrontController { ...@@ -84,13 +84,13 @@ public class GoblinFrontController {
return ResponseDto.success(vo); return ResponseDto.success(vo);
} }
@GetMapping("getGoodsDetail2") @GetMapping("getGoodsDetail/scanner")
@ApiOperation(value = "获得商品详情2", notes = "条码识别SKU时使用") @ApiOperation(value = "获得商品详情/条形码识别", notes = "条码识别SKU时使用")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuCode", value = "SKU条码"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuCode", value = "SKU条码"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id"),
}) })
public ResponseDto<GoblinFrontGoodDetailVo> getGoodsDetail2(@RequestParam(name = "skuCode") String skuNo, @RequestParam("marketId") String marketId) { public ResponseDto<GoblinFrontGoodDetailVo> getGoodsDetailByScanner(@RequestParam String skuCode, @RequestParam("marketId") String marketId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid); GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (storeInfoVo == null) { if (storeInfoVo == null) {
...@@ -98,14 +98,14 @@ public class GoblinFrontController { ...@@ -98,14 +98,14 @@ public class GoblinFrontController {
} }
GoblinFrontGoodDetailVo vo; GoblinFrontGoodDetailVo vo;
try { try {
vo = goblinFrontService.getGoodsDetail2(skuNo, storeInfoVo.getStoreId(), marketId); vo = goblinFrontService.getGoodsDetailByScanner(skuCode, storeInfoVo.getStoreId(), marketId);
if (vo == null) { if (vo == null) {
return ResponseDto.failure("商品不存在"); return ResponseDto.failure("商品不存在");
} }
} catch (LiquidnetServiceException e) { } catch (LiquidnetServiceException e) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
} catch (Exception e) { } catch (Exception e) {
log.error("Ex.扫条码识别商品:发生异常[skuNo={},marketId={}]", skuNo, marketId, e); log.error("Ex.扫条码识别商品:发生异常[skuCode={},marketId={}]", skuCode, marketId, e);
return ResponseDto.failure("识别失败"); return ResponseDto.failure("识别失败");
} }
return ResponseDto.success(vo); return ResponseDto.success(vo);
......
...@@ -351,8 +351,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -351,8 +351,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
/** /**
* 根据条码获得商品详情 * 根据条码获得商品详情
*/ */
public GoblinFrontGoodDetailVo getGoodsDetail2(String skuNo, String storeId, String marketId) { public GoblinFrontGoodDetailVo getGoodsDetailByScanner(String skuCode, String storeId, String marketId) {
Criteria skuCriteria = Criteria.where("delFlg").is("0").and("storeId").is(storeId).and("skuNo").is(skuNo); Criteria skuCriteria = Criteria.where("delFlg").is("0").and("storeId").is(storeId).and("skuNo").is(skuCode);
Query skuQuery = Query.query(skuCriteria); Query skuQuery = Query.query(skuCriteria);
skuQuery.fields().include("spuId").include("skuId"); skuQuery.fields().include("spuId").include("skuId");
List<GoblinGoodsSkuInfoVo> skuQueryResultList = mongoTemplate.find(skuQuery, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName()); List<GoblinGoodsSkuInfoVo> skuQueryResultList = mongoTemplate.find(skuQuery, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment