Compare commits
No commits in common. "eed1cda72b920d79411c97e17ea9a9849308fd5f" and "f800768969c5a18e8d4aeba655eb74f24908c352" have entirely different histories.
eed1cda72b
...
f800768969
@ -54,33 +54,6 @@ 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,7 +2,6 @@ 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;
|
||||||
@ -28,26 +27,10 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,31 +70,10 @@ 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());
|
||||||
}
|
}
|
||||||
@ -180,28 +142,10 @@ 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,9 +95,6 @@ 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,9 +87,8 @@
|
|||||||
, 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 = GETDATE()
|
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
||||||
, LAST_EDIT_USER = #{lastEditUser}
|
, LAST_EDIT_USER = #{lastEditUser}
|
||||||
WHEN NOT MATCHED THEN
|
WHEN NOT MATCHED THEN
|
||||||
INSERT (
|
INSERT (
|
||||||
@ -108,7 +107,6 @@
|
|||||||
, 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 -- 정가 표시
|
||||||
@ -145,7 +143,6 @@
|
|||||||
, #{secondAgentFlg}
|
, #{secondAgentFlg}
|
||||||
, #{firstAgentId}
|
, #{firstAgentId}
|
||||||
, #{parentSaleAgentId}
|
, #{parentSaleAgentId}
|
||||||
, #{pricePattern}
|
|
||||||
, 0 -- 출력 대비표 분류
|
, 0 -- 출력 대비표 분류
|
||||||
, 0 -- 산업출력 대비표 출력
|
, 0 -- 산업출력 대비표 출력
|
||||||
, 0 -- 정가 표시
|
, 0 -- 정가 표시
|
||||||
@ -164,7 +161,7 @@
|
|||||||
, #{registDatetime}
|
, #{registDatetime}
|
||||||
, 0
|
, 0
|
||||||
, 0 -- 적설
|
, 0 -- 적설
|
||||||
, GETDATE()
|
, #{lastEditDatetime}
|
||||||
, #{lastEditUser}
|
, #{lastEditUser}
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
@ -178,7 +175,7 @@
|
|||||||
WHEN MATCHED THEN
|
WHEN MATCHED THEN
|
||||||
UPDATE SET
|
UPDATE SET
|
||||||
BIZ_NO = #{bizNo}
|
BIZ_NO = #{bizNo}
|
||||||
, LAST_EDIT_DATETIME = GETDATE()
|
, LAST_EDIT_DATETIME = (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
||||||
WHEN NOT MATCHED THEN
|
WHEN NOT MATCHED THEN
|
||||||
INSERT (
|
INSERT (
|
||||||
SALE_STORE_ID
|
SALE_STORE_ID
|
||||||
@ -187,7 +184,7 @@
|
|||||||
) VALUES (
|
) VALUES (
|
||||||
#{saleStoreId}
|
#{saleStoreId}
|
||||||
, #{bizNo}
|
, #{bizNo}
|
||||||
, GETDATE()
|
, (CASE WHEN #{lastEditDatetime} != '' THEN #{lastEditDatetime} ELSE #{registDatetime} END)
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -210,7 +207,7 @@
|
|||||||
, TEL = #{tel}
|
, TEL = #{tel}
|
||||||
, FAX = #{fax}
|
, FAX = #{fax}
|
||||||
, MAIL = #{mail}
|
, MAIL = #{mail}
|
||||||
, LAST_EDIT_DATETIME = GETDATE()
|
, LAST_EDIT_DATETIME = #{lastEditDatetime}
|
||||||
, 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')
|
||||||
@ -229,8 +226,6 @@
|
|||||||
, 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
|
||||||
@ -247,53 +242,14 @@
|
|||||||
, #{fax}
|
, #{fax}
|
||||||
, #{mail}
|
, #{mail}
|
||||||
, #{groupId}
|
, #{groupId}
|
||||||
, 'G1' /* 일반 공개용 */
|
|
||||||
, 'hanbaiten' /* 일반 판매점 */
|
|
||||||
, 0
|
, 0
|
||||||
, 0
|
, 0
|
||||||
, GETDATE()
|
, #{registDatetime}
|
||||||
, GETDATE()
|
, #{lastEditDatetime}
|
||||||
, #{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