Skip to content

Commit

Permalink
Merge branch 'devMod2' into master2
Browse files Browse the repository at this point in the history
  • Loading branch information
dolly-chhabriya-altius committed May 23, 2024
2 parents c122f23 + e49c9fc commit 18f9f19
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>cc.altius.FASP.rest.webservice</groupId>
<artifactId>FASP</artifactId>
<version>2.72[4572]</version>
<version>2.73[4576]</version>
<name>QAT</name>
<description>Quantification Analytics Tool</description>
<packaging>jar</packaging>
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/cc/altius/FASP/dao/ErpLinkingDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
import cc.altius.FASP.model.DTO.ManualTaggingOrderDTO;
import cc.altius.FASP.model.NotLinkedErpShipmentsInput;
import cc.altius.FASP.model.DTO.NotificationSummaryDTO;
import cc.altius.FASP.model.ExtendedProductCategory;
import cc.altius.FASP.model.LinkedShipmentBatchDetails;
import cc.altius.FASP.model.NotLinkedErpShipmentsInputTab3;
import cc.altius.FASP.model.ProductCategory;
import cc.altius.FASP.model.RoAndRoPrimeLineNo;
import cc.altius.FASP.model.ShipmentLinkingOutput;
import cc.altius.FASP.model.Shipment;
import cc.altius.FASP.model.ShipmentLinkedToOtherProgramInput;
import cc.altius.FASP.model.ShipmentLinkedToOtherProgramOutput;
import cc.altius.FASP.model.ShipmentSyncInput;
import cc.altius.FASP.model.SimpleCodeObject;
import cc.altius.utils.TreeUtils.Node;
import java.util.List;

/**
Expand Down Expand Up @@ -51,7 +54,7 @@ public interface ErpLinkingDao {

public int createERPNotification(String orderNo, int primeLineNo, int shipmentId, int notificationTypeId);

public List<ERPNotificationDTO> getNotificationList(int programId,int versionId);
public List<ERPNotificationDTO> getNotificationList(int programId, int versionId);

public int updateNotification(ERPNotificationDTO eRPNotificationDTO, CustomUserDetails curUser);

Expand Down Expand Up @@ -87,4 +90,6 @@ public interface ErpLinkingDao {
public ArtmisHistory getArtmisHistory(String roNo, int roPrimeLineNo);

public List<LinkedShipmentBatchDetails> getBatchDetails(List<RoAndRoPrimeLineNo> roAndRoPrimeLineNoList, CustomUserDetails curUser);

public List<ProductCategory> getProductCategoryListForRealmCountryForErpLinking(CustomUserDetails curUser, int realmCountryId);
}
2 changes: 1 addition & 1 deletion src/main/java/cc/altius/FASP/dao/PlanningUnitDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public interface PlanningUnitDao {

public List<PlanningUnit> getPlanningUnitListForProductCategory(String productCategorySortOrder, boolean active, CustomUserDetails curUser);

public List<SimpleObject> getPlanningUnitListForProductCategoryList(String[] productCategoryIds, boolean active, CustomUserDetails curUser);
public List<SimpleObject> getPlanningUnitListForProductCategoryList(String[] productCategoryIds,int realmCountryId, boolean active, CustomUserDetails curUser);

public List<SimpleObject> getPlanningUnitListByRealmCountryId(int realmCountryId, CustomUserDetails curUser);

Expand Down
51 changes: 50 additions & 1 deletion src/main/java/cc/altius/FASP/dao/impl/ErpLinkingDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import cc.altius.FASP.model.DTO.rowMapper.NotERPLinkedShipmentsRowMapper;
import cc.altius.FASP.model.DTO.rowMapper.NotificationSummaryDTORowMapper;
import cc.altius.FASP.model.DTO.rowMapper.ShipmentNotificationDTORowMapper;
import cc.altius.FASP.model.ExtendedProductCategory;
import cc.altius.FASP.model.LinkedShipmentBatchDetails;
import cc.altius.FASP.model.NotLinkedErpShipmentsInput;
import cc.altius.FASP.model.NotLinkedErpShipmentsInputTab3;
import cc.altius.FASP.model.ProductCategory;
import cc.altius.FASP.model.Program;
import cc.altius.FASP.model.RoAndRoPrimeLineNo;
import cc.altius.FASP.model.Shipment;
Expand All @@ -41,13 +43,16 @@
import cc.altius.FASP.model.ShipmentSyncInput;
import cc.altius.FASP.model.SimpleCodeObject;
import cc.altius.FASP.model.rowMapper.LinkedShipmentBatchDetailsListResultSetExtractor;
import cc.altius.FASP.model.rowMapper.ProductCategoryRowMapper;
import cc.altius.FASP.model.rowMapper.ShipmentLinkedToOtherProgramOutputRowMapper;
import cc.altius.FASP.model.rowMapper.ShipmentLinkingOutputRowMapper;
import cc.altius.FASP.model.rowMapper.ShipmentListResultSetExtractor;
import cc.altius.FASP.model.rowMapper.SimpleCodeObjectRowMapper;
import cc.altius.FASP.model.rowMapper.TreeExtendedProductCategoryResultSetExtractor;
import cc.altius.FASP.service.ProgramService;
import cc.altius.FASP.utils.ArrayUtils;
import cc.altius.utils.DateUtils;
import cc.altius.utils.TreeUtils.Node;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -1865,7 +1870,7 @@ public List<String> autoCompleteOrder(ErpAutoCompleteDTO erpAutoCompleteDTO, Cus
this.namedParameterJdbcTemplate.update(sqlString, params);
sqlString = "CREATE TEMPORARY TABLE `tmp_delinked_list_copy` (`RO_NO` VARCHAR(45) NOT NULL, `RO_PRIME_LINE_NO` VARCHAR(45) NOT NULL, PRIMARY KEY (`RO_NO`, `RO_PRIME_LINE_NO`))";
this.namedParameterJdbcTemplate.update(sqlString, params);

List<SqlParameterSource> paramList = new LinkedList<>();
for (RoAndRoPrimeLineNo roAndRoPrimeLineNo : erpAutoCompleteDTO.getDelinkedList()) {
MapSqlParameterSource param = new MapSqlParameterSource();
Expand Down Expand Up @@ -2329,4 +2334,48 @@ public List<LinkedShipmentBatchDetails> getBatchDetails(List<RoAndRoPrimeLineNo>
return this.namedParameterJdbcTemplate.query(sqlStringBuilder.toString(), new LinkedShipmentBatchDetailsListResultSetExtractor());
}

@Override
public List<ProductCategory> getProductCategoryListForRealmCountryForErpLinking(CustomUserDetails curUser, int realmCountryId) {

StringBuilder sqlStringBuilder;
String setDateQuery = "SET @dt = CURDATE() - INTERVAL 6 MONTH;";
String setCountryIdQuery = "SET @realmCountryId = ?;";
this.jdbcTemplate.update(setDateQuery);
this.jdbcTemplate.update(setCountryIdQuery, realmCountryId);
String getCountryNameQuery = "SELECT c.LABEL_EN INTO @countryName FROM rm_realm_country rc LEFT JOIN vw_country c ON rc.COUNTRY_ID=c.COUNTRY_ID WHERE rc.REALM_COUNTRY_ID=@realmCountryId";
this.jdbcTemplate.execute(getCountryNameQuery);
sqlStringBuilder = new StringBuilder("SELECT pc.PRODUCT_CATEGORY_ID, pc.SORT_ORDER, pcl.LABEL_ID, pcl.LABEL_EN, pcl.LABEL_FR, pcl.LABEL_PR, pcl.LABEL_SP,r.REALM_ID, r.REALM_CODE, rl.LABEL_ID `REALM_LABEL_ID`, rl.LABEL_EN `REALM_LABEL_EN`, rl.LABEL_FR `REALM_LABEL_FR`, rl.LABEL_PR `REALM_LABEL_PR`, rl.LABEL_SP `REALM_LABEL_SP`,cb.USER_ID `CB_USER_ID`, cb.USERNAME `CB_USERNAME`, lmb.USER_ID `LMB_USER_ID`, lmb.USERNAME `LMB_USERNAME`, pc.ACTIVE, pc.CREATED_DATE, pc.LAST_MODIFIED_DATE "
+ "FROM rm_erp_order_consolidated e "
+ "LEFT JOIN rm_erp_shipment_consolidated s ON e.ORDER_NO=s.ORDER_NO AND e.PRIME_LINE_NO=s.PRIME_LINE_NO AND s.ACTIVE "
+ "LEFT JOIN rm_procurement_agent_planning_unit papu ON (FIND_IN_SET(papu.PLANNING_UNIT_ID,'') OR ''='') AND LEFT(papu.SKU_CODE,12)=e.PLANNING_UNIT_SKU_CODE "
+ "LEFT JOIN rm_shipment_status_mapping sm ON sm.EXTERNAL_STATUS_STAGE=COALESCE(s.STATUS, e.STATUS) "
+ "LEFT JOIN rm_shipment_linking sl ON sl.RO_NO=e.RO_NO and sl.RO_PRIME_LINE_NO=e.RO_PRIME_LINE_NO AND sl.ACTIVE "
+ "LEFT JOIN rm_shipment_linking_trans slt ON slt.SHIPMENT_LINKING_ID=sl.SHIPMENT_LINKING_ID AND slt.VERSION_ID=sl.MAX_VERSION_ID AND slt.ACTIVE "
+ "LEFT JOIN vw_planning_unit pu ON papu.PLANNING_UNIT_ID=pu.PLANNING_UNIT_ID "
+ "LEFT JOIN rm_forecasting_unit fu ON pu.FORECASTING_UNIT_ID=fu.FORECASTING_UNIT_ID "
+ "LEFT JOIN rm_product_category pc ON fu.PRODUCT_CATEGORY_ID=pc.PRODUCT_CATEGORY_ID "
+ "LEFT JOIN ap_label pcl ON pc.LABEL_ID=pcl.LABEL_ID "
+ "LEFT JOIN rm_realm r ON pc.REALM_ID=r.REALM_ID "
+ "LEFT JOIN ap_label rl ON r.LABEL_ID=rl.LABEL_ID "
+ "LEFT JOIN us_user cb ON pc.CREATED_BY=cb.USER_ID "
+ "LEFT JOIN us_user lmb ON pc.LAST_MODIFIED_BY=lmb.USER_ID "
+ "WHERE e.RECPIENT_COUNTRY=@countryName AND e.ACTIVE "
+ "AND ( "
+ " ( "
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.CURRENT_ESTIMATED_DELIVERY_DATE,e.AGREED_DELIVERY_DATE,e.REQ_DELIVERY_DATE) < @dt "
+ " AND sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,2,3,5,7,9,10,13,15) "
+ " ) "
+ " OR "
+ " ( "
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.CURRENT_ESTIMATED_DELIVERY_DATE,e.AGREED_DELIVERY_DATE,e.REQ_DELIVERY_DATE) >= @dt "
+ " AND sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,3,5,7,9,10,13,15) "
+ " ) "
+ " ) "
+ " AND slt.SHIPMENT_LINKING_TRANS_ID IS NULL "
+ " and pu.ACTIVE AND fu.ACTIVE and pc.ACTIVE "
+ " GROUP BY pc.PRODUCT_CATEGORY_ID ORDER BY pc.SORT_ORDER;");
Map<String, Object> params = new HashMap<>();
return this.namedParameterJdbcTemplate.query(sqlStringBuilder.toString(), params, new ProductCategoryRowMapper());
}

}
38 changes: 30 additions & 8 deletions src/main/java/cc/altius/FASP/dao/impl/PlanningUnitDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,43 @@ public List<PlanningUnit> getPlanningUnitListForProductCategory(String productCa
}

@Override
public List<SimpleObject> getPlanningUnitListForProductCategoryList(String[] productCategoryIds, boolean active, CustomUserDetails curUser) {
public List<SimpleObject> getPlanningUnitListForProductCategoryList(String[] productCategoryIds, int realmCountryId, boolean active, CustomUserDetails curUser) {
StringBuilder subBuilder = new StringBuilder("SELECT DISTINCT(pc2.PRODUCT_CATEGORY_ID) `PRODUCT_CATEGORY_ID` FROM rm_product_category pc LEFT JOIN rm_product_category pc2 ON pc2.SORT_ORDER LIKE CONCAT(pc.SORT_ORDER,\"%\") WHERE FIND_IN_SET(pc.PRODUCT_CATEGORY_ID, :productCategoryList) ");
Map<String, Object> params = new HashMap<>();
params.put("productCategoryList", String.join(",", productCategoryIds));
this.aclService.addUserAclForRealm(subBuilder, params, "pc", curUser);
StringBuilder sqlStringBuilder = new StringBuilder("SELECT GROUP_CONCAT(pc3.`PRODUCT_CATEGORY_ID`) `allProductCategories` FROM (").append(subBuilder).append(") AS pc3");
String finalProductCategoryIds = this.namedParameterJdbcTemplate.queryForObject(sqlStringBuilder.toString(), params, String.class);
params.clear();
sqlStringBuilder = new StringBuilder("SELECT pu.PLANNING_UNIT_ID `ID` , pu.LABEL_ID, pu.LABEL_EN, pu.LABEL_FR, pu.LABEL_SP, pu.LABEL_PR "
+ "FROM vw_planning_unit pu "
+ "LEFT JOIN rm_forecasting_unit fu ON pu.FORECASTING_UNIT_ID=fu.FORECASTING_UNIT_ID "
+ "WHERE "
+ " FIND_IN_SET(fu.PRODUCT_CATEGORY_ID,:finalProductCategoryIds) "
+ " AND pu.ACTIVE "
+ " AND fu.ACTIVE ");
String setDateQuery = "SET @dt = CURDATE() - INTERVAL 6 MONTH;";
String setCountryIdQuery = "SET @realmCountryId = ?;";
this.jdbcTemplate.update(setDateQuery);
this.jdbcTemplate.update(setCountryIdQuery, realmCountryId);
String getCountryNameQuery = "SELECT c.LABEL_EN INTO @countryName FROM rm_realm_country rc LEFT JOIN vw_country c ON rc.COUNTRY_ID=c.COUNTRY_ID WHERE rc.REALM_COUNTRY_ID=@realmCountryId";
this.jdbcTemplate.execute(getCountryNameQuery);
sqlStringBuilder = new StringBuilder("SELECT "
+ " pu.PLANNING_UNIT_ID ID, pu.LABEL_ID LABEL_ID, pu.LABEL_EN LABEL_EN, pu.LABEL_FR LABEL_FR, pu.LABEL_SP LABEL_SP, pu.LABEL_PR LABEL_PR "
+ "FROM rm_erp_order_consolidated e "
+ "LEFT JOIN rm_erp_shipment_consolidated s ON e.ORDER_NO=s.ORDER_NO AND e.PRIME_LINE_NO=s.PRIME_LINE_NO AND s.ACTIVE "
+ "LEFT JOIN rm_procurement_agent_planning_unit papu ON (FIND_IN_SET(papu.PLANNING_UNIT_ID,'') OR ''='') AND LEFT(papu.SKU_CODE,12)=e.PLANNING_UNIT_SKU_CODE "
+ "LEFT JOIN rm_shipment_status_mapping sm ON sm.EXTERNAL_STATUS_STAGE=COALESCE(s.STATUS, e.STATUS) "
+ "LEFT JOIN rm_shipment_linking sl ON sl.RO_NO=e.RO_NO and sl.RO_PRIME_LINE_NO=e.RO_PRIME_LINE_NO AND sl.ACTIVE "
+ "LEFT JOIN rm_shipment_linking_trans slt ON slt.SHIPMENT_LINKING_ID=sl.SHIPMENT_LINKING_ID AND slt.VERSION_ID=sl.MAX_VERSION_ID AND slt.ACTIVE "
+ "LEFT JOIN vw_planning_unit pu ON papu.PLANNING_UNIT_ID=pu.PLANNING_UNIT_ID "
+ "LEFT JOIN rm_forecasting_unit fu ON pu.FORECASTING_UNIT_ID=fu.FORECASTING_UNIT_ID "
+ "WHERE e.RECPIENT_COUNTRY=@countryName AND e.ACTIVE "
+ "AND ( "
+ " ( "
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.CURRENT_ESTIMATED_DELIVERY_DATE,e.AGREED_DELIVERY_DATE,e.REQ_DELIVERY_DATE) < @dt "
+ " AND sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,2,3,5,7,9,10,13,15) "
+ " ) "
+ " OR "
+ " ( "
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.CURRENT_ESTIMATED_DELIVERY_DATE,e.AGREED_DELIVERY_DATE,e.REQ_DELIVERY_DATE) >= @dt "
+ " AND sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,3,5,7,9,10,13,15) "
+ " ) "
+ " ) "
+ " AND slt.SHIPMENT_LINKING_TRANS_ID IS NULL AND FIND_IN_SET(fu.PRODUCT_CATEGORY_ID,:finalProductCategoryIds) AND pu.ACTIVE AND fu.ACTIVE ");
sqlStringBuilder.append(" GROUP BY pu.PLANNING_UNIT_ID ORDER BY pu.LABEL_EN");
params.put("finalProductCategoryIds", finalProductCategoryIds);
return this.namedParameterJdbcTemplate.query(sqlStringBuilder.toString(), params, new SimpleObjectRowMapper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ public List<SimpleObject> getTracerCategoryDropdownList(CustomUserDetails curUse

@Override
public List<SimpleObject> getTracerCategoryDropdownListForFilterMultiplerPrograms(String programIds, CustomUserDetails curUser) {
StringBuilder sqlStringBuilder = new StringBuilder("SELECT tc.TRACER_CATEGORY_ID `ID`, tc.LABEL_ID, tc.LABEL_EN, tc.LABEL_FR, tc.LABEL_SP, tc.LABEL_PR FROM rm_program p LEFT JOIN rm_program_health_area pha ON p.PROGRAM_ID=pha.PROGRAM_ID LEFT JOIN rm_health_area ha ON pha.HEALTH_AREA_ID=ha.HEALTH_AREA_ID LEFT JOIN vw_tracer_category tc ON tc.HEALTH_AREA_ID=ha.HEALTH_AREA_ID WHERE tc.ACTIVE AND p.ACTIVE ");
StringBuilder sqlStringBuilder = new StringBuilder("SELECT tc.TRACER_CATEGORY_ID `ID`, tc.LABEL_ID, tc.LABEL_EN, tc.LABEL_FR, tc.LABEL_SP, tc.LABEL_PR FROM rm_program_planning_unit ppu LEFT JOIN vw_program p ON ppu.PROGRAM_ID=p.PROGRAM_ID LEFT JOIN rm_planning_unit pu ON ppu.PLANNING_UNIT_ID=pu.PLANNING_UNIT_ID LEFT JOIN rm_forecasting_unit fu ON pu.FORECASTING_UNIT_ID=fu.FORECASTING_UNIT_ID LEFT JOIN vw_tracer_category tc ON fu.TRACER_CATEGORY_ID=tc.TRACER_CATEGORY_ID WHERE ppu.ACTIVE AND tc.ACTIVE AND pu.ACTIVE AND fu.ACTIVE ");
Map<String, Object> params = new HashMap<>();
if (programIds.length() > 0) {
sqlStringBuilder.append(" AND FIND_IN_SET(p.PROGRAM_ID, :programIds) ");
sqlStringBuilder.append(" AND FIND_IN_SET(ppu.PROGRAM_ID, :programIds) ");
params.put("programIds", programIds);
}
this.aclService.addUserAclForRealm(sqlStringBuilder, params, "tc", curUser);
this.aclService.addFullAclForProgram(sqlStringBuilder, params, "p", curUser);
sqlStringBuilder.append(" GROUP BY tc.TRACER_CATEGORY_ID ORDER BY tc.LABEL_EN");
return this.namedParameterJdbcTemplate.query(sqlStringBuilder.toString(), params, new SimpleObjectRowMapper());
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cc/altius/FASP/jwt/JWTWebSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers(HttpMethod.PUT,"/api/planningUnit/**").hasAnyAuthority("ROLE_BF_EDIT_PLANNING_UNIT","ROLE_BF_MAP_PLANNING_UNIT_CAPACITY")
.requestMatchers(HttpMethod.POST,"/api/planningUnit/programs/**").hasAnyAuthority("ROLE_BF_LIST_ALTERNATE_REPORTING_UNIT","ROLE_BF_FORECAST_MATRIX_REPORT","ROLE_BF_CONSUMPTION_GLOBAL_VIEW_REPORT","ROLE_BF_SHIPMENT_OVERVIEW_REPORT")
.requestMatchers(HttpMethod.GET,"/api/planningUnit/productCategory/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING","ROLE_BF_SHIPMENT_OVERVIEW_REPORT","ROLE_BF_GLOBAL_DEMAND_REPORT")
.requestMatchers(HttpMethod.POST,"/api/planningUnit/productCategoryList/active/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.POST,"/api/planningUnit/productCategoryList/active/realmCountryId/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.GET,"/api/planningUnit/realmCountry/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.GET,"/api/planningUnit/forecastingUnit/**").hasAnyAuthority("ROLE_BF_EDIT_TREE_TEMPLATE","ROLE_BF_ADD_TREE_TEMPLATE","ROLE_BF_VIEW_TREE_TEMPLATES")
.requestMatchers(HttpMethod.GET,"/api/planningUnit/programId/**").hasAnyAuthority("ROLE_BF_LIST_MONTHLY_FORECAST","ROLE_BF_LIST_IMPORT_FROM_QAT_SUPPLY_PLAN","ROLE_BF_SUPPLY_PLAN_IMPORT")
Expand All @@ -325,7 +325,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers(HttpMethod.PUT,"/api/erpLinking/updateNotification/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.GET,"/api/manualTagging/notLinkedShipments/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING","ROLE_BF_DELINKING")
.requestMatchers(HttpMethod.GET,"/api/erpLinking/artmisHistory/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING","ROLE_BF_DELINKING")
.requestMatchers(HttpMethod.GET,"/api/erpLinking/getNotificationSummary/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.GET,"/api/erpLinking/getNotificationSummary/**","/api/erpLinking/productCategory/realmCountryId/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.POST,"/api/erpLinking/notLinkedQatShipments/programId/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.POST,"/api/erpLinking/autoCompleteOrder/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
.requestMatchers(HttpMethod.POST,"/api/erpLinking/autoCompletePu/**").hasAnyAuthority("ROLE_BF_MANUAL_TAGGING")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,15 @@ public ResponseEntity getNotificationSummary(Authentication auth) {
return new ResponseEntity(new ResponseCode("static.message.listFailed"), HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@GetMapping("/api/erpLinking/productCategory/realmCountryId/{realmCountryId}")
public ResponseEntity getProductCategoryListForRealmCountryForErpLinking(@PathVariable(value = "realmCountryId", required = true) int realmCountryId, Authentication auth) {
try {
CustomUserDetails curUser = this.userService.getCustomUserByUserId(((CustomUserDetails) auth.getPrincipal()).getUserId());
return new ResponseEntity(this.erpLinkingService.getProductCategoryListForRealmCountryForErpLinking(curUser, realmCountryId), HttpStatus.OK);
} catch (Exception e) {
logger.error("Error while trying to list Product Category", e);
return new ResponseEntity(new ResponseCode("static.message.listFailed"), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
Loading

0 comments on commit 18f9f19

Please sign in to comment.