feat: カラム変更に対応(画面がまだ表示できていない)
This commit is contained in:
parent
6f715e96e5
commit
04396eb1d5
@ -21,5 +21,7 @@ DB_SCHEMA=src05
|
|||||||
AWS_REGION=ap-northeast-1
|
AWS_REGION=ap-northeast-1
|
||||||
AUTHORIZE_ENDPOINT=oauth2/authorize
|
AUTHORIZE_ENDPOINT=oauth2/authorize
|
||||||
TOKEN_ENDPOINT=oauth2/token
|
TOKEN_ENDPOINT=oauth2/token
|
||||||
|
LOGOUT_ENDPOINT=logout
|
||||||
BIO_SEARCH_RESULT_MAX_COUNT=35000
|
BIO_SEARCH_RESULT_MAX_COUNT=35000
|
||||||
SESSION_EXPIRE_MINUTE=20
|
SESSION_EXPIRE_MINUTE=20
|
||||||
|
LOG_LEVEL=DEBUG
|
||||||
@ -23,7 +23,7 @@
|
|||||||
- Merck_NewDWH開発2021のWiki、[Python環境構築](https://nds-tyo.backlog.com/alias/wiki/1874930)を参照
|
- Merck_NewDWH開発2021のWiki、[Python環境構築](https://nds-tyo.backlog.com/alias/wiki/1874930)を参照
|
||||||
- 「Pipenvの導入」までを行っておくこと
|
- 「Pipenvの導入」までを行っておくこと
|
||||||
- 構築完了後、プロジェクト配下で以下のコマンドを実行し、Pythonの仮想環境を作成する
|
- 構築完了後、プロジェクト配下で以下のコマンドを実行し、Pythonの仮想環境を作成する
|
||||||
- `pipenv install --python <pyenvでインストールしたpythonバージョン>`
|
- `pipenv install --python <pyenvでインストールしたpythonバージョン> --dev`
|
||||||
- この手順で出力される仮想環境のパスは、後述するVSCodeの設定手順で使用するため、控えておく
|
- この手順で出力される仮想環境のパスは、後述するVSCodeの設定手順で使用するため、控えておく
|
||||||
|
|
||||||
- MySQLの環境構築
|
- MySQLの環境構築
|
||||||
|
|||||||
@ -4,6 +4,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request
|
|||||||
from starlette import status
|
from starlette import status
|
||||||
|
|
||||||
from src.depends.services import get_service
|
from src.depends.services import get_service
|
||||||
|
from src.logging.get_logger import get_logger
|
||||||
from src.model.internal.session import UserSession
|
from src.model.internal.session import UserSession
|
||||||
from src.model.request.bio import BioModel
|
from src.model.request.bio import BioModel
|
||||||
from src.model.view.bio_view_model import BioViewModel
|
from src.model.view.bio_view_model import BioViewModel
|
||||||
@ -16,6 +17,7 @@ from src.templates import templates
|
|||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
router.route_class = AuthenticatedRoute
|
router.route_class = AuthenticatedRoute
|
||||||
|
logger = get_logger('生物由来参照')
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Views #
|
# Views #
|
||||||
@ -32,6 +34,8 @@ def bio_view(
|
|||||||
# バッチ処理中の場合、機能を利用させない
|
# バッチ処理中の場合、機能を利用させない
|
||||||
if batch_status_service.is_batch_processing():
|
if batch_status_service.is_batch_processing():
|
||||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=constants.LOGOUT_REASON_BATCH_PROCESSING)
|
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=constants.LOGOUT_REASON_BATCH_PROCESSING)
|
||||||
|
|
||||||
|
logger.debug(f'UserId: {session.user_id}')
|
||||||
# 検索項目の取得
|
# 検索項目の取得
|
||||||
bio = bio_service.prepare_bio_view(session)
|
bio = bio_service.prepare_bio_view(session)
|
||||||
# セッション書き換え
|
# セッション書き換え
|
||||||
@ -59,7 +63,6 @@ def search_bio(
|
|||||||
bio_service: BioViewService = Depends(get_service(BioViewService)),
|
bio_service: BioViewService = Depends(get_service(BioViewService)),
|
||||||
batch_status_service: BatchStatusService = Depends(get_service(BatchStatusService))
|
batch_status_service: BatchStatusService = Depends(get_service(BatchStatusService))
|
||||||
):
|
):
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] UserId:" . $UserId . "\r\n", 3, "$execLog");
|
|
||||||
session: UserSession = request.session
|
session: UserSession = request.session
|
||||||
# バッチ処理中の場合、機能を利用させない
|
# バッチ処理中の場合、機能を利用させない
|
||||||
if batch_status_service.is_batch_processing():
|
if batch_status_service.is_batch_processing():
|
||||||
|
|||||||
@ -77,10 +77,10 @@ async def download_bio_data(
|
|||||||
extract_df.loc[:, 'lot_no_err_flg'] = extract_df['lot_no_err_flg'].apply(
|
extract_df.loc[:, 'lot_no_err_flg'] = extract_df['lot_no_err_flg'].apply(
|
||||||
lambda key: constants.LOT_NO_ERR_FLG_JP_NAME.get(key))
|
lambda key: constants.LOT_NO_ERR_FLG_JP_NAME.get(key))
|
||||||
# 訂正前伝票管理番号がセットされているときのみ修正日時、修正者、エラー詳細種別をセット
|
# 訂正前伝票管理番号がセットされているときのみ修正日時、修正者、エラー詳細種別をセット
|
||||||
extract_df.loc[:, 'ins_dt'] = extract_df['bef_slip_mgt_no'].apply(
|
extract_df.loc[:, 'ins_dt'] = extract_df['bef_slip_mgt_num'].apply(
|
||||||
lambda bef_slip_mgt_no: extract_df['ins_dt'] if bef_slip_mgt_no is not None else '')
|
lambda bef_slip_mgt_num: extract_df['ins_dt'] if bef_slip_mgt_num is not None else '')
|
||||||
extract_df.loc[:, 'ins_usr'] = extract_df['bef_slip_mgt_no'].apply(
|
extract_df.loc[:, 'ins_usr'] = extract_df['bef_slip_mgt_num'].apply(
|
||||||
lambda bef_slip_mgt_no: extract_df['ins_usr'] if bef_slip_mgt_no is not None else '')
|
lambda bef_slip_mgt_num: extract_df['ins_usr'] if bef_slip_mgt_num is not None else '')
|
||||||
|
|
||||||
# 種別によって出力を変える
|
# 種別によって出力を変える
|
||||||
local_file_path = ''
|
local_file_path = ''
|
||||||
|
|||||||
@ -15,28 +15,28 @@ class BioSalesViewModel(BaseDBModel):
|
|||||||
rec_tran_kbn: Optional[str]
|
rec_tran_kbn: Optional[str]
|
||||||
rev_hsdnymd_wrk: Optional[str]
|
rev_hsdnymd_wrk: Optional[str]
|
||||||
rev_hsdnymd_srk: Optional[str]
|
rev_hsdnymd_srk: Optional[str]
|
||||||
rec_urag_no: Optional[str]
|
rec_urag_num: Optional[str]
|
||||||
rec_comm_nm: Optional[str]
|
rec_comm_name: Optional[str]
|
||||||
rec_nnskfcl_nm: Optional[str]
|
rec_nonyu_fcl_name: Optional[str]
|
||||||
rec_nnsk_fcl_addr: Optional[str]
|
rec_nonyu_fcl_addr: Optional[str]
|
||||||
rec_lot_num: Optional[str]
|
rec_lot_num: Optional[str]
|
||||||
rec_amt: Optional[str]
|
rec_qty: Optional[str]
|
||||||
rec_ymd: Optional[str]
|
rec_ymd: Optional[str]
|
||||||
sale_data_cat: Optional[str]
|
sale_data_cat: Optional[str]
|
||||||
slip_file_nm: Optional[str]
|
slip_file_name: Optional[str]
|
||||||
slip_mgt_no: Optional[str]
|
slip_mgt_num: Optional[str]
|
||||||
row_num: Optional[int]
|
row_num: Optional[int]
|
||||||
hsdn_ymd: Optional[str]
|
hsdn_ymd: Optional[str]
|
||||||
exec_dt: Optional[str]
|
exec_dt: Optional[str]
|
||||||
v_tran_cd: Optional[int]
|
v_tran_cd: Optional[int]
|
||||||
tran_kbn_nm: Optional[str]
|
tran_kbn_name: Optional[str]
|
||||||
whs_org_cd: Optional[str]
|
whs_org_cd: Optional[str]
|
||||||
v_whsorg_cd: Optional[str]
|
v_whsorg_cd: Optional[str]
|
||||||
whs_org_nm: Optional[str]
|
whs_org_name: Optional[str]
|
||||||
whs_org_kn: Optional[str]
|
whs_org_kn: Optional[str]
|
||||||
v_whs_cd: Optional[int]
|
v_whs_cd: Optional[int]
|
||||||
whs_nm: Optional[str]
|
whs_name: Optional[str]
|
||||||
nnsk_cd: Optional[str]
|
nonyu_fcl_cd: Optional[str]
|
||||||
v_inst_cd: Optional[str]
|
v_inst_cd: Optional[str]
|
||||||
v_inst_kn: Optional[str]
|
v_inst_kn: Optional[str]
|
||||||
v_inst_nm: Optional[str]
|
v_inst_nm: Optional[str]
|
||||||
@ -53,7 +53,7 @@ class BioSalesViewModel(BaseDBModel):
|
|||||||
fcl_exis_kbn: Optional[str]
|
fcl_exis_kbn: Optional[str]
|
||||||
amt: Optional[int]
|
amt: Optional[int]
|
||||||
slip_org_kbn: Optional[str]
|
slip_org_kbn: Optional[str]
|
||||||
bef_slip_mgt_no: Optional[str]
|
bef_slip_mgt_num: Optional[str]
|
||||||
lot_no_err_flg: Optional[str]
|
lot_no_err_flg: Optional[str]
|
||||||
iko_flg: Optional[str]
|
iko_flg: Optional[str]
|
||||||
kjyo_ym: Optional[str]
|
kjyo_ym: Optional[str]
|
||||||
|
|||||||
@ -4,4 +4,4 @@ from src.model.db.base_db_model import BaseDBModel
|
|||||||
|
|
||||||
|
|
||||||
class PharmacyProductMasterModel(BaseDBModel):
|
class PharmacyProductMasterModel(BaseDBModel):
|
||||||
mkr_cd_nm: Optional[str]
|
mkr_cd_name: Optional[str]
|
||||||
|
|||||||
@ -6,5 +6,5 @@ from src.model.db.base_db_model import BaseDBModel
|
|||||||
class WholesalerMasterModel(BaseDBModel):
|
class WholesalerMasterModel(BaseDBModel):
|
||||||
rec_whs_cd: Optional[str]
|
rec_whs_cd: Optional[str]
|
||||||
rec_whs_sub_cd: Optional[str]
|
rec_whs_sub_cd: Optional[str]
|
||||||
nm: Optional[str]
|
name: Optional[str]
|
||||||
whs_nm: Optional[str]
|
whs_name: Optional[str]
|
||||||
|
|||||||
@ -14,6 +14,6 @@ class BisDisplayModel(BioSalesViewModel):
|
|||||||
self.lot_no_err_flg = constants.LOT_NO_ERR_FLG_JP_NAME.get(self.lot_no_err_flg)
|
self.lot_no_err_flg = constants.LOT_NO_ERR_FLG_JP_NAME.get(self.lot_no_err_flg)
|
||||||
|
|
||||||
# 訂正前伝票管理番号がセットされているときのみ修正日時、修正者、エラー詳細種別をセット
|
# 訂正前伝票管理番号がセットされているときのみ修正日時、修正者、エラー詳細種別をセット
|
||||||
if (self.bef_slip_mgt_no is None):
|
if (self.bef_slip_mgt_num is None):
|
||||||
self.ins_dt = ""
|
self.ins_dt = ""
|
||||||
self.ins_usr = ""
|
self.ins_usr = ""
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class BioViewModel(BaseModel):
|
|||||||
|
|
||||||
def display_wholesaler_names(self):
|
def display_wholesaler_names(self):
|
||||||
display_names = [
|
display_names = [
|
||||||
f'{whs_model.rec_whs_cd}-{whs_model.rec_whs_sub_cd}:{whs_model.nm}'
|
f'{whs_model.rec_whs_cd}-{whs_model.rec_whs_sub_cd}:{whs_model.name}'
|
||||||
for whs_model in self.whs_models
|
for whs_model in self.whs_models
|
||||||
]
|
]
|
||||||
return display_names
|
return display_names
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
from src.db import sql_condition as condition
|
from src.db import sql_condition as condition
|
||||||
from src.db.sql_condition import SQLCondition
|
from src.db.sql_condition import SQLCondition
|
||||||
|
from src.logging.get_logger import get_logger
|
||||||
from src.model.db.bio_sales_view import BioSalesViewModel
|
from src.model.db.bio_sales_view import BioSalesViewModel
|
||||||
from src.model.request.bio import BioModel
|
from src.model.request.bio import BioModel
|
||||||
from src.repositories.base_repository import BaseRepository
|
from src.repositories.base_repository import BaseRepository
|
||||||
from src.util.string_util import is_not_empty
|
from src.util.string_util import is_not_empty
|
||||||
|
|
||||||
|
logger = get_logger('生物由来参照')
|
||||||
|
|
||||||
|
|
||||||
class BioSalesViewRepository(BaseRepository):
|
class BioSalesViewRepository(BaseRepository):
|
||||||
FETCH_SQL = """\
|
FETCH_SQL = """\
|
||||||
@ -12,19 +15,19 @@ class BioSalesViewRepository(BaseRepository):
|
|||||||
(
|
(
|
||||||
CASE
|
CASE
|
||||||
WHEN LEFT(bs.v_tran_cd, 1) = 2
|
WHEN LEFT(bs.v_tran_cd, 1) = 2
|
||||||
AND bs.amt >= 1 THEN CONCAT('-', bs.amt)
|
AND bs.qty >= 1 THEN CONCAT('-', bs.qty)
|
||||||
ELSE bs.amt
|
ELSE bs.qty
|
||||||
END
|
END
|
||||||
) AS amt_fugo,
|
) AS amt_fugo,
|
||||||
bs.*,
|
bs.*,
|
||||||
ln.ser_no,
|
ln.ser_num,
|
||||||
ln.lot_num,
|
ln.lot_num,
|
||||||
ln.expr_dt
|
ln.expr_dt
|
||||||
FROM
|
FROM
|
||||||
src05.bio_sales_view bs
|
src05.bio_sales_view bs
|
||||||
LEFT OUTER JOIN
|
LEFT OUTER JOIN
|
||||||
src05.lot_num_mst ln
|
src05.lot_num_mst ln
|
||||||
ON bs.mkr_cd = ln.ser_no
|
ON bs.mkr_cd = ln.ser_num
|
||||||
AND bs.rec_lot_num = ln.lot_num
|
AND bs.rec_lot_num = ln.lot_num
|
||||||
WHERE
|
WHERE
|
||||||
{where_clause}
|
{where_clause}
|
||||||
@ -32,25 +35,23 @@ class BioSalesViewRepository(BaseRepository):
|
|||||||
bs.rec_whs_cd,
|
bs.rec_whs_cd,
|
||||||
bs.rec_whs_sub_cd,
|
bs.rec_whs_sub_cd,
|
||||||
bs.rev_hsdnymd_srk,
|
bs.rev_hsdnymd_srk,
|
||||||
bs.slip_mgt_no
|
bs.slip_mgt_num
|
||||||
ASC\
|
ASC\
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def fetch_many(self, parameter: BioModel) -> list[BioSalesViewModel]:
|
def fetch_many(self, parameter: BioModel) -> list[BioSalesViewModel]:
|
||||||
try:
|
try:
|
||||||
self._database.connect()
|
self._database.connect()
|
||||||
|
logger.debug('DB参照実行')
|
||||||
where_clause = self.__build_condition(parameter)
|
where_clause = self.__build_condition(parameter)
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] DB Return=" . $result . "\r\n", 3, "$execLog");
|
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] DB参照実行" . "\r\n", 3, "$execLog");
|
|
||||||
query = self.FETCH_SQL.format(where_clause=where_clause)
|
query = self.FETCH_SQL.format(where_clause=where_clause)
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] SQL: " . $query . "\r\n", 3, "$execLog");
|
logger.debug(f'SQL: {query}')
|
||||||
result = self._database.execute_select(query, parameter.dict())
|
result = self._database.execute_select(query, parameter.dict())
|
||||||
|
logger.debug(f'count= {len(result)}')
|
||||||
models = [BioSalesViewModel(**r) for r in result]
|
models = [BioSalesViewModel(**r) for r in result]
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] count=" . $count . "\r\n", 3, "$execLog");
|
|
||||||
return models
|
return models
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# TODO: ファイルへの書き出しはloggerでやる
|
logger.exception(f"DB Error : Exception={e.args}")
|
||||||
print(f"[ERROR] DB Error : Exception={e.args}")
|
|
||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
self._database.disconnect()
|
self._database.disconnect()
|
||||||
@ -58,18 +59,15 @@ class BioSalesViewRepository(BaseRepository):
|
|||||||
def fetch_as_data_frame(self, parameter: BioModel):
|
def fetch_as_data_frame(self, parameter: BioModel):
|
||||||
try:
|
try:
|
||||||
self._database.connect()
|
self._database.connect()
|
||||||
|
logger.debug('DB参照実行')
|
||||||
where_clause = self.__build_condition(parameter)
|
where_clause = self.__build_condition(parameter)
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] DB Return=" . $result . "\r\n", 3, "$execLog");
|
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] DB参照実行" . "\r\n", 3, "$execLog");
|
|
||||||
query = self.FETCH_SQL.format(where_clause=where_clause)
|
query = self.FETCH_SQL.format(where_clause=where_clause)
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] SQL: " . $query . "\r\n", 3, "$execLog");
|
logger.debug(f'SQL: {query}')
|
||||||
# models = [BioSalesViewModel(**r) for r in result]
|
|
||||||
# error_log(date("Y/m/d H:i:s") . " [INFO] count=" . $count . "\r\n", 3, "$execLog");
|
|
||||||
df = self._to_data_frame(query, parameter)
|
df = self._to_data_frame(query, parameter)
|
||||||
|
logger.debug(f'count= {len(df.index)}')
|
||||||
return df
|
return df
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# TODO: ファイルへの書き出しはloggerでやる
|
logger.exception(f"DB Error : Exception={e.args}")
|
||||||
print(f"[ERROR] DB Error : Exception={e.args}")
|
|
||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
self._database.disconnect()
|
self._database.disconnect()
|
||||||
|
|||||||
@ -6,21 +6,21 @@ class PharmacyProductMasterRepository(BaseRepository):
|
|||||||
|
|
||||||
FETCH_SQL = """\
|
FETCH_SQL = """\
|
||||||
SELECT
|
SELECT
|
||||||
CONCAT(IFNULL(mkr_cd, ''), ' ', IFNULL(mkr_inf_1, '')) AS mkr_cd_nm
|
CONCAT(IFNULL(t1.mkr_cd, ''), ' ', IFNULL(t1.mkr_inf_1, '')) AS mkr_cd_name
|
||||||
FROM
|
FROM
|
||||||
src05.phm_prd_mst_v t1
|
src05.phm_prd_mst_v t1
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
prd_cd,MAX(sub_no) AS sno
|
prd_cd, MAX(sub_num) AS sno
|
||||||
FROM
|
FROM
|
||||||
src05.phm_prd_mst_v
|
src05.phm_prd_mst_v
|
||||||
WHERE rec_sts_kbn <> '9'
|
WHERE rec_sts_kbn <> '9'
|
||||||
GROUP BY prd_cd
|
GROUP BY prd_cd
|
||||||
) fmv2
|
) fmv2
|
||||||
ON t1.prd_cd = fmv2.prd_cd AND t1.sub_no = fmv2.sno
|
ON t1.prd_cd = fmv2.prd_cd AND t1.sub_num = fmv2.sno
|
||||||
WHERE
|
WHERE
|
||||||
mkr_cd IS NOT NULL
|
t1.mkr_cd IS NOT NULL
|
||||||
ORDER BY mkr_cd
|
ORDER BY mkr_cd
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -8,18 +8,22 @@ class WholesalerMasterRepository(BaseRepository):
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
b.rec_whs_cd,
|
b.rec_whs_cd,
|
||||||
b.rec_whs_sub_cd,
|
b.rec_whs_sub_cd,
|
||||||
v2.nm,
|
v2.name,
|
||||||
b.whs_nm
|
b.whs_name
|
||||||
FROM src05.bio_sales b
|
FROM src05.bio_sales b
|
||||||
LEFT OUTER JOIN
|
LEFT OUTER JOIN
|
||||||
(
|
(
|
||||||
SELECT sub_no, nm, v_whs_cd, rec_sts_kbn
|
SELECT
|
||||||
|
sub_num,
|
||||||
|
name,
|
||||||
|
v_whs_cd,
|
||||||
|
rec_sts_kbn
|
||||||
FROM src05.whs_mst_v
|
FROM src05.whs_mst_v
|
||||||
WHERE (SELECT STR_TO_DATE(syor_date, '%Y%m%d') FROM src05.hdke_tbl) BETWEEN start_date AND end_date
|
WHERE (SELECT STR_TO_DATE(syor_date, '%Y%m%d') FROM src05.hdke_tbl) BETWEEN start_date AND end_date
|
||||||
) v2
|
) v2
|
||||||
ON b.v_whs_cd = v2.v_whs_cd
|
ON b.v_whs_cd = v2.v_whs_cd
|
||||||
AND v2.rec_sts_kbn <> '9'
|
AND v2.rec_sts_kbn <> '9'
|
||||||
ORDER BY b.rec_whs_cd, b.rec_whs_sub_cd , b.whs_nm DESC
|
ORDER BY b.rec_whs_cd, b.rec_whs_sub_cd , b.whs_name DESC
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def fetch_all(self) -> list[WholesalerMasterModel]:
|
def fetch_all(self) -> list[WholesalerMasterModel]:
|
||||||
|
|||||||
65
ecs/jskult-webapp/src/services/logout_service.py
Normal file
65
ecs/jskult-webapp/src/services/logout_service.py
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
# import base64
|
||||||
|
# import hashlib
|
||||||
|
# import hmac
|
||||||
|
|
||||||
|
# import requests
|
||||||
|
|
||||||
|
# from src.aws.aws_api_client import AWSAPIClient
|
||||||
|
# from src.aws.cognito import CognitoClient
|
||||||
|
# from src.error.exceptions import NotAuthorizeException
|
||||||
|
# from src.model.db.user_master import UserMasterModel
|
||||||
|
# from src.model.internal.jwt_token import JWTToken
|
||||||
|
# from src.repositories.base_repository import BaseRepository
|
||||||
|
# from src.repositories.user_master_repository import UserMasterRepository
|
||||||
|
# from src.services.base_service import BaseService
|
||||||
|
# from src.system_var import environment
|
||||||
|
|
||||||
|
|
||||||
|
# class LogoutService(BaseService):
|
||||||
|
# REPOSITORIES = {
|
||||||
|
# 'user_repository': UserMasterRepository
|
||||||
|
# }
|
||||||
|
|
||||||
|
# CLIENTS = {
|
||||||
|
# 'cognito_client': CognitoClient
|
||||||
|
# }
|
||||||
|
|
||||||
|
# def __init__(self, repositories: dict[str, BaseRepository], clients: dict[str, AWSAPIClient]) -> None:
|
||||||
|
# super().__init__(repositories, clients)
|
||||||
|
# self.user_repository = repositories['user_repository']
|
||||||
|
# self.cognito_client = clients['cognito_client']
|
||||||
|
|
||||||
|
# def logout(self) -> None:
|
||||||
|
# logout_endpoint = f'{environment.COGNITO_AUTH_DOMAIN}/{environment.LOGOUT_ENDPOINT}'
|
||||||
|
# request_params = {
|
||||||
|
# 'client_id': environment.COGNITO_CLIENT_ID,
|
||||||
|
# 'code': code,
|
||||||
|
# 'redirect_uri': environment.COGNITO_REDIRECT_URI
|
||||||
|
# }
|
||||||
|
# try:
|
||||||
|
# id_token, refresh_token = self.cognito_client.login_by_user_password_flow(
|
||||||
|
# username,
|
||||||
|
# password,
|
||||||
|
# self.__secret_hash(username)
|
||||||
|
# )
|
||||||
|
# except Exception as e:
|
||||||
|
# if e.response['Error']['Code'] == 'NotAuthorizedException':
|
||||||
|
# raise NotAuthorizeException(e)
|
||||||
|
# else:
|
||||||
|
# raise e
|
||||||
|
|
||||||
|
# return JWTToken(id_token, refresh_token)
|
||||||
|
|
||||||
|
# def login_with_security_code(self, code: str) -> JWTToken:
|
||||||
|
# return JWTToken.request(code)
|
||||||
|
|
||||||
|
# def logged_in_user(self, user_id):
|
||||||
|
# user_record: UserMasterModel = self.user_repository.fetch_one({'user_id': user_id})
|
||||||
|
# return user_record
|
||||||
|
|
||||||
|
# def __secret_hash(self, username: str):
|
||||||
|
# # see - https://aws.amazon.com/jp/premiumsupport/knowledge-center/cognito-unable-to-verify-secret-hash/ # noqa
|
||||||
|
# message = bytes(username + environment.COGNITO_CLIENT_ID, 'utf-8')
|
||||||
|
# key = bytes(environment.COGNITO_CLIENT_SECRET, 'utf-8')
|
||||||
|
# digest = hmac.new(key, message, digestmod=hashlib.sha256).digest()
|
||||||
|
# return base64.b64encode(digest).decode()
|
||||||
@ -5,31 +5,31 @@ BIO_EXCEL_TEMPLATE_FILE_PATH = path.join(BIO_TEMPORARY_FILE_DIR_PATH, 'BioData_t
|
|||||||
|
|
||||||
BIO_EXTRACT_COLUMNS = [
|
BIO_EXTRACT_COLUMNS = [
|
||||||
'slip_org_kbn',
|
'slip_org_kbn',
|
||||||
'slip_mgt_no',
|
'slip_mgt_num',
|
||||||
'rec_ymd',
|
'rec_ymd',
|
||||||
'rec_whs_cd',
|
'rec_whs_cd',
|
||||||
'rec_whs_sub_cd',
|
'rec_whs_sub_cd',
|
||||||
'whs_nm',
|
'whs_name',
|
||||||
'rec_whs_org_cd',
|
'rec_whs_org_cd',
|
||||||
'rec_urag_no',
|
'rec_urag_num',
|
||||||
'rev_hsdnymd_srk',
|
'rev_hsdnymd_srk',
|
||||||
'rec_tran_kbn',
|
'rec_tran_kbn',
|
||||||
'tran_kbn_nm',
|
'tran_kbn_name',
|
||||||
'mkr_cd',
|
'mkr_cd',
|
||||||
'rec_comm_cd',
|
'rec_comm_cd',
|
||||||
'comm_nm',
|
'comm_nm',
|
||||||
'whs_rep_comm_nm',
|
'whs_rep_comm_nm',
|
||||||
'nnsk_cd',
|
'nonyu_fcl_cd',
|
||||||
'rec_nnskfcl_nm',
|
'rec_nonyu_fcl_name',
|
||||||
'whs_rep_nnskfcl_nm',
|
'whs_rep_nnskfcl_nm',
|
||||||
'rec_nnsk_fcl_addr',
|
'rec_nonyu_fcl_addr',
|
||||||
'whs_rep_nnsk_fcl_addr',
|
'whs_rep_nnsk_fcl_addr',
|
||||||
'rec_lot_num',
|
'rec_lot_num',
|
||||||
'amt_fugo',
|
'amt_fugo',
|
||||||
'expr_dt',
|
'expr_dt',
|
||||||
'data_kbn',
|
'data_kbn',
|
||||||
'lot_no_err_flg',
|
'lot_no_err_flg',
|
||||||
'bef_slip_mgt_no',
|
'bef_slip_mgt_num',
|
||||||
'ins_usr',
|
'ins_usr',
|
||||||
'ins_dt',
|
'ins_dt',
|
||||||
'inst_cd',
|
'inst_cd',
|
||||||
@ -38,7 +38,7 @@ BIO_EXTRACT_COLUMNS = [
|
|||||||
'tel_no',
|
'tel_no',
|
||||||
'v_whs_cd',
|
'v_whs_cd',
|
||||||
'v_whsorg_cd',
|
'v_whsorg_cd',
|
||||||
'whs_org_nm',
|
'whs_org_name',
|
||||||
'v_tran_cd',
|
'v_tran_cd',
|
||||||
'iko_flg'
|
'iko_flg'
|
||||||
]
|
]
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import os
|
|||||||
COGNITO_AUTH_DOMAIN = os.environ['COGNITO_AUTH_DOMAIN']
|
COGNITO_AUTH_DOMAIN = os.environ['COGNITO_AUTH_DOMAIN']
|
||||||
AUTHORIZE_ENDPOINT = os.environ['AUTHORIZE_ENDPOINT']
|
AUTHORIZE_ENDPOINT = os.environ['AUTHORIZE_ENDPOINT']
|
||||||
TOKEN_ENDPOINT = os.environ['TOKEN_ENDPOINT']
|
TOKEN_ENDPOINT = os.environ['TOKEN_ENDPOINT']
|
||||||
|
LOGOUT_ENDPOINT = os.environ['LOGOUT_ENDPOINT']
|
||||||
COGNITO_IDENTITY_PROVIDER = os.environ['COGNITO_IDENTITY_PROVIDER']
|
COGNITO_IDENTITY_PROVIDER = os.environ['COGNITO_IDENTITY_PROVIDER']
|
||||||
COGNITO_REDIRECT_URI = os.environ['COGNITO_REDIRECT_URI']
|
COGNITO_REDIRECT_URI = os.environ['COGNITO_REDIRECT_URI']
|
||||||
COGNITO_USER_POOL_ID = os.environ['COGNITO_USER_POOL_ID']
|
COGNITO_USER_POOL_ID = os.environ['COGNITO_USER_POOL_ID']
|
||||||
@ -20,3 +21,5 @@ DB_SCHEMA = os.environ['DB_SCHEMA']
|
|||||||
|
|
||||||
BIO_SEARCH_RESULT_MAX_COUNT = int(os.environ['BIO_SEARCH_RESULT_MAX_COUNT'])
|
BIO_SEARCH_RESULT_MAX_COUNT = int(os.environ['BIO_SEARCH_RESULT_MAX_COUNT'])
|
||||||
SESSION_EXPIRE_MINUTE = int(os.environ['SESSION_EXPIRE_MINUTE'])
|
SESSION_EXPIRE_MINUTE = int(os.environ['SESSION_EXPIRE_MINUTE'])
|
||||||
|
|
||||||
|
LOG_LEVEL = os.environ.get('LOG_LEVEL', 'INFO')
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
<select class="text search_dropdown" name="ctrl_wholesaler" value="" onChange="formBtDisabled();">
|
<select class="text search_dropdown" name="ctrl_wholesaler" value="" onChange="formBtDisabled();">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{% for whs_name in bio.display_wholesaler_names() %}
|
{% for whs_name in bio.display_wholesaler_names() %}
|
||||||
<option
|
<option
|
||||||
value="{{whs_name}}"
|
value="{{whs_name}}"
|
||||||
{{bio.is_selected_whs_name(whs_name)}}>
|
{{bio.is_selected_whs_name(whs_name)}}>
|
||||||
{{whs_name}}
|
{{whs_name}}
|
||||||
@ -61,7 +61,7 @@
|
|||||||
onblur="autoModifyDate(this)"
|
onblur="autoModifyDate(this)"
|
||||||
>
|
>
|
||||||
~
|
~
|
||||||
<input type="text" id="shoribi_end" class="date_picker" name="ctrl_rec_ymd_to"
|
<input type="text" id="shoribi_end" class="date_picker" name="ctrl_rec_ymd_to"
|
||||||
value="{{bio.is_input_rec_ymd_to()}}"
|
value="{{bio.is_input_rec_ymd_to()}}"
|
||||||
onchange="formBtDisabled()"
|
onchange="formBtDisabled()"
|
||||||
onblur="autoModifyDate(this)"
|
onblur="autoModifyDate(this)"
|
||||||
@ -71,8 +71,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>ロット番号:</td>
|
<td>ロット番号:</td>
|
||||||
<td class="search_tb">
|
<td class="search_tb">
|
||||||
<input class="text" type="text" id="lot_tb" name="ctrl_rec_lot_num" style="ime-mode:disabled" maxlength="10"
|
<input class="text" type="text" id="lot_tb" name="ctrl_rec_lot_num" style="ime-mode:disabled" maxlength="10"
|
||||||
value="{{bio.is_input_lot_num()}}"
|
value="{{bio.is_input_lot_num()}}"
|
||||||
oninput="checkSpaceForm(this); checkAimaiSearhForm(this); formBtDisabled()">
|
oninput="checkSpaceForm(this); checkAimaiSearhForm(this); formBtDisabled()">
|
||||||
</td>
|
</td>
|
||||||
<td>データ区分:</td>
|
<td>データ区分:</td>
|
||||||
@ -88,9 +88,9 @@
|
|||||||
<select class="text search_dropdown" name="ctrl_maker_cd" value="" onChange="formBtDisabled();">
|
<select class="text search_dropdown" name="ctrl_maker_cd" value="" onChange="formBtDisabled();">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{% for phm in bio.phm_models %}
|
{% for phm in bio.phm_models %}
|
||||||
<option
|
<option
|
||||||
value="{{phm['mkr_cd_nm']}}" {{bio.is_selected_maker_cd(phm['mkr_cd_nm'])}}>
|
value="{{phm['mkr_cd_name']}}" {{bio.is_selected_maker_cd(phm['mkr_cd_name'])}}>
|
||||||
{{phm['mkr_cd_nm']}}
|
{{phm['mkr_cd_name']}}
|
||||||
</option>
|
</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
@ -99,13 +99,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>発伝年月日:</td>
|
<td>発伝年月日:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<input type="text" id="shoribi_start" class="date_picker" name="ctrl_rev_hsdnymd_srk_from"
|
<input type="text" id="shoribi_start" class="date_picker" name="ctrl_rev_hsdnymd_srk_from"
|
||||||
value="{{bio.is_input_rev_hsdnymd_srk_from()}}"
|
value="{{bio.is_input_rev_hsdnymd_srk_from()}}"
|
||||||
onchange="formBtDisabled()"
|
onchange="formBtDisabled()"
|
||||||
onblur="autoModifyDate(this)"
|
onblur="autoModifyDate(this)"
|
||||||
>
|
>
|
||||||
~
|
~
|
||||||
<input type="text" id="shoribi_start" class="date_picker" name="ctrl_rev_hsdnymd_srk_to"
|
<input type="text" id="shoribi_start" class="date_picker" name="ctrl_rev_hsdnymd_srk_to"
|
||||||
value="{{bio.is_input_rev_hsdnymd_srk_to()}}"
|
value="{{bio.is_input_rev_hsdnymd_srk_to()}}"
|
||||||
onchange="formBtDisabled()"
|
onchange="formBtDisabled()"
|
||||||
onblur="autoModifyDate(this)"
|
onblur="autoModifyDate(this)"
|
||||||
@ -198,7 +198,7 @@
|
|||||||
// 検索パラメータを取得
|
// 検索パラメータを取得
|
||||||
const formData = $('#bio_search').serializeArray()
|
const formData = $('#bio_search').serializeArray()
|
||||||
// リクエスト用に加工
|
// リクエスト用に加工
|
||||||
const searchParams = {}
|
const searchParams = {}
|
||||||
for (let i = 0; i < formData.length; i++) {
|
for (let i = 0; i < formData.length; i++) {
|
||||||
searchParams[formData[i].name] = formData[i].value
|
searchParams[formData[i].name] = formData[i].value
|
||||||
}
|
}
|
||||||
@ -295,35 +295,35 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
function pagination_content(datas) {
|
function pagination_content(datas) {
|
||||||
const display_keys = [
|
const display_keys = [
|
||||||
'slip_org_kbn',
|
'slip_org_kbn',
|
||||||
'slip_mgt_no',
|
'slip_mgt_num',
|
||||||
'rec_ymd',
|
'rec_ymd',
|
||||||
'rec_whs_cd',
|
'rec_whs_cd',
|
||||||
'rec_whs_sub_cd',
|
'rec_whs_sub_cd',
|
||||||
'whs_nm',
|
'whs_name',
|
||||||
'rec_whs_org_cd',
|
'rec_whs_org_cd',
|
||||||
'rec_urag_no',
|
'rec_urag_num',
|
||||||
'rev_hsdnymd_srk',
|
'rev_hsdnymd_srk',
|
||||||
'rec_tran_kbn',
|
'rec_tran_kbn',
|
||||||
'tran_kbn_nm',
|
'tran_kbn_name',
|
||||||
'mkr_cd',
|
'mkr_cd',
|
||||||
'rec_comm_cd',
|
'rec_comm_cd',
|
||||||
'comm_nm',
|
'comm_nm',
|
||||||
'whs_rep_comm_nm',
|
'whs_rep_comm_nm',
|
||||||
'nnsk_cd',
|
'nonyu_fcl_cd',
|
||||||
'rec_nnskfcl_nm',
|
'rec_nonyu_fcl_name',
|
||||||
'whs_rep_nnskfcl_nm',
|
'whs_rep_nnskfcl_nm',
|
||||||
'rec_nnsk_fcl_addr',
|
'rec_nonyu_fcl_addr',
|
||||||
'whs_rep_nnsk_fcl_addr',
|
'whs_rep_nnsk_fcl_addr',
|
||||||
'rec_lot_num',
|
'rec_lot_num',
|
||||||
'amt_fugo',
|
'amt_fugo',
|
||||||
'expr_dt',
|
'expr_dt',
|
||||||
'data_kbn',
|
'data_kbn',
|
||||||
'lot_no_err_flg',
|
'lot_no_err_flg',
|
||||||
'bef_slip_mgt_no',
|
'bef_slip_mgt_num',
|
||||||
'ins_usr',
|
'ins_usr',
|
||||||
'ins_dt',
|
'ins_dt',
|
||||||
'inst_cd',
|
'inst_cd',
|
||||||
@ -332,7 +332,7 @@
|
|||||||
'tel_no',
|
'tel_no',
|
||||||
'v_whs_cd',
|
'v_whs_cd',
|
||||||
'v_whsorg_cd',
|
'v_whsorg_cd',
|
||||||
'whs_org_nm',
|
'whs_org_name',
|
||||||
'v_tran_cd',
|
'v_tran_cd',
|
||||||
'iko_flg',
|
'iko_flg',
|
||||||
];
|
];
|
||||||
@ -349,7 +349,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Excel出力モーダル -->
|
<!-- Excel出力モーダル -->
|
||||||
{% with
|
{% with
|
||||||
modal_id='modal_xlsx',
|
modal_id='modal_xlsx',
|
||||||
modal_title='確認',
|
modal_title='確認',
|
||||||
message='生物由来卸販売データ一覧をExcel出力しますか?',
|
message='生物由来卸販売データ一覧をExcel出力しますか?',
|
||||||
@ -373,7 +373,7 @@
|
|||||||
{% include '_modal.html' %}
|
{% include '_modal.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<!-- CSV出力モーダル -->
|
<!-- CSV出力モーダル -->
|
||||||
{% with
|
{% with
|
||||||
modal_id='modal_csv',
|
modal_id='modal_csv',
|
||||||
modal_title='確認',
|
modal_title='確認',
|
||||||
message='生物由来卸販売データ一覧をCSV出力しますか?',
|
message='生物由来卸販売データ一覧をCSV出力しますか?',
|
||||||
@ -397,7 +397,7 @@
|
|||||||
{% include '_modal.html' %}
|
{% include '_modal.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<!-- AWS環境異常エラーモーダル -->
|
<!-- AWS環境異常エラーモーダル -->
|
||||||
{% with
|
{% with
|
||||||
modal_id='ErrorModal_AWS',
|
modal_id='ErrorModal_AWS',
|
||||||
modal_title='エラー',
|
modal_title='エラー',
|
||||||
message='AWS環境に異常が発生しました。管理者にお問い合わせください。',
|
message='AWS環境に異常が発生しました。管理者にお問い合わせください。',
|
||||||
@ -415,7 +415,7 @@
|
|||||||
{% include '_modal.html' %}
|
{% include '_modal.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<!-- DB接続失敗エラーモーダル -->
|
<!-- DB接続失敗エラーモーダル -->
|
||||||
{% with
|
{% with
|
||||||
modal_id='ErrorModal_DB',
|
modal_id='ErrorModal_DB',
|
||||||
modal_title='エラー',
|
modal_title='エラー',
|
||||||
message='DB接続に失敗しました。管理者にお問い合わせください。',
|
message='DB接続に失敗しました。管理者にお問い合わせください。',
|
||||||
@ -434,7 +434,7 @@
|
|||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<!-- エラーモーダル -->
|
<!-- エラーモーダル -->
|
||||||
{% with
|
{% with
|
||||||
modal_id='ErrorModal_Unexpected',
|
modal_id='ErrorModal_Unexpected',
|
||||||
modal_title='エラー',
|
modal_title='エラー',
|
||||||
message='サーバーエラーが発生しました。管理者にお問い合わせください。',
|
message='サーバーエラーが発生しました。管理者にお問い合わせください。',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user