Explorar o código

工厂端客户管理bug优化

liyuan hai 1 semana
pai
achega
ad849c555b

+ 104 - 0
blade-service-api/gubersail-dealer-admin-api/src/main/java/com/gubersail/dealer/admin/api/inventory/vo/StockDescExcelVo.java

@@ -0,0 +1,104 @@
+package com.gubersail.dealer.admin.api.inventory.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Rain
+ */
+@Data
+public class StockDescExcelVo {
+
+	/**
+	 * 商品名称
+	 */
+	@ExcelProperty(value = "商品名称")
+	private String cname;
+
+	/**
+	 * 商品编码
+	 */
+	@ExcelProperty(value = "商品编码")
+	private String code;
+
+	/**
+	 * 分类
+	 */
+	@ExcelProperty(value = "分类")
+	private String goodsTypeName;
+
+	/**
+	 * 品牌
+	 */
+	@ExcelProperty(value = "品牌")
+	private String brandName;
+
+	/**
+	 * 批次
+	 */
+	@ExcelProperty(value = "批次")
+	private String dot;
+
+	/**
+	 * 花纹
+	 */
+	@ExcelProperty(value = "花纹")
+	private String brandItem;
+
+	/**
+	 * 规格型号
+	 */
+	@ExcelProperty(value = "规格型号")
+	private String typeNo;
+
+	/**
+	 * 售价1
+	 */
+	@ExcelProperty(value = "售价1")
+	private BigDecimal priceOne;
+
+	/**
+	 * 售价2
+	 */
+	@ExcelProperty(value = "售价2")
+	private BigDecimal priceTwo;
+
+	/**
+	 * 售价3
+	 */
+	@ExcelProperty(value = "售价3")
+	private BigDecimal priceThree;
+
+	/**
+	 * 售价4
+	 */
+	@ExcelProperty(value = "售价4")
+	private BigDecimal priceFour;
+
+	/**
+	 * 仓库
+	 */
+	@ExcelProperty(value = "仓库")
+	private String storageName;
+
+	/**
+	 * 库存数量
+	 */
+	@ExcelProperty(value = "库存数量")
+	private Integer balanceQuantity;
+
+	/**
+	 * 库存单价
+	 */
+	@ExcelProperty(value = "库存单价")
+	private BigDecimal inventoryCostPrice;
+
+	/**
+	 * 库存金额
+	 */
+	@ExcelProperty(value = "库存金额")
+	private BigDecimal inventoryAmount;
+
+}

+ 7 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/fc/customer/controller/FcCustomerDescController.java

@@ -180,4 +180,11 @@ public class FcCustomerDescController {
 		return R.status(status);
 	}
 
+	@PostMapping("delCustomer")
+	public R delCustomer(@RequestBody List<Long> ids) {
+		FcCustomerDesc customerDesc = new FcCustomerDesc();
+		customerDesc.setIsDeleted(1);
+		return corpsDescService.update(customerDesc, new LambdaQueryWrapper<FcCustomerDesc>().in(FcCustomerDesc::getId, ids)) ? R.success("删除成功") : R.fail("删除失败");
+	}
+
 }

+ 29 - 0
blade-service/gubersail-dealer-admin/src/main/java/com/gubersail/admin/inventory/controller/StockDescController.java

@@ -12,10 +12,12 @@ import com.gubersail.dealer.admin.api.fc.customer.vo.FcCustomerDescVo;
 import com.gubersail.dealer.admin.api.fc.price.entity.ProductLaunch;
 import com.gubersail.dealer.admin.api.inventory.entity.PjStockDesc;
 import com.gubersail.dealer.admin.api.inventory.vo.PjStockDescVo;
+import com.gubersail.dealer.admin.api.inventory.vo.StockDescExcelVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
@@ -27,6 +29,7 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
@@ -65,6 +68,7 @@ public class StockDescController extends BladeController {
 			.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandId()), PjStockDesc::getBrandId, stockDesc.getBrandId())
 			.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandName()), PjStockDesc::getBrandName, stockDesc.getBrandName())
 			.eq(ObjectUtil.isNotEmpty(stockDesc.getGoodsTypeId()), PjStockDesc::getGoodsTypeId, stockDesc.getGoodsTypeId())
+			.like(StringUtils.hasText(stockDesc.getGoodsTypeName()), PjStockDesc::getGoodsTypeName, stockDesc.getGoodsTypeName())
 			.like(StringUtils.hasText(stockDesc.getDot()), PjStockDesc::getDot, stockDesc.getDot());
 		lambdaQueryWrapper.like(StringUtils.hasText(stockDesc.getCname()),  PjStockDesc::getCname, stockDesc.getCname());
 		lambdaQueryWrapper.orderByDesc(PjStockDesc::getBalanceQuantity);
@@ -108,4 +112,29 @@ public class StockDescController extends BladeController {
 	}
 
 
+	@GetMapping("/stockExport")
+	public void stockExport(PjStockDescVo stockDesc, HttpServletResponse response) {
+		BladeUser bladeUser = AuthUtil.getUser();
+		LambdaQueryWrapper<PjStockDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(PjStockDesc::getTenantId, bladeUser.getTenantId())
+			.eq(PjStockDesc::getIsDeleted, 0)
+			.eq(PjStockDesc::getSalesCompanyId, bladeUser.getDeptId())
+			.like(StringUtils.hasText(stockDesc.getCode()), PjStockDesc::getCode, stockDesc.getCode())
+			.like(StringUtils.hasText(stockDesc.getTypeNo()), PjStockDesc::getTypeNo, stockDesc.getTypeNo())
+			.eq(ObjectUtil.isNotEmpty(stockDesc.getStorageId()), PjStockDesc::getStorageId, stockDesc.getStorageId())
+			.like(StringUtils.hasText(stockDesc.getStorageName()), PjStockDesc::getStorageName, stockDesc.getStorageName())
+			.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandId()), PjStockDesc::getBrandId, stockDesc.getBrandId())
+			.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandName()), PjStockDesc::getBrandName, stockDesc.getBrandName())
+			.eq(ObjectUtil.isNotEmpty(stockDesc.getGoodsTypeId()), PjStockDesc::getGoodsTypeId, stockDesc.getGoodsTypeId())
+			.like(StringUtils.hasText(stockDesc.getGoodsTypeName()), PjStockDesc::getGoodsTypeName, stockDesc.getGoodsTypeName())
+			.like(StringUtils.hasText(stockDesc.getDot()), PjStockDesc::getDot, stockDesc.getDot());
+		lambdaQueryWrapper.like(StringUtils.hasText(stockDesc.getCname()),  PjStockDesc::getCname, stockDesc.getCname());
+		lambdaQueryWrapper.orderByDesc(PjStockDesc::getBalanceQuantity);
+		List<PjStockDesc> stockDescList = stockDescService.list(lambdaQueryWrapper);
+		ExcelUtil.export(response, "商品信息", "商品信息", BeanUtil.copy(stockDescList, StockDescExcelVo.class), StockDescExcelVo.class);
+
+	}
+
+
+
 }