판매점 동기화시 가격 패턴 추가(1차판매점 : bos랭크, 2차판매점:정가)

This commit is contained in:
rjy1537 2026-01-26 14:13:05 +09:00
parent 33d92eb56d
commit fe1b0da695
4 changed files with 30 additions and 8 deletions

View File

@ -55,7 +55,16 @@ public interface UserMapper {
int setUserSave(UserRequest userReqList) throws Exception; int setUserSave(UserRequest userReqList) throws Exception;
/** /**
* 판매점의 정가가격 등록 여부 체크(2차점이상인 판매점만 해당) * 판매점의 등록 여부 체크
*
* @param storeReq
* @return
* @throws Exception
*/
int getStoreChk(StoreRequest storeReq) throws Exception;
/**
* 판매점의 가격 등록 여부 체크
* *
* @param storeReq * @param storeReq
* @return * @return

View File

@ -70,17 +70,18 @@ public class UserService {
// 판매점 동기화 // 판매점 동기화
for (StoreRequest storeRequest : storeList) { for (StoreRequest storeRequest : storeList) {
try { try {
int storeChk = userMapper.getStoreChk(storeRequest);
userMapper.setStoreSave(storeRequest); userMapper.setStoreSave(storeRequest);
userMapper.setStoreInfoSave(storeRequest); userMapper.setStoreInfoSave(storeRequest);
userMapper.setStoreSapCdSave(storeRequest); userMapper.setStoreSapCdSave(storeRequest);
userMapper.setStoreNorthModuleSave(storeRequest); userMapper.setStoreNorthModuleSave(storeRequest);
// 2차점 이상인 판매점 신규 등록시 판매점에 정가 가격 추가 // 신규판매점 등록 이면서 판매점 가격이 등록이 안되어 있는 경우 추가
if ("1".equals(storeRequest.getSecondAgentFlg())) { if (storeRequest.getPricePattern() != null
if (userMapper.getStoreUnitPriceChk(storeRequest) == 0) { && storeChk == 0
// 등록된 가격이 없는경우 정가 가격 등록 && userMapper.getStoreUnitPriceChk(storeRequest) == 0) {
userMapper.setStoreUnitPrice(storeRequest); // 등록된 가격이 없는경우 정가 가격 등록
} userMapper.setStoreUnitPrice(storeRequest);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());

View File

@ -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;
} }

View File

@ -257,6 +257,15 @@
); );
</insert> </insert>
<select id="getStoreChk" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" resultType="Integer">
/* sqlid : com.interplug.qcast.user.getStoreChk */
SELECT
COUNT(1)
FROM M_SALES_STORE
WHERE
SALE_STORE_ID = #{saleStoreId}
</select>
<select id="getStoreUnitPriceChk" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" resultType="Integer"> <select id="getStoreUnitPriceChk" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" resultType="Integer">
/* sqlid : com.interplug.qcast.user.getStoreUnitPriceChk */ /* sqlid : com.interplug.qcast.user.getStoreUnitPriceChk */
SELECT SELECT
@ -285,7 +294,7 @@
, GETDATE() , GETDATE()
, #{lastEditUser} , #{lastEditUser}
FROM M_PRICE_PATTERN_MONEY FROM M_PRICE_PATTERN_MONEY
WHERE PRICE_PATTERN = '510' WHERE PRICE_PATTERN = #{pricePattern}
</insert> </insert>
<insert id="setStoreNorthModuleSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" > <insert id="setStoreNorthModuleSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >