Переглянути джерело

二级市场收购商发布需求列表修改

linbl 2 роки тому
батько
коміт
86f0a18ba0

+ 1 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/AppTbGoodsDemandController.java

@@ -99,9 +99,8 @@ public class AppTbGoodsDemandController {
      * app端:二级收购商查看需求发布列表(包括报价信息)
      */
     @RequestMapping("goodsDemandDetail")
-    public AjaxJson goodsDemandDetail(Long id) {
+    public AjaxJson goodsDemandDetail() {
         SoMap so = SoMap.getRequestSoMap();
-        so.put("id", id);
         GoodsDemandVo goodsDemandVos = tbGoodsDemandService.goodsDemandList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), goodsDemandVos);
     }

+ 22 - 12
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/MethodGoodsDemandService.java

@@ -52,29 +52,39 @@ public class MethodGoodsDemandService {
 
             //获取需求表ID
             Long id = item.getId();
+            so.delete("id");
             //查询报价表
             so.put("demandId",id);
             //报价结果[0=待确认,1=确认,2=拒绝]
             so.put("quotationResult",1);
             so.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
             List<TbDemandQuotation> tbDemandQuotations = tbDemandQuotationMapper.getList(so);
-            if(tbDemandQuotations.size() == 0)return;
-            //查询商品基本信息
-            TbDemandQuotation tbDemandQuotation = tbDemandQuotations.get(0);
-            GoodsDto goodsDto = levelOneServerInterface.getByGoodsId(item.getLevelOneGoodsId());
+
             //开始封装数据
             GoodsDemandVo goodsDemandVo = new GoodsDemandVo();
+
+            //查询商品基本信息
+            GoodsDto goodsDto = levelOneServerInterface.getByGoodsId(item.getLevelOneGoodsId());
+            // TODO: 2023/8/8 获取商品图片暂时不需要
+            //goodsDemandVo.setGoodsImg(goodsDto.getAvatar());
+
             goodsDemandVo.setGoodsDemandId(id);
-            goodsDemandVo.setDemandQuotationId(tbDemandQuotation.getId());
-            goodsDemandVo.setGoodsImg(goodsDto.getAvatar());
-            goodsDemandVo.setGoodsName(goodsDto.getName());
-            goodsDemandVo.setGroupName(item.getGoodsName());
-            goodsDemandVo.setCreateName(tbDemandQuotation.getCreateName());
-            goodsDemandVo.setCreateTime(tbDemandQuotation.getCreateTime());
-            goodsDemandVo.setQuotation(tbDemandQuotation.getQuotation());
-            goodsDemandVo.setRemark(tbDemandQuotation.getRemark());
             goodsDemandVo.setGoodsQuantity(item.getGoodsQuantity());
             goodsDemandVo.setGoodsDemandTime(item.getCreateTime());
+            goodsDemandVo.setGoodsName(item.getGoodsName());
+            goodsDemandVo.setIsOrders(item.getIsOrders());
+
+            // 获取收购商发布需求中,关联的已确认的报价信息
+            if(tbDemandQuotations.size() > 0) {
+                TbDemandQuotation tbDemandQuotation = tbDemandQuotations.get(0);
+                goodsDemandVo.setDemandQuotationId(tbDemandQuotation.getId());
+                goodsDemandVo.setCreateName(tbDemandQuotation.getCreateName());
+                goodsDemandVo.setCreateTime(tbDemandQuotation.getCreateTime());
+                goodsDemandVo.setQuotation(tbDemandQuotation.getQuotation());
+                goodsDemandVo.setRemark(tbDemandQuotation.getRemark());
+                goodsDemandVo.setGroupName(tbDemandQuotation.getGroupName());
+            }
+
             //执行添加
             resultList.add(goodsDemandVo);