Skip to content

Commit 6cf6fdc

Browse files
Merge branch 'dev'
2 parents 88f5bba + 98b58c0 commit 6cf6fdc

File tree

11 files changed

+53
-40
lines changed

11 files changed

+53
-40
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>cc.altius.FASP.rest.webservice</groupId>
1212
<artifactId>FASP</artifactId>
13-
<version>2.94[5233]</version>
13+
<version>2.95[5545]</version>
1414
<name>QAT</name>
1515
<description>Quantification Analytics Tool</description>
1616
<packaging>jar</packaging>

src/main/java/cc/altius/FASP/dao/impl/DashboardDaoImpl.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -345,31 +345,8 @@ public DashboardForLoadProgram getDashboardForLoadProgram(int programId, int ver
345345

346346
@Override
347347
public int getUserCount(CustomUserDetails curUser) {
348-
String showInternalUsersString = "SELECT IF(COUNT(*)>0,1,0) `showInternalUsers` FROM us_user_role ur WHERE ur.ROLE_ID IN ('ROLE_INTERNAL_USER', 'ROLE_APPLICATION_ADMIN', 'ROLE_REALM_ADMIN') AND ur.USER_ID=:curUser ";
349-
Map<String, Object> params = new HashMap<>();
350-
params.put("curUser", curUser.getUserId());
351-
boolean showInternalUsers = this.namedParameterJdbcTemplate.queryForObject(showInternalUsersString, params, Boolean.class);
352-
params.put("showInternalUsers", showInternalUsers);
353-
354-
StringBuilder sb1 = new StringBuilder("SELECT COUNT(DISTINCT(ul.USER_ID)) FROM "
355-
+ " ("
356-
+ " SELECT u.`USER_ID`, u.`REALM_ID`, GROUP_CONCAT(ur.`ROLE_ID`) `ROLE_LIST`"
357-
+ " FROM us_user u "
358-
+ " LEFT JOIN us_user_role ur ON u.`USER_ID`=ur.`USER_ID` "
359-
+ " GROUP BY u.`USER_ID` "
360-
+ " ) ul"
361-
+ " LEFT JOIN us_user_role ur ON ul.`USER_ID`=ur.`USER_ID` "
362-
+ " LEFT JOIN us_user_acl acl ON ul.`USER_ID`=acl.`USER_ID` AND ur.`ROLE_ID`=acl.`ROLE_ID` "
363-
+ " WHERE "
364-
+ " (("
365-
+ " :showInternalUsers = 0"
366-
+ " AND NOT FIND_IN_SET('ROLE_INTERNAL_USER', ul.`ROLE_LIST`) "
367-
+ " AND NOT FIND_IN_SET('ROLE_APPLICATION_ADMIN', ul.`ROLE_LIST`) "
368-
+ " ) OR "
369-
+ " (:showInternalUsers)) ");
370-
this.aclService.addUserAclForRealm(sb1, params, "ul", curUser);
371-
this.aclService.addFullAclAtUserLevel(sb1, params, "acl", curUser);
372-
return this.namedParameterJdbcTemplate.queryForObject(sb1.toString(), params, Integer.class);
348+
String sql="SELECT COUNT(u.USER_ID) FROM us_user u WHERE u.ACTIVE ";
349+
return this.jdbcTemplate.queryForObject(sql, Integer.class);
373350
}
374351

375352
@Override

src/main/java/cc/altius/FASP/dao/impl/ErpLinkingDaoImpl.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,12 @@ public List<ShipmentLinkingOutput> getNotLinkedErpShipmentsTab1AndTab3(NotLinked
20282028
if (paramList.size() > 0) {
20292029
this.namedParameterJdbcTemplate.batchUpdate(sqlString, paramList.toArray(new MapSqlParameterSource[paramList.size()]));
20302030
}
2031+
String setDateQuery = "SET @dt = CURDATE() - INTERVAL 6 MONTH;";
2032+
String setCountryIdQuery = "SET @realmCountryId = ?;";
2033+
this.jdbcTemplate.update(setDateQuery);
2034+
this.jdbcTemplate.update(setCountryIdQuery, input.getRealmCountryId());
2035+
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";
2036+
this.jdbcTemplate.execute(getCountryNameQuery);
20312037
StringBuilder sqlStringBuilder = new StringBuilder(""
20322038
+ "SELECT "
20332039
+ " e.`RO_NO`, e.RO_PRIME_LINE_NO, e.ORDER_NO, e.PRIME_LINE_NO, e.`ACTIVE` `ORDER_ACTIVE`, "
@@ -2053,19 +2059,16 @@ public List<ShipmentLinkingOutput> getNotLinkedErpShipmentsTab1AndTab3(NotLinked
20532059
+ "LEFT JOIN rm_procurement_agent_planning_unit papu on left(papu.SKU_CODE,12)=e.PLANNING_UNIT_SKU_CODE "
20542060
+ "LEFT JOIN vw_planning_unit pu ON pu.PLANNING_UNIT_ID=papu.PLANNING_UNIT_ID "
20552061
+ "LEFT JOIN rm_forecasting_unit fu ON pu.FORECASTING_UNIT_ID=fu.FORECASTING_UNIT_ID "
2056-
+ "LEFT JOIN rm_program p ON p.PROGRAM_ID=:shipmentProgramId "
2057-
+ "LEFT JOIN rm_realm_country rc ON (p.REALM_COUNTRY_ID=rc.REALM_COUNTRY_ID OR rc.REALM_COUNTRY_ID=:realmCountryId) "
2058-
+ "LEFT JOIN vw_country c ON rc.COUNTRY_ID=c.COUNTRY_ID "
20592062
+ "LEFT JOIN vw_planning_unit spu ON spu.PLANNING_UNIT_ID=:shipmentPlanningUnitId "
20602063
+ "LEFT JOIN rm_forecasting_unit sfu ON spu.FORECASTING_UNIT_ID=sfu.FORECASTING_UNIT_ID "
20612064
+ "WHERE "
20622065
+ " o1.RO_NO IS NOT NULL "
2063-
+ " AND (papu.PLANNING_UNIT_ID = :filterPlanningUnitId OR :filterPlanningUnitId = 0) AND e.RECPIENT_COUNTRY=c.LABEL_EN "
2066+
+ " AND (papu.PLANNING_UNIT_ID = :filterPlanningUnitId OR :filterPlanningUnitId = 0) AND e.RECPIENT_COUNTRY=@countryName "
20642067
+ " AND e.ACTIVE "
20652068
+ " AND ("
2066-
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.`CURRENT_ESTIMATED_DELIVERY_DATE`,e.`AGREED_DELIVERY_DATE`,e.`REQ_DELIVERY_DATE`) < CURDATE() - INTERVAL 6 MONTH AND "
2069+
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.`CURRENT_ESTIMATED_DELIVERY_DATE`,e.`AGREED_DELIVERY_DATE`,e.`REQ_DELIVERY_DATE`) < @dt AND "
20672070
+ " sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,2,3,5,7,9,10,13,15) OR "
2068-
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.`CURRENT_ESTIMATED_DELIVERY_DATE`,e.`AGREED_DELIVERY_DATE`,e.`REQ_DELIVERY_DATE`) >= CURDATE() - INTERVAL 6 MONTH AND "
2071+
+ " COALESCE(s.ACTUAL_DELIVERY_DATE, e.`CURRENT_ESTIMATED_DELIVERY_DATE`,e.`AGREED_DELIVERY_DATE`,e.`REQ_DELIVERY_DATE`) >= @dt AND "
20692072
+ " sm.SHIPMENT_STATUS_MAPPING_ID NOT IN (1,3,5,7,9,10,13,15)) "
20702073
+ " AND (slt.SHIPMENT_LINKING_TRANS_ID IS NULL OR dl.RO_NO IS NOT NULL) "
20712074
+ " AND sfu.TRACER_CATEGORY_ID=fu.TRACER_CATEGORY_ID "

src/main/java/cc/altius/FASP/jwt/JWTWebSecurityConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
3030

3131
@Configuration
32-
@EnableWebSecurity(debug = true)
32+
@EnableWebSecurity
3333
@Order(1000)
3434
public class JWTWebSecurityConfig {
3535

src/main/java/cc/altius/FASP/service/impl/ProgramServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public int addProgram(ProgramInitialize p, CustomUserDetails curUser) throws Acc
163163
public int updateProgram(ProgramInitialize p, CustomUserDetails curUser) throws AccessControlFailedException {
164164
if (p.getProgramId() != 0) {
165165
try {
166-
this.programCommonDao.getSimpleProgramById(p.getProgramId(), GlobalConstants.PROGRAM_TYPE_SUPPLY_PLAN, curUser);
166+
this.programCommonDao.getSimpleProgramById(p.getProgramId(), p.getProgramTypeId(), curUser);
167167
} catch (EmptyResultDataAccessException e) {
168168
throw new AccessControlFailedException();
169169
}

src/main/resources/application.properties

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ jwt.token.expiration.in.seconds=21600
2626
session.expiry.time=1800
2727
syncExpiresOn=15
2828

29-
logging.level.org.springframework.security=TRACE
30-
3129
info.app.name=QAT
3230
info.app.description=Quantification Analytics Tool
33-
info.app.version=2.94[5233]
34-
info.app.frontEndVersion=[13304]
31+
info.app.version=2.95[5545]
32+
info.app.frontEndVersion=[13327]
3533
management.endpoints.web.exposure.include=*
3634
management.info.env.enabled = true
3735
management.endpoint.sessions.enabled=true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
UPDATE ap_static_label_languages
2+
LEFT JOIN ap_static_label ON ap_static_label.STATIC_LABEL_ID=ap_static_label_languages.STATIC_LABEL_ID
3+
SET ap_static_label_languages.LABEL_TEXT='If you delink a shipment, the manual QAT shipment will retain the linked details. If the linked shipment has not been uploaded to the server, it will revert to the original manual shipment`s details.' where ap_static_label.LABEL_CODE='static.mt.reminders4A'
4+
and ap_static_label_languages.LANGUAGE_ID=1;
5+
6+
UPDATE ap_static_label_languages
7+
LEFT JOIN ap_static_label ON ap_static_label.STATIC_LABEL_ID=ap_static_label_languages.STATIC_LABEL_ID
8+
SET ap_static_label_languages.LABEL_TEXT='Si vous supprimez le lien d`une expédition, l`expédition manuelle QAT conservera les détails liés. Si l`expédition liée n`a pas été téléchargée sur le serveur, elle reviendra aux détails de l`expédition manuelle d`origine.' where ap_static_label.LABEL_CODE='static.mt.reminders4A'
9+
and ap_static_label_languages.LANGUAGE_ID=2;
10+
11+
UPDATE ap_static_label_languages
12+
LEFT JOIN ap_static_label ON ap_static_label.STATIC_LABEL_ID=ap_static_label_languages.STATIC_LABEL_ID
13+
SET ap_static_label_languages.LABEL_TEXT='Si desvincula un envío, el envío manual de QAT conservará los detalles vinculados. Si el envío vinculado no se ha cargado al servidor, volverá a los detalles del envío manual original.' where ap_static_label.LABEL_CODE='static.mt.reminders4A'
14+
and ap_static_label_languages.LANGUAGE_ID=3;
15+
16+
UPDATE ap_static_label_languages
17+
LEFT JOIN ap_static_label ON ap_static_label.STATIC_LABEL_ID=ap_static_label_languages.STATIC_LABEL_ID
18+
SET ap_static_label_languages.LABEL_TEXT='Se desvincular uma remessa, a remessa QAT manual manterá os dados vinculados. Se a remessa vinculada não tiver sido carregada no servidor, os detalhes da remessa manual original serão revertidos.' where ap_static_label.LABEL_CODE='static.mt.reminders4A'
19+
and ap_static_label_languages.LANGUAGE_ID=4;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20241202-QAT-4505.sql
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20241202-QAT-4505.sql
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# To change this license header, choose License Headers in Project Properties.
22
# To change this template file, choose Tools | Templates
33
# and open the template in the editor.
4-
version.major=2.94
5-
version.minor=5233
4+
version.major=2.95
5+
version.minor=5545

0 commit comments

Comments
 (0)