판매점 동기화시 가격 패턴 추가(1차판매점 : bos랭크, 2차판매점:정가)
This commit is contained in:
parent
33d92eb56d
commit
fe1b0da695
@ -55,7 +55,16 @@ public interface UserMapper {
|
||||
int setUserSave(UserRequest userReqList) throws Exception;
|
||||
|
||||
/**
|
||||
* 판매점의 정가가격 등록 여부 체크(2차점이상인 판매점만 해당)
|
||||
* 판매점의 등록 여부 체크
|
||||
*
|
||||
* @param storeReq
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int getStoreChk(StoreRequest storeReq) throws Exception;
|
||||
|
||||
/**
|
||||
* 판매점의 가격 등록 여부 체크
|
||||
*
|
||||
* @param storeReq
|
||||
* @return
|
||||
|
||||
@ -70,18 +70,19 @@ public class UserService {
|
||||
// 판매점 동기화
|
||||
for (StoreRequest storeRequest : storeList) {
|
||||
try {
|
||||
int storeChk = userMapper.getStoreChk(storeRequest);
|
||||
userMapper.setStoreSave(storeRequest);
|
||||
userMapper.setStoreInfoSave(storeRequest);
|
||||
userMapper.setStoreSapCdSave(storeRequest);
|
||||
userMapper.setStoreNorthModuleSave(storeRequest);
|
||||
|
||||
// 2차점 이상인 판매점 신규 등록시 판매점에 정가 가격 추가
|
||||
if ("1".equals(storeRequest.getSecondAgentFlg())) {
|
||||
if (userMapper.getStoreUnitPriceChk(storeRequest) == 0) {
|
||||
// 신규판매점 등록 이면서 판매점 가격이 등록이 안되어 있는 경우 추가
|
||||
if (storeRequest.getPricePattern() != null
|
||||
&& storeChk == 0
|
||||
&& userMapper.getStoreUnitPriceChk(storeRequest) == 0) {
|
||||
// 등록된 가격이 없는경우 정가 가격 등록
|
||||
userMapper.setStoreUnitPrice(storeRequest);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -257,6 +257,15 @@
|
||||
);
|
||||
</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">
|
||||
/* sqlid : com.interplug.qcast.user.getStoreUnitPriceChk */
|
||||
SELECT
|
||||
@ -285,7 +294,7 @@
|
||||
, GETDATE()
|
||||
, #{lastEditUser}
|
||||
FROM M_PRICE_PATTERN_MONEY
|
||||
WHERE PRICE_PATTERN = '510'
|
||||
WHERE PRICE_PATTERN = #{pricePattern}
|
||||
</insert>
|
||||
|
||||
<insert id="setStoreNorthModuleSave" parameterType="com.interplug.qcast.biz.user.dto.StoreRequest" >
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user