| | |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.S_dict_data; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.BaseGoodsTemplateVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | 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 物品模板 |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/24 |
| | | */ |
| | | public int add(BaseGoodsTemplateParam param, S_user_core currentUser) { |
| | | public int add(BaseGoodsTemplateParam param, FinSysTenantUser currentUser) { |
| | | //1.新增物品模板 |
| | | BaseGoodsTemplate baseGoodsTemplate = new BaseGoodsTemplate(); |
| | | BeanUtils.copyProperties(param, baseGoodsTemplate); |
| | |
| | | //当前机构的父级机构编号 |
| | | //机构层级 |
| | | //机构编号 |
| | | baseGoodsTemplate.setAgencyId(Long.valueOf(currentUser.getTenantId())); |
| | | //机构名称 |
| | | baseGoodsTemplate.setAgencyName(currentUser.getTenantName()); |
| | | //创建时间 |
| | | long createTime = DateUtils.getDateTimeNumber(System.currentTimeMillis()); |
| | | baseGoodsTemplate.setCreateDate(createTime); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | public List<S_dict_data> queryClassificationCode() { |
| | | public List<SDictData> queryClassificationCode() { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM s_dict_data WHERE dict_type = 'CLASSIFICATION_CODE' order by dict_sort"); |
| | | return this.select(sql.toString(), new Object[]{}, new S_dict_data()); |
| | | return this.select(sql.toString(), new Object[]{}, new SDictData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | return this.select(goodsTemplate); |
| | | } |
| | | |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) { |
| | | /** |
| | | * @param agencyId |
| | | * @param categoryId |
| | | * @param states |
| | | * @param goodsName 全匹配!!! |
| | | * @return |
| | | */ |
| | | |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Short states, String goodsName) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | if (agencyId != null) { |
| | | sql.append("AND AGENCY_ID=:agencyId"); |
| | | sql.append("AND AGENCY_ID=:agencyId "); |
| | | params.put("agencyId", agencyId); |
| | | } |
| | | if (categoryId != null) { |
| | | sql.append("AND CATEGORY_ID=:categoryId"); |
| | | sql.append("AND CATEGORY_ID=:categoryId "); |
| | | params.put("categoryId", categoryId); |
| | | } |
| | | if (states != null) { |
| | | sql.append("AND STATES=:states "); |
| | | params.put("states", states); |
| | | } |
| | | if (StringUtils.isNotEmpty(goodsName)) { |
| | | sql.append(" and GOODS_NAME =:goodsName "); |
| | | params.put("goodsName", goodsName); |
| | | } |
| | | return this.select(sql.toString(), params, new BaseGoodsTemplate()); |
| | | } |
| | | } |