|
@@ -8,6 +8,7 @@ import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
|
|
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
|
|
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
|
|
import com.qs.mp.admin.domain.*;
|
|
import com.qs.mp.admin.domain.*;
|
|
import com.qs.mp.admin.domain.excel.GoodsCardImportExcel;
|
|
import com.qs.mp.admin.domain.excel.GoodsCardImportExcel;
|
|
|
|
+import com.qs.mp.admin.domain.excel.GoodsCardUsedExcel;
|
|
import com.qs.mp.admin.domain.excel.GoodsExcel;
|
|
import com.qs.mp.admin.domain.excel.GoodsExcel;
|
|
import com.qs.mp.admin.domain.param.GoodsCardQueryParam;
|
|
import com.qs.mp.admin.domain.param.GoodsCardQueryParam;
|
|
import com.qs.mp.admin.domain.param.GoodsParam;
|
|
import com.qs.mp.admin.domain.param.GoodsParam;
|
|
@@ -33,6 +34,7 @@ import io.swagger.annotations.ApiResponse;
|
|
import io.swagger.annotations.ApiResponses;
|
|
import io.swagger.annotations.ApiResponses;
|
|
import ma.glasnost.orika.MapperFacade;
|
|
import ma.glasnost.orika.MapperFacade;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.aspectj.weaver.AjcMemberMaker;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -698,4 +700,42 @@ public class GoodsMgrController extends BaseApiController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出已使用卡密
|
|
|
|
+ * @param param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/export/card/list")
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:goods:export')")
|
|
|
|
+ @ApiOperation("导出已使用卡密")
|
|
|
|
+ @ApiResponses(
|
|
|
|
+ @ApiResponse(code = 200, message = "OK", response = GoodsCard.class)
|
|
|
|
+ )
|
|
|
|
+ public AjaxResult exportUserdCardList(@RequestBody GoodsCardQueryParam param) {
|
|
|
|
+ if (param.getGoodsId() == null || param.getGoodsId() == 0) {
|
|
|
|
+ return AjaxResult.error("商品id不正确");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<GoodsCard> list = goodsCardService.list(new LambdaQueryWrapper<GoodsCard>()
|
|
|
|
+ .eq(GoodsCard::getGoodsId, param.getGoodsId())
|
|
|
|
+ .eq(GoodsCard::getIsUse, 1));
|
|
|
|
+
|
|
|
|
+ List<GoodsCardUsedExcel> goodsCardUsedExcels = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ for (GoodsCard GoodsCardUsed : list) {
|
|
|
|
+ GoodsCardUsedExcel goodsCardExcel = new GoodsCardUsedExcel();
|
|
|
|
+ BeanUtils.copyProperties(GoodsCardUsed, goodsCardExcel);
|
|
|
|
+
|
|
|
|
+ goodsCardUsedExcels.add(goodsCardExcel);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExcelUtil<GoodsCardUsedExcel> util = new ExcelUtil<>(GoodsCardUsedExcel.class);
|
|
|
|
+ return util.exportExcel(goodsCardUsedExcels, "商品导出", false);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|