소스 검색

PC端新增到货通知接口

FengChaoYu 15 시간 전
부모
커밋
bd4a109152

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/bean/goods/GoodsAdviceNoticeVO.java

@@ -43,8 +43,8 @@ public class GoodsAdviceNoticeVO {
     @ApiModelProperty(value = "物料id")
     private String goodsMaterialId;
 
-    @ZfireField(tbName = "d", colName = "goods_name")
-    @ApiModelProperty(value = "商品规格名称")
+    @ZfireField(tbName = "d", colName = "goods_name", ignoreSelect = true)
+    @ApiModelProperty(value = "物料名称")
     private String goodsMaterialName;
 
     @ZfireField(hide = true)

+ 18 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/goods/GoodsAdviceNoticeController.java

@@ -6,10 +6,13 @@ import com.gree.mall.manager.annotation.ZfireList;
 import com.gree.mall.manager.bean.goods.GoodsAdviceNoticeItemVO;
 import com.gree.mall.manager.bean.goods.GoodsAdviceNoticeVO;
 import com.gree.mall.manager.bean.goods.GoodsMaterialVO;
+import com.gree.mall.manager.bean.goods.GoodsPurchaseVO;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.goods.GoodsAdviceNoticeLogic;
 import com.gree.mall.manager.logic.goods.GoodsMaterialLogic;
+import com.gree.mall.manager.zfire.bean.WebsitGoodsParamBean;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -17,6 +20,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 @Slf4j
 @RestController
@@ -37,6 +42,19 @@ public class GoodsAdviceNoticeController {
         return ResponseHelper.success(page, new TypeReference<GoodsAdviceNoticeVO>() {});
     }
 
+    @PostMapping("/list/export")
+    @ApiOperation("列表-导出")
+    public void listExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<GoodsAdviceNoticeVO> baseVOIPage = goodsAdviceNoticeLogic.page(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(baseVOIPage.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+
     @PostMapping("/item/list")
     @ApiOperation(value = "明细列表")
     public ResponseHelper<IPage<GoodsAdviceNoticeItemVO>> itemList(

+ 2 - 5
mall-server-api/src/main/java/com/gree/mall/manager/logic/goods/GoodsAdviceNoticeLogic.java

@@ -23,10 +23,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @RequiredArgsConstructor
@@ -70,7 +67,7 @@ public class GoodsAdviceNoticeLogic {
                 .eq(GoodsMaterialStorage::getGoodsMaterialId, adviceNotice.getGoodsMaterialId())
                 .one();
 
-        if (materialStorage.getStockQty() <= 0) {
+        if (Objects.isNull(materialStorage) || materialStorage.getStockQty() <= 0) {
             throw new RemoteServiceException("检查到库存为0, 发送失败");
         }
 

+ 3 - 8
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1145,9 +1145,6 @@
         FROM goods_storage_warning_record a LEFT JOIN goods b ON a.goods_id = b.goods_id
         LEFT JOIN goods_material c ON a.goods_material_id = c.id
         ${ex.query}
-        <if test="ex.companyWechatId != null and ex.companyWechatId != ''">
-            AND a.company_wechat_id = ${ex.companyWechatId}
-        </if>
         <if test="storageIds != null and storageIds.size > 0">
             AND a.storage_id IN
             <foreach item="item" index="index" collection="storageIds" open="(" separator="," close=")">
@@ -1161,15 +1158,13 @@
     </select>
     <select id="goodsAdviceNoticeList" resultType="com.gree.mall.manager.bean.goods.GoodsAdviceNoticeVO">
         SELECT
-        ${ex.selected}
+        ${ex.selected},
+        d.goods_name AS goods_material_name
         FROM goods_advice_notice a LEFT JOIN goods b ON a.goods_id = b.goods_id
             LEFT JOIN goods_spec c ON a.goods_spec_id = c.goods_spec_id
             LEFT JOIN goods_material d ON a.goods_material_id = d.id
             LEFT JOIN storage e ON a.storage_id = e.storage_id
         ${ex.query}
-        <if test="ex.companyWechatId != null and ex.companyWechatId != ''">
-            AND a.company_wechat_id = ${ex.companyWechatId}
-        </if>
         <if test="storageIds != null and storageIds.size > 0">
             AND a.storage_id IN
             <foreach item="item" index="index" collection="storageIds" open="(" separator="," close=")">
@@ -1188,7 +1183,7 @@
         FROM
             goods_advice_notice_item a LEFT JOIN  user b ON a.user_id = b.user_id
         WHERE
-            a.id = #{id}
+            a.goods_advice_notice_id = #{id}
         ORDER BY a.create_time DESC
     </select>