瀏覽代碼

安卓端设备产品查询返回新加字段。

bruce 2 年之前
父節點
當前提交
2605c576f3

+ 24 - 37
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/AndroidApi.java

@@ -45,6 +45,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedReader;
@@ -64,55 +65,52 @@ import static com.github.zuihou.exception.code.ExceptionCode.SYSTEM_BUSY;
  */
 @RestController
 @RequestMapping("externalApi")
-public class AndroidApi {
-    @Autowired
+public class AndroidApi
+{
+    @Resource
     private GoodsService goodsService;
-    @Autowired
+    @Resource
     private OrderService orderService;
-
-    @Autowired
+    @Resource
     private WxPayCfg wxPayCfg;
-
-    @Autowired
+    @Resource
     private SpeService speService;
 
     @Value("${weixinconfig.accessTokenUrl}")
     private String accessTokenUrl;
-
     @Value("${weixinconfig.appid}")
     private String appId;
-
     @Value("${weixinconfig.appSecret}")
     private String secret;
-    @Autowired
+    @Resource
     private RedisTemplate<String, Object> redisTemplate;
-    @Autowired
+    @Resource
     private EquBarrelService barrelService;
-    @Autowired
+    @Resource
     private MiniAppService miniAppService;
-    @Autowired
+    @Resource
     private ProductionTenantResourceService productionTenantResourceService;
-    @Autowired
+    @Resource
     private WxPayService wxPayService;
-    @Autowired
+    @Resource
     private FormulaService formulaService;
-    @Autowired
+    @Resource
     private MemberService memberService;
 
-
     @ApiOperation("获取商品列表")
     @GetMapping({"/goodsList"})
-    public R<List<EquGoodsDto>> goodsList(@RequestParam(name = "equId", required = true) Long equId) {
+    public R<List<EquGoodsDto>> goodsList(@RequestParam(name = "equId") Long equId)
+    {
         BaseContextHandler.setTenant("0000");
         List<EquGoodsDto> equGoods = productionTenantResourceService.getEquGoods(equId);
         equGoods.forEach((item) ->
-                {
-                    QueryWrap<Spe> speQueryWrap = new QueryWrap<>();
-                    speQueryWrap.eq("goods_id", item.getGoodsId());
-                    List<Spe> list = speService.list(speQueryWrap);
-                    item.setSpeList(list);
-                }
-        );
+          {
+              QueryWrap<Spe> speQueryWrap = new QueryWrap<>();
+              speQueryWrap.eq("goods_id", item.getGoodsId());
+              List<Spe> list = speService.list(speQueryWrap);
+              item.setSpeList(list);
+          });
+
         return R.success(equGoods);
     }
 
@@ -128,7 +126,6 @@ public class AndroidApi {
 
     }
 
-
     @ApiOperation("下单接口")
     @PostMapping({"/getQrCode"})
     public R<Map<String, Object>> getQrCode(HttpServletResponse response, @RequestBody Map<String, Long> param) {
@@ -181,7 +178,6 @@ public class AndroidApi {
         return R.success(resultMap);
     }
 
-
     @ApiOperation("订单状态查询接口")
     @GetMapping({"/getOrder"})
     public R<Map<String, Object>> getOrder(@RequestParam(name = "orderId", required = true) Long orderId) {
@@ -267,7 +263,6 @@ public class AndroidApi {
         return R.success(resultMap);
     }
 
-
     //料筒查询接口
     @ApiOperation("料筒查询接口")
     @GetMapping({"/getBarrelList"})
@@ -283,7 +278,6 @@ public class AndroidApi {
 
     }
 
-
     //    小程序登录接口
     @ApiOperation("小程序登录接口")
     @PostMapping({"/miniAppLogin"})
@@ -295,7 +289,6 @@ public class AndroidApi {
         return memberR;
     }
 
-
     //    广告视频接口
     @ApiOperation("广告视频")
     @GetMapping({"/advVideo"})
@@ -310,7 +303,6 @@ public class AndroidApi {
         return R.success(resultMap);
     }
 
-
     /**
      * 微信支付通知
      * (通知频率为15s/15s/30s/3m/10m/20m/30m/30m/30m/60m/3h/3h/3h/6h/6h - 总计 24h4m)
@@ -414,7 +406,6 @@ public class AndroidApi {
         return returnMap;
     }
 
-
     //修改订单状态接口
 
     /**
@@ -467,7 +458,6 @@ public class AndroidApi {
         return R.success(update);
     }
 
-
     /**
      * 获取未绑定的设备列表
      *
@@ -486,7 +476,6 @@ public class AndroidApi {
         return R.success(list);
     }
 
-
     /**
      * 绑定,解绑,设备
      *
@@ -541,6 +530,4 @@ public class AndroidApi {
         redisTemplate.expire("wangyuanbo" + 123456789, 4, TimeUnit.SECONDS);
         return R.success(true, "成功");
     }
-
-
-}
+}

+ 22 - 21
imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/productionresource/ProductionresourceMapper.xml

@@ -86,28 +86,29 @@
         </collection>
     </resultMap>
 
-
     <select id="getEquGoods" resultType="com.github.zuihou.business.productionresource.dto.EquGoodsDto">
-        select eg.id              as id,
-               eg.equ_id          as equId,
-               eg.goods_id        as goodsId,
-               eg.ud_status       as udStatus,
-               IFNULL(eg.is_starving,'1')     as isStarving,
-               g.goods_cate_id    as goodsCateId,
-               g.goods_name       as goodsName,
-               g.goods_pic        as goodsPic,
-               g.goods_detail_pic as goodsDetailPic,
-               g.goods_code       as goodsCode,
-               g.goods_tag        as goodsTag,
-               g.goods_unit       as goodsUnit,
-               gc.goods_cate_name as goodsCateName
-        from bt_goods g
-                 left join bt_equ_goods eg
-                           on eg.goods_id = g.id
-                 left join bt_goods_cate gc on g.goods_cate_id = gc.id
-                 left join bt_spe s on s.goods_id = g.id
-        where eg.equ_id = #{equId}
-        Group by g.id
+      SELECT
+        eg.id              as id,
+        eg.equ_id          as equId,
+        eg.goods_id        as goodsId,
+        eg.ud_status       as udStatus,
+        IFNULL(eg.is_starving,'1')     as isStarving,
+        g.goods_cate_id    as goodsCateId,
+        g.goods_name       as goodsName,
+        g.goods_pic        as goodsPic,
+        g.goods_detail_pic as goodsDetailPic,
+        g.goods_code       as goodsCode,
+        g.goods_tag        as goodsTag,
+        g.goods_unit       as goodsUnit,
+        g.introduction,
+        gc.goods_cate_name as goodsCateName,
+        gc.goods_cate_describe AS goodsCateDescribe
+      FROM bt_goods g
+      LEFT JOIN bt_equ_goods eg ON eg.goods_id = g.id
+      LEFT JOIN bt_goods_cate gc ON g.goods_cate_id = gc.id
+      LEFT JOIN bt_spe s ON s.goods_id = g.id
+      WHERE eg.equ_id = #{equId}
+      GROUP BY g.id
     </select>
 
     <select id="getEquLockCount" resultType="Integer">

+ 13 - 11
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/EquGoodsDto.java

@@ -11,15 +11,11 @@ import java.util.List;
 /**
  * @author User
  */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@Accessors(chain = true)
-@ToString(callSuper = true)
-@EqualsAndHashCode(callSuper = false)
-@Builder
 @ApiModel(value = "EquGoodsDto", description = "设备上架商品")
-public class EquGoodsDto implements Serializable {
+@ToString(callSuper = true) @EqualsAndHashCode(callSuper = false)
+@Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true)
+public class EquGoodsDto implements Serializable
+{
     private static final long serialVersionUID = 1L;
     private Long id;
     private Long equId;
@@ -31,6 +27,10 @@ public class EquGoodsDto implements Serializable {
     private String goodsUnit;
     private Long goodsCateId;
     private String goodsCateName;
+    /**
+     * 分类描述
+     */
+    private String goodsCateDescribe;
     private String goodsTag;
     private Long realViews;
     private Long realSales;
@@ -43,6 +43,8 @@ public class EquGoodsDto implements Serializable {
      * 是否缺料  0缺料1正常
      */
     private String isStarving;
-
-
-}
+    /**
+     * 产品简介
+     */
+    private String introduction;
+}