cy
2023-11-16 6579ca226c537d52b1b5e7436a6182b86d9959fb
consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
@@ -20,18 +20,14 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description 物品模板
@@ -205,13 +201,12 @@
        Map<String, Object> map = new HashMap<>();
        map.put("categoryId", categoryId);
        List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId);
        baseWarehouseList.forEach(baseWarehouse -> {
            Integer isDefault = baseWarehouse.getIsDefault();
            if (isDefault == 1) {
                map.put("warehouseId", baseWarehouse.getId());
            }
        });
        List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId,(short)1,(short)1);
        if (CollectionUtils.isEmpty(baseWarehouseList)){
            return ResponseValue.error("机构无默认仓库!");
        }
        map.put("warehouseId", baseWarehouseList.get(0).getId());
        String sql = "SELECT DISTINCT bgt.id,bgt.GOODS_NAME FROM l_wh_goods g LEFT JOIN base_goods_template bgt ON g.BASE_GOODS_TEMPLATE_ID = bgt.id "
            + "WHERE WAREHOUSE_TYPE = 0 "