Merge pull request 'dev' (#358) from dev into prd-deploy
Reviewed-on: #358
This commit is contained in:
commit
eed1cda72b
@ -54,6 +54,33 @@ public interface UserMapper {
|
||||
*/
|
||||
int setUserSave(UserRequest userReqList) throws Exception;
|
||||
|
||||
/**
|
||||
* 판매점 레벨 조회
|
||||
*
|
||||
* @param storeReq
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
String getStoreLevel(StoreRequest storeReq) throws Exception;
|
||||
|
||||
/**
|
||||
* 판매점의 정가가격 삭제
|
||||
*
|
||||
* @param storeReq
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int deleteStoreUnitPrice(StoreRequest storeReq) throws Exception;
|
||||
|
||||
/**
|
||||
* 판매점의 정가가격 등록
|
||||
*
|
||||
* @param storeReq
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int setStoreUnitPrice(StoreRequest storeReq) throws Exception;
|
||||
|
||||
/**
|
||||
* 영업사원 삭제
|
||||
*
|
||||
|
||||
@ -2,6 +2,7 @@ package com.interplug.qcast.biz.user;
|
||||
|
||||
import com.interplug.qcast.biz.user.dto.*;
|
||||
import com.interplug.qcast.util.InterfaceQsp;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -27,10 +28,26 @@ public class UserService {
|
||||
* @throws Exception
|
||||
*/
|
||||
public int setStoreSave(StoreRequest storeReq) throws Exception {
|
||||
String prevSaleStoreLevel = userMapper.getStoreLevel(storeReq); // 등록된 판매점 레벨
|
||||
String saleStoreLevel =
|
||||
StringUtils.isEmpty(storeReq.getSaleStoreLevel()) ? "" : storeReq.getSaleStoreLevel();
|
||||
|
||||
int resultCnt = userMapper.setStoreSave(storeReq);
|
||||
userMapper.setStoreInfoSave(storeReq);
|
||||
userMapper.setStoreSapCdSave(storeReq);
|
||||
userMapper.setStoreNorthModuleSave(storeReq);
|
||||
|
||||
log.info("setStoreSave ==================> ", prevSaleStoreLevel + ", " + saleStoreLevel);
|
||||
// 신규 판매점 이거나 1차판매점에서 하위판매점으로 변경된 경우 가격 등록
|
||||
if (prevSaleStoreLevel == null
|
||||
|| (!prevSaleStoreLevel.equals(saleStoreLevel) && "1".equals(prevSaleStoreLevel))) {
|
||||
// 판매점에 등록된 가격 삭제 후 가격 패턴의 아이템 등록
|
||||
log.info("setStoreSave prevSaleStoreLevel =================> 시작");
|
||||
int deleteCnt = userMapper.deleteStoreUnitPrice(storeReq);
|
||||
int priceCnt = userMapper.setStoreUnitPrice(storeReq);
|
||||
log.info(
|
||||
"setStoreSave prevSaleStoreLevel ==================> 종료" + deleteCnt + ", " + priceCnt);
|
||||
}
|
||||
return resultCnt;
|
||||
}
|
||||
|
||||
@ -70,10 +87,31 @@ public class UserService {
|
||||
// 판매점 동기화
|
||||
for (StoreRequest storeRequest : storeList) {
|
||||
try {
|
||||
String prevSaleStoreLevel = userMapper.getStoreLevel(storeRequest); // 등록된 판매점 레벨
|
||||
String saleStoreLevel =
|
||||
StringUtils.isEmpty(storeRequest.getSaleStoreLevel())
|
||||
? ""
|
||||
: storeRequest.getSaleStoreLevel();
|
||||
|
||||
userMapper.setStoreSave(storeRequest);
|
||||
userMapper.setStoreInfoSave(storeRequest);
|
||||
userMapper.setStoreSapCdSave(storeRequest);
|
||||
userMapper.setStoreNorthModuleSave(storeRequest);
|
||||
|
||||
log.info("setStoreSave ==================> ", prevSaleStoreLevel + ", " + saleStoreLevel);
|
||||
// 신규 판매점 이거나 1차판매점에서 하위판매점으로 변경된 경우 가격 등록
|
||||
if (prevSaleStoreLevel == null
|
||||
|| (!prevSaleStoreLevel.equals(saleStoreLevel) && "1".equals(prevSaleStoreLevel))) {
|
||||
// 판매점에 등록된 가격 삭제 후 가격 패턴의 아이템 등록
|
||||
log.info("setStoreSave prevSaleStoreLevel =================> 시작");
|
||||
int deleteCnt = userMapper.deleteStoreUnitPrice(storeRequest);
|
||||
int priceCnt = userMapper.setStoreUnitPrice(storeRequest);
|
||||
log.info(
|
||||
"setStoreSave prevSaleStoreLevel ==================> 종료"
|
||||
+ deleteCnt
|
||||
+ ", "
|
||||
+ priceCnt);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
@ -142,10 +180,28 @@ public class UserService {
|
||||
|
||||
List<StoreRequest> storeList = storeSyncResponse.getStoreList();
|
||||
for (StoreRequest storeRequest : storeList) {
|
||||
String prevSaleStoreLevel = userMapper.getStoreLevel(storeRequest); // 등록된 판매점 레벨
|
||||
String saleStoreLevel =
|
||||
StringUtils.isEmpty(storeRequest.getSaleStoreLevel())
|
||||
? ""
|
||||
: storeRequest.getSaleStoreLevel();
|
||||
|
||||
userMapper.setStoreSave(storeRequest);
|
||||
userMapper.setStoreInfoSave(storeRequest);
|
||||
userMapper.setStoreSapCdSave(storeRequest);
|
||||
userMapper.setStoreNorthModuleSave(storeRequest);
|
||||
|
||||
log.info("setStoreSave ==================> ", prevSaleStoreLevel + ", " + saleStoreLevel);
|
||||
// 신규 판매점 이거나 1차판매점에서 하위판매점으로 변경된 경우 가격 등록
|
||||
if (prevSaleStoreLevel == null
|
||||
|| (!prevSaleStoreLevel.equals(saleStoreLevel) && "1".equals(prevSaleStoreLevel))) {
|
||||
// 판매점에 등록된 가격 삭제 후 가격 패턴의 아이템 등록
|
||||
log.info("setStoreSave prevSaleStoreLevel =================> 시작");
|
||||
int deleteCnt = userMapper.deleteStoreUnitPrice(storeRequest);
|
||||
int priceCnt = userMapper.setStoreUnitPrice(storeRequest);
|
||||
log.info(
|
||||
"setStoreSave prevSaleStoreLevel ==================> 종료" + deleteCnt + ", " + priceCnt);
|
||||
}
|
||||
}
|
||||
|
||||
List<UserRequest> userList = storeSyncResponse.getUserList();
|
||||
|
||||
@ -95,6 +95,9 @@ public class StoreRequest {
|
||||
@Schema(description = "수정자")
|
||||
private String lastEditUser;
|
||||
|
||||
@Schema(description = "가격 패턴(1차점 : BOS 랭크, 2차점 : 정가)")
|
||||
private String pricePattern;
|
||||
|
||||
@Schema(description = "북쪽 모듈 여부")
|
||||
private String northModuleFlg;
|
||||
}
|
||||
|
||||
@ -87,8 +87,9 @@
|
||||
, DISP_FAX = #{dispFax}
|
||||
, DISP_MAIL = #{dispMail}
|
||||
, SALE_STORE_LEVEL = #{saleStoreLevel}
|
||||
, PRICE_PATTERN = #{pricePattern}
|
||||
, DEL_FLG = #{delFlg}
|
||||
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
||||
, LAST_EDIT_DATETIME = GETDATE()
|
||||
, LAST_EDIT_USER = #{lastEditUser}
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT (
|
||||
@ -107,6 +108,7 @@
|
||||
, SECOND_AGENT_FLG
|
||||
, FIRST_AGENT_ID
|
||||
, PARENT_SALE_AGENT_ID
|
||||
, PRICE_PATTERN
|
||||
, OUTPUT_COMP_CLASS -- 출력 대비표 분류
|
||||
, INDUSTRIAL_OUTPUT_COMP_CLASS -- 산업출력 대비표 출력
|
||||
, FIXED_PRICE_FLG -- 정가 표시
|
||||
@ -143,6 +145,7 @@
|
||||
, #{secondAgentFlg}
|
||||
, #{firstAgentId}
|
||||
, #{parentSaleAgentId}
|
||||
, #{pricePattern}
|
||||
, 0 -- 출력 대비표 분류
|
||||
, 0 -- 산업출력 대비표 출력
|
||||
, 0 -- 정가 표시
|
||||
@ -161,7 +164,7 @@
|
||||
, #{registDatetime}
|
||||
, 0
|
||||
, 0 -- 적설
|
||||
, #{lastEditDatetime}
|
||||
, GETDATE()
|
||||
, #{lastEditUser}
|
||||
);
|
||||
</insert>
|
||||
@ -175,7 +178,7 @@
|
||||
WHEN MATCHED THEN
|
||||
UPDATE SET
|
||||
BIZ_NO = #{bizNo}
|
||||
, LAST_EDIT_DATETIME = (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
||||
, LAST_EDIT_DATETIME = GETDATE()
|
||||
WHEN NOT MATCHED THEN
|
||||
INSERT (
|
||||
SALE_STORE_ID
|
||||
@ -184,7 +187,7 @@
|
||||
) VALUES (
|
||||
#{saleStoreId}
|
||||
, #{bizNo}
|
||||
, (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
||||
, GETDATE()
|
||||
);
|
||||
</insert>
|
||||
|
||||
@ -207,7 +210,7 @@
|
||||
, TEL = #{tel}
|
||||
, FAX = #{fax}
|
||||
, MAIL = #{mail}
|
||||
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
||||
, LAST_EDIT_DATETIME = GETDATE()
|
||||
, LAST_EDIT_USER = #{lastEditUser}
|
||||
-- , GROUP_ID -- '70000' , '60000'
|
||||
-- , MODULE_SELECT_GROUP_ID -- 모듈 선택 그룹 ('G1','GA' ,'G2')
|
||||
@ -226,6 +229,8 @@
|
||||
, FAX
|
||||
, MAIL
|
||||
, GROUP_ID
|
||||
, MODULE_SELECT_GROUP_ID
|
||||
, VERSION_MANAGEMENT_ID
|
||||
, DISP_COST_PRICE
|
||||
, DISP_SELLING_PRICE
|
||||
, REGIST_DATETIME
|
||||
@ -242,14 +247,53 @@
|
||||
, #{fax}
|
||||
, #{mail}
|
||||
, #{groupId}
|
||||
, 'G1' /* 일반 공개용 */
|
||||
, 'hanbaiten' /* 일반 판매점 */
|
||||
, 0
|
||||
, 0
|
||||
, #{registDatetime}
|
||||
, #{lastEditDatetime}
|
||||
, GETDATE()
|
||||
, GETDATE()
|
||||
, #{lastEditUser}
|
||||
);
|
||||
</insert>
|
||||
|
||||
<select id="getStoreLevel" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" resultType="String">
|
||||
/* sqlid : com.interplug.qcast.user.getStoreLevel */
|
||||
SELECT
|
||||
SALE_STORE_LEVEL
|
||||
FROM M_SALES_STORE
|
||||
WHERE
|
||||
SALE_STORE_ID = #{saleStoreId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteStoreUnitPrice" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
/* sqlid : com.interplug.qcast.user.deleteStoreUnitPrice */
|
||||
DELETE FROM M_SALE_STORE_PRICE
|
||||
WHERE SALE_STORE_ID = #{saleStoreId}
|
||||
</delete>
|
||||
|
||||
<insert id="setStoreUnitPrice" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
/* sqlid : com.interplug.qcast.user.setStoreUnitPrice */
|
||||
INSERT INTO M_SALE_STORE_PRICE(
|
||||
SALE_STORE_ID
|
||||
, ITEM_ID
|
||||
, COST_PRICE
|
||||
, SALE_PRICE
|
||||
, DISP_FLG
|
||||
, LAST_EDIT_DATETIME
|
||||
, LAST_EDIT_USER
|
||||
)
|
||||
SELECT #{saleStoreId}
|
||||
, ITEM_ID
|
||||
, COST_PRICE
|
||||
, SALE_PRICE
|
||||
, '1'
|
||||
, GETDATE()
|
||||
, #{lastEditUser}
|
||||
FROM M_PRICE_PATTERN_MONEY
|
||||
WHERE PRICE_PATTERN = #{pricePattern}
|
||||
</insert>
|
||||
|
||||
<insert id="setStoreNorthModuleSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
/* sqlid : com.interplug.qcast.user.setStoreNorthModuleSave */
|
||||
MERGE INTO M_SALES_STORE_NORTH_MODULE AS A
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user