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;
|
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.biz.user.dto.*;
|
||||||
import com.interplug.qcast.util.InterfaceQsp;
|
import com.interplug.qcast.util.InterfaceQsp;
|
||||||
|
import io.micrometer.common.util.StringUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -27,10 +28,26 @@ public class UserService {
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public int setStoreSave(StoreRequest storeReq) 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);
|
int resultCnt = userMapper.setStoreSave(storeReq);
|
||||||
userMapper.setStoreInfoSave(storeReq);
|
userMapper.setStoreInfoSave(storeReq);
|
||||||
userMapper.setStoreSapCdSave(storeReq);
|
userMapper.setStoreSapCdSave(storeReq);
|
||||||
userMapper.setStoreNorthModuleSave(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;
|
return resultCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,10 +87,31 @@ public class UserService {
|
|||||||
// 판매점 동기화
|
// 판매점 동기화
|
||||||
for (StoreRequest storeRequest : storeList) {
|
for (StoreRequest storeRequest : storeList) {
|
||||||
try {
|
try {
|
||||||
|
String prevSaleStoreLevel = userMapper.getStoreLevel(storeRequest); // 등록된 판매점 레벨
|
||||||
|
String saleStoreLevel =
|
||||||
|
StringUtils.isEmpty(storeRequest.getSaleStoreLevel())
|
||||||
|
? ""
|
||||||
|
: storeRequest.getSaleStoreLevel();
|
||||||
|
|
||||||
userMapper.setStoreSave(storeRequest);
|
userMapper.setStoreSave(storeRequest);
|
||||||
userMapper.setStoreInfoSave(storeRequest);
|
userMapper.setStoreInfoSave(storeRequest);
|
||||||
userMapper.setStoreSapCdSave(storeRequest);
|
userMapper.setStoreSapCdSave(storeRequest);
|
||||||
userMapper.setStoreNorthModuleSave(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) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
@ -142,10 +180,28 @@ public class UserService {
|
|||||||
|
|
||||||
List<StoreRequest> storeList = storeSyncResponse.getStoreList();
|
List<StoreRequest> storeList = storeSyncResponse.getStoreList();
|
||||||
for (StoreRequest storeRequest : storeList) {
|
for (StoreRequest storeRequest : storeList) {
|
||||||
|
String prevSaleStoreLevel = userMapper.getStoreLevel(storeRequest); // 등록된 판매점 레벨
|
||||||
|
String saleStoreLevel =
|
||||||
|
StringUtils.isEmpty(storeRequest.getSaleStoreLevel())
|
||||||
|
? ""
|
||||||
|
: storeRequest.getSaleStoreLevel();
|
||||||
|
|
||||||
userMapper.setStoreSave(storeRequest);
|
userMapper.setStoreSave(storeRequest);
|
||||||
userMapper.setStoreInfoSave(storeRequest);
|
userMapper.setStoreInfoSave(storeRequest);
|
||||||
userMapper.setStoreSapCdSave(storeRequest);
|
userMapper.setStoreSapCdSave(storeRequest);
|
||||||
userMapper.setStoreNorthModuleSave(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();
|
List<UserRequest> userList = storeSyncResponse.getUserList();
|
||||||
|
|||||||
@ -95,6 +95,9 @@ public class StoreRequest {
|
|||||||
@Schema(description = "수정자")
|
@Schema(description = "수정자")
|
||||||
private String lastEditUser;
|
private String lastEditUser;
|
||||||
|
|
||||||
|
@Schema(description = "가격 패턴(1차점 : BOS 랭크, 2차점 : 정가)")
|
||||||
|
private String pricePattern;
|
||||||
|
|
||||||
@Schema(description = "북쪽 모듈 여부")
|
@Schema(description = "북쪽 모듈 여부")
|
||||||
private String northModuleFlg;
|
private String northModuleFlg;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,8 +87,9 @@
|
|||||||
, DISP_FAX = #{dispFax}
|
, DISP_FAX = #{dispFax}
|
||||||
, DISP_MAIL = #{dispMail}
|
, DISP_MAIL = #{dispMail}
|
||||||
, SALE_STORE_LEVEL = #{saleStoreLevel}
|
, SALE_STORE_LEVEL = #{saleStoreLevel}
|
||||||
|
, PRICE_PATTERN = #{pricePattern}
|
||||||
, DEL_FLG = #{delFlg}
|
, DEL_FLG = #{delFlg}
|
||||||
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
, LAST_EDIT_DATETIME = GETDATE()
|
||||||
, LAST_EDIT_USER = #{lastEditUser}
|
, LAST_EDIT_USER = #{lastEditUser}
|
||||||
WHEN NOT MATCHED THEN
|
WHEN NOT MATCHED THEN
|
||||||
INSERT (
|
INSERT (
|
||||||
@ -107,6 +108,7 @@
|
|||||||
, SECOND_AGENT_FLG
|
, SECOND_AGENT_FLG
|
||||||
, FIRST_AGENT_ID
|
, FIRST_AGENT_ID
|
||||||
, PARENT_SALE_AGENT_ID
|
, PARENT_SALE_AGENT_ID
|
||||||
|
, PRICE_PATTERN
|
||||||
, OUTPUT_COMP_CLASS -- 출력 대비표 분류
|
, OUTPUT_COMP_CLASS -- 출력 대비표 분류
|
||||||
, INDUSTRIAL_OUTPUT_COMP_CLASS -- 산업출력 대비표 출력
|
, INDUSTRIAL_OUTPUT_COMP_CLASS -- 산업출력 대비표 출력
|
||||||
, FIXED_PRICE_FLG -- 정가 표시
|
, FIXED_PRICE_FLG -- 정가 표시
|
||||||
@ -143,6 +145,7 @@
|
|||||||
, #{secondAgentFlg}
|
, #{secondAgentFlg}
|
||||||
, #{firstAgentId}
|
, #{firstAgentId}
|
||||||
, #{parentSaleAgentId}
|
, #{parentSaleAgentId}
|
||||||
|
, #{pricePattern}
|
||||||
, 0 -- 출력 대비표 분류
|
, 0 -- 출력 대비표 분류
|
||||||
, 0 -- 산업출력 대비표 출력
|
, 0 -- 산업출력 대비표 출력
|
||||||
, 0 -- 정가 표시
|
, 0 -- 정가 표시
|
||||||
@ -161,7 +164,7 @@
|
|||||||
, #{registDatetime}
|
, #{registDatetime}
|
||||||
, 0
|
, 0
|
||||||
, 0 -- 적설
|
, 0 -- 적설
|
||||||
, #{lastEditDatetime}
|
, GETDATE()
|
||||||
, #{lastEditUser}
|
, #{lastEditUser}
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
@ -175,7 +178,7 @@
|
|||||||
WHEN MATCHED THEN
|
WHEN MATCHED THEN
|
||||||
UPDATE SET
|
UPDATE SET
|
||||||
BIZ_NO = #{bizNo}
|
BIZ_NO = #{bizNo}
|
||||||
, LAST_EDIT_DATETIME = (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
, LAST_EDIT_DATETIME = GETDATE()
|
||||||
WHEN NOT MATCHED THEN
|
WHEN NOT MATCHED THEN
|
||||||
INSERT (
|
INSERT (
|
||||||
SALE_STORE_ID
|
SALE_STORE_ID
|
||||||
@ -184,7 +187,7 @@
|
|||||||
) VALUES (
|
) VALUES (
|
||||||
#{saleStoreId}
|
#{saleStoreId}
|
||||||
, #{bizNo}
|
, #{bizNo}
|
||||||
, (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
, GETDATE()
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -207,7 +210,7 @@
|
|||||||
, TEL = #{tel}
|
, TEL = #{tel}
|
||||||
, FAX = #{fax}
|
, FAX = #{fax}
|
||||||
, MAIL = #{mail}
|
, MAIL = #{mail}
|
||||||
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
, LAST_EDIT_DATETIME = GETDATE()
|
||||||
, LAST_EDIT_USER = #{lastEditUser}
|
, LAST_EDIT_USER = #{lastEditUser}
|
||||||
-- , GROUP_ID -- '70000' , '60000'
|
-- , GROUP_ID -- '70000' , '60000'
|
||||||
-- , MODULE_SELECT_GROUP_ID -- 모듈 선택 그룹 ('G1','GA' ,'G2')
|
-- , MODULE_SELECT_GROUP_ID -- 모듈 선택 그룹 ('G1','GA' ,'G2')
|
||||||
@ -226,6 +229,8 @@
|
|||||||
, FAX
|
, FAX
|
||||||
, MAIL
|
, MAIL
|
||||||
, GROUP_ID
|
, GROUP_ID
|
||||||
|
, MODULE_SELECT_GROUP_ID
|
||||||
|
, VERSION_MANAGEMENT_ID
|
||||||
, DISP_COST_PRICE
|
, DISP_COST_PRICE
|
||||||
, DISP_SELLING_PRICE
|
, DISP_SELLING_PRICE
|
||||||
, REGIST_DATETIME
|
, REGIST_DATETIME
|
||||||
@ -242,14 +247,53 @@
|
|||||||
, #{fax}
|
, #{fax}
|
||||||
, #{mail}
|
, #{mail}
|
||||||
, #{groupId}
|
, #{groupId}
|
||||||
|
, 'G1' /* 일반 공개용 */
|
||||||
|
, 'hanbaiten' /* 일반 판매점 */
|
||||||
, 0
|
, 0
|
||||||
, 0
|
, 0
|
||||||
, #{registDatetime}
|
, GETDATE()
|
||||||
, #{lastEditDatetime}
|
, GETDATE()
|
||||||
, #{lastEditUser}
|
, #{lastEditUser}
|
||||||
);
|
);
|
||||||
</insert>
|
</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" >
|
<insert id="setStoreNorthModuleSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||||
/* sqlid : com.interplug.qcast.user.setStoreNorthModuleSave */
|
/* sqlid : com.interplug.qcast.user.setStoreNorthModuleSave */
|
||||||
MERGE INTO M_SALES_STORE_NORTH_MODULE AS A
|
MERGE INTO M_SALES_STORE_NORTH_MODULE AS A
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user