haoyahui
2023-11-11 332c012e7336f2996c4fe5c8c110d00713c1bde2
consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java
@@ -14,14 +14,13 @@
import com.walker.infrastructure.utils.DateUtils;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.jdbc.service.BaseServiceImpl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description 物品模板
@@ -233,7 +232,7 @@
     * @param modelId
     * @return
     */
    private static String QUERY_GOODSINFO_BY_MODELID = "SELECT model.MODEL_NAME modelName,model.UNIT,temp.id goodsId, temp.GOODS_CODE goodsCode,temp.GOODS_NAME goodsName,temp.CLASSIFICATION classification FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE temp ON model.GOODS_TEMPLATES_ID=temp.id WHERE 1=1 ";
    private static String QUERY_GOODSINFO_BY_MODELID = "SELECT model.MODEL_NAME modelName,model.UNIT,temp.id goodsId, temp.GOODS_CODE goodsCode,temp.GOODS_NAME goodsName,temp.CLASSIFICATION classification,temp.CATEGORY_ID categoryId FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE temp ON model.GOODS_TEMPLATES_ID=temp.id WHERE 1=1 ";
    public Map<String, Object> queryGoodsInfoByModelId(Long modelId) {
        StringBuilder sqlStr = new StringBuilder(QUERY_GOODSINFO_BY_MODELID);
@@ -251,6 +250,7 @@
    /**
     * 修改状态
     *
     * @author 卢庆阳
     * @date 2023/10/25
     */
@@ -274,10 +274,10 @@
    }
    /**
     * @Description  查询仓库类型(数据字典)
     * @return
     * @Description 查询仓库类型(数据字典)
     * @Author 卢庆阳
     * @Date 2023/10/30
     * @return
     */
    public List<S_dict_data> queryClassificationCode() {
        StringBuilder sql = new StringBuilder("SELECT * FROM s_dict_data WHERE dict_type = 'CLASSIFICATION_CODE' order by dict_sort");
@@ -285,14 +285,23 @@
    }
    /**
     * @Description  根据分类id查询物品模板
     * @Description 根据分类id查询物品模板
     * @Author 卢庆阳
     * @Date 2023/10/30
     */
    public List<BaseGoodsTemplate> querybyCategoryId(Long categoryId) {
    public List<BaseGoodsTemplate> queryByCategoryId(Long categoryId) {
        BaseGoodsTemplate goodsTemplate = new BaseGoodsTemplate();
        goodsTemplate.setCategoryId(categoryId);
        List<BaseGoodsTemplate> select = this.select(goodsTemplate);
        return select;
        return this.select(goodsTemplate);
    }
    public List<BaseGoodsTemplate> queryByAgencyId(Long agencyId) {
        StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 ");
        Map<String, Object> params = new HashMap<>();
        if (agencyId != null) {
            sql.append(" AND model.id=:modelId");
            params.put("agencyId", agencyId);
        }
        return this.select(sql.toString(), params, new BaseGoodsTemplate());
    }
}