| | |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.service.BaseWarehouseService; |
| | | import com.consum.base.service.FinSysTenantService; |
| | | import com.consum.base.service.SDictDataServiceImpl; |
| | | import com.consum.base.service.SDictDataService; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | |
| | | @Autowired |
| | | private FinSysTenantService finSysTenantService; |
| | | @Autowired |
| | | private SDictDataServiceImpl sDictDataService; |
| | | private SDictDataService sDictDataService; |
| | | |
| | | /** |
| | | * @Description 新增 |
| | |
| | | if (param.getAgencyId() != null) { |
| | | Integer lv = currentUser.getLv(); |
| | | if (lv != 1) { |
| | | sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", param.getAgencyId()); |
| | | sql.append(" and AGENCY_ID =:agencyId "); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } else { |
| | | sql.append(" and AGENCY_ID like :AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | sql.append(" and AGENCY_ID like :agencyId "); |
| | | paramts.put("agencyId", param.getAgencyId() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | } |
| | | // 状态 |
| | |
| | | * @Date 2023/10/27 |
| | | */ |
| | | @Override |
| | | public List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Short isDefault, Short states) { |
| | | public List<BaseWarehouse> getBaseWareHouseList(Long agencyId, Integer states) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | sql.append(" and AGENCY_ID =:AGENCY_ID "); |
| | | paramts.put("AGENCY_ID", agencyId); |
| | | } |
| | | // 是否为默认仓库 |
| | | if (isDefault != null) { |
| | | sql.append(" and IS_DEFAULT =:isDefault "); |
| | | paramts.put("isDefault", isDefault); |
| | | } |
| | | // 状态 |
| | | if (states != null) { |
| | | sql.append(" and states =:states "); |
| | | paramts.put("states", states); |
| | | } |
| | | return select(sql.toString(), paramts, new BaseWarehouse()); |
| | | } |
| | | |
| | | /** |
| | | * 根据机构id查询默认仓库 |
| | | * |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BaseWarehouse getDefaultWarehouseByAgencyId(Long agencyId) { |
| | | StringBuilder sql = |
| | | new StringBuilder("SELECT * FROM base_warehouse WHERE IS_DEFAULT = 1 and AGENCY_ID =:agencyId "); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("agencyId", agencyId); |
| | | List<BaseWarehouse> select = select(sql.toString(), param, new BaseWarehouse()); |
| | | BaseWarehouse baseWarehouse = select.stream().findFirst().orElse(null); |
| | | return baseWarehouse; |
| | | } |
| | | |
| | | @Override |