mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 23:18:19 +09:00
템플릿 반려 팝업 작업
This commit is contained in:
@@ -27,8 +27,13 @@ const getExcelHeader = category => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const tmpltRejectList = (params) => {
|
||||||
|
return httpClient.post('/api/v1/bo/channelMgt/tmpltRejectList', params);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getCommCode,
|
getCommCode,
|
||||||
tmpltListExcel,
|
tmpltListExcel,
|
||||||
getExcelHeader,
|
getExcelHeader,
|
||||||
|
tmpltRejectList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
></custom-grid>
|
></custom-grid>
|
||||||
|
|
||||||
<common-modal ref="commmonModal"></common-modal>
|
<common-modal ref="commmonModal"></common-modal>
|
||||||
|
<TmpltRejectViewPop ref="TmpltRejectViewPop" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -76,8 +77,38 @@ import channelMgtApi from '../service/channelMgtApi';
|
|||||||
import xlsx from '@/common/excel';
|
import xlsx from '@/common/excel';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import commonModal from '@/components/modal/commonModal';
|
import commonModal from '@/components/modal/commonModal';
|
||||||
|
import TmpltRejectViewPop from '../components/TmpltRejectViewPop';
|
||||||
import api from '@/service/api';
|
import api from '@/service/api';
|
||||||
|
|
||||||
|
class CustomATagRenderer {
|
||||||
|
constructor(props) {
|
||||||
|
this.props = props;
|
||||||
|
if(props.colValue == "반려"){
|
||||||
|
const el = document.createElement('a');
|
||||||
|
el.href = 'javascript:void(0);';
|
||||||
|
el.className = 'btn_text';
|
||||||
|
el.innerText = String(props.colValue);
|
||||||
|
this.el = el;
|
||||||
|
}else{
|
||||||
|
const el = document.createElement('p');
|
||||||
|
el.className = 'btn_text';
|
||||||
|
el.innerText = String(props.colValue);
|
||||||
|
this.el = el;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getElement() {
|
||||||
|
return this.el;
|
||||||
|
}
|
||||||
|
|
||||||
|
addEvent(selEl) {
|
||||||
|
selEl.addEventListener('click', () => {
|
||||||
|
const { callback } = this.props['cgrido' + this.props.colName].options;
|
||||||
|
callback(this.props);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'temltList',
|
name: 'temltList',
|
||||||
data() {
|
data() {
|
||||||
@@ -128,7 +159,18 @@ export default {
|
|||||||
// { name: 'tmpltCd', header: '템플릿코드', align: 'center', width: '12%' },
|
// { name: 'tmpltCd', header: '템플릿코드', align: 'center', width: '12%' },
|
||||||
{ name: 'tmpltNm', header: '템플릿명', align: 'center', width: '16%' },
|
{ name: 'tmpltNm', header: '템플릿명', align: 'center', width: '16%' },
|
||||||
{ name: 'tmpltType', header: '템플릿 유형', align: 'center', width: '6%' },
|
{ name: 'tmpltType', header: '템플릿 유형', align: 'center', width: '6%' },
|
||||||
{ name: 'stat', header: '상태', align: 'center', width: '7%' },
|
{
|
||||||
|
name: 'stat',
|
||||||
|
header: '상태',
|
||||||
|
align: 'center',
|
||||||
|
width: '7%',
|
||||||
|
renderer: {
|
||||||
|
type: CustomATagRenderer,
|
||||||
|
options: {
|
||||||
|
callback: this.tmpltRejectViewPopOpen,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{ name: 'sendProfile', header: '발신프로필', align: 'center', width: '28%' },
|
{ name: 'sendProfile', header: '발신프로필', align: 'center', width: '28%' },
|
||||||
{ name: 'userInfo', header: '등록ID(이름)', align: 'center', width: '10%' },
|
{ name: 'userInfo', header: '등록ID(이름)', align: 'center', width: '10%' },
|
||||||
{ name: 'lastChgDt', header: '마지막 수정일', width: '7%', cls: 'td_line' },
|
{ name: 'lastChgDt', header: '마지막 수정일', width: '7%', cls: 'td_line' },
|
||||||
@@ -147,6 +189,7 @@ export default {
|
|||||||
customGrid: customGrid,
|
customGrid: customGrid,
|
||||||
channelMgtApi,
|
channelMgtApi,
|
||||||
commonModal,
|
commonModal,
|
||||||
|
TmpltRejectViewPop
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getExcelHeader();
|
this.getExcelHeader();
|
||||||
@@ -268,6 +311,11 @@ export default {
|
|||||||
return String.fromCharCode(s.match(/\d+/gm)[0]);
|
return String.fromCharCode(s.match(/\d+/gm)[0]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
tmpltRejectViewPopOpen(props) {
|
||||||
|
if(props.stat == "반려"){
|
||||||
|
this.$refs.TmpltRejectViewPop.tmpltRejectViewPopOpen(props.sndrprofKey, props.tmpltKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
|
|||||||
@@ -81,4 +81,25 @@ public class ChannelMgtController {
|
|||||||
|
|
||||||
return channelService.tmpltListExcel(tmpltListExcelReqDto, userId);
|
return channelService.tmpltListExcel(tmpltListExcelReqDto, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* date : 2022. 4. 25.
|
||||||
|
* auth : ckr
|
||||||
|
* desc : 알림톡 템플릿 목록 조회
|
||||||
|
* @param tmpltListReqDto
|
||||||
|
* @return
|
||||||
|
* @
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "tmpltRejectList", notes = "알림톡 템플릿 반려 목록 조회")
|
||||||
|
@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
|
||||||
|
@RequestMapping(value = "tmpltRejectList", method = { RequestMethod.POST })
|
||||||
|
@ResponseBody
|
||||||
|
public TmpltListResDto tmpltRejectList(@RequestBody @Valid TmpltListReqDto tmpltListReqDto, BindingResult bindingResult) {
|
||||||
|
|
||||||
|
if (validComponents.validParameter(bindingResult)) {
|
||||||
|
return new TmpltListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return channelService.tmpltRejectList(tmpltListReqDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
package kr.co.uplus.ez.api.channelMgt;
|
package kr.co.uplus.ez.api.channelMgt;
|
||||||
|
|
||||||
import kr.co.uplus.ez.api.channelMgt.dto.*;
|
import kr.co.uplus.ez.api.channelMgt.dto.*;
|
||||||
|
import kr.co.uplus.ez.common.components.WebClientRequestService;
|
||||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||||
|
import kr.co.uplus.ez.common.data.Const;
|
||||||
import kr.co.uplus.ez.common.data.Paging;
|
import kr.co.uplus.ez.common.data.Paging;
|
||||||
|
|
||||||
|
import org.json.simple.JSONArray;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
import org.mybatis.spring.SqlSessionTemplate;
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ChannelMgtService {
|
public class ChannelMgtService {
|
||||||
@@ -26,6 +34,15 @@ public class ChannelMgtService {
|
|||||||
@Qualifier("sqlSessionTemplateDb2")
|
@Qualifier("sqlSessionTemplateDb2")
|
||||||
private SqlSessionTemplate sqlSessionSlave;
|
private SqlSessionTemplate sqlSessionSlave;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
WebClientRequestService clientRequestService;
|
||||||
|
|
||||||
|
@Value("${hubeasy-api.domain:http://localhost:7070/}")
|
||||||
|
String apiDomain;
|
||||||
|
|
||||||
|
@Value("${hubeasy-api.url.alTolkTemplet:api/v1/kko/template/get}")
|
||||||
|
String apiUrlAlTolkTemplet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* date : 2022. 4. 25.
|
* date : 2022. 4. 25.
|
||||||
* auth : ckr
|
* auth : ckr
|
||||||
@@ -82,4 +99,47 @@ public class ChannelMgtService {
|
|||||||
|
|
||||||
return new TmpltListExcelResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
return new TmpltListExcelResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* desc : 알림톡 템플릿 반려 목록 조회
|
||||||
|
* @param tmpltListReqDto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public TmpltListResDto tmpltRejectList(TmpltListReqDto tmpltListReqDto) {
|
||||||
|
RjtTmpltListRes tmpltListRes = new RjtTmpltListRes();
|
||||||
|
Map<Object, Object> apiResultMap = null;
|
||||||
|
List<Map<Object,Object>> rjtDataListMap = null;
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
String callUrl = apiDomain + apiUrlAlTolkTemplet;
|
||||||
|
jsonObject.put("senderKey", tmpltListReqDto.getSndrprofKey());
|
||||||
|
jsonObject.put("templateKey", tmpltListReqDto.getTmpltKey());
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
apiResultMap = (Map<Object, Object>) clientRequestService.callBySyncPost(callUrl, jsonObject);
|
||||||
|
|
||||||
|
if("0000".equals(apiResultMap.get("retCode"))) {
|
||||||
|
Map<Object, Object> dataMap = (Map<Object, Object>) apiResultMap.get("data");
|
||||||
|
Map<Object, Object> dataTempMap = (Map<Object, Object>) dataMap.get("list");
|
||||||
|
|
||||||
|
if(dataTempMap.get("comments") != null && !"".equals(dataTempMap.get("comments"))) {
|
||||||
|
rjtDataListMap = (List<Map<Object, Object>>) dataTempMap.get("comments");
|
||||||
|
tmpltListRes.setList(rjtDataListMap);
|
||||||
|
}
|
||||||
|
return new TmpltListResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||||
|
}else {
|
||||||
|
return new TmpltListResDto(ApiResponseCode.CM_DB_QUERY_ERR);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return new TmpltListResDto(ApiResponseCode.SUCCESS, tmpltListRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,9 @@ public class TmpltInfo implements Serializable {
|
|||||||
private String sendProfile;
|
private String sendProfile;
|
||||||
@ApiModelProperty(example = "20220320", name = "최종수정일자", dataType = "String")
|
@ApiModelProperty(example = "20220320", name = "최종수정일자", dataType = "String")
|
||||||
private String lastChgDt;
|
private String lastChgDt;
|
||||||
|
|
||||||
|
@ApiModelProperty(example = "da17d231bbf13f83174a36a4bb0353476ae012b3", name = "발신프로필_키", dataType = "String")
|
||||||
|
private String sndrprofKey;
|
||||||
|
@ApiModelProperty(example = "TPizuOloiF", name = "템플릿_키", dataType = "String")
|
||||||
|
private String tmpltKey;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,9 @@ public class TmpltListReqDto implements Serializable {
|
|||||||
private String channelAuthMenuNo;
|
private String channelAuthMenuNo;
|
||||||
@ApiModelProperty(example = "test", name = "사용자아이디", dataType = "int")
|
@ApiModelProperty(example = "test", name = "사용자아이디", dataType = "int")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(example = "da17d231bbf13f83174a36a4bb0353476ae012b3", name = "발신프로필_키", dataType = "String")
|
||||||
|
private String sndrprofKey;
|
||||||
|
@ApiModelProperty(example = "TPizuOloiF", name = "템플릿_키", dataType = "String")
|
||||||
|
private String tmpltKey;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class TmpltListResDto extends ResponseMessage implements Serializable {
|
|||||||
|
|
||||||
// 데이터.
|
// 데이터.
|
||||||
private TmpltListRes data;
|
private TmpltListRes data;
|
||||||
|
private RjtTmpltListRes rjtData;
|
||||||
|
|
||||||
public TmpltListResDto() {
|
public TmpltListResDto() {
|
||||||
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
this.retCode = ApiResponseCode.SUCCESS.getResultCode();
|
||||||
@@ -30,4 +31,9 @@ public class TmpltListResDto extends ResponseMessage implements Serializable {
|
|||||||
this.retMsg = returnStr.getResultMsg();
|
this.retMsg = returnStr.getResultMsg();
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TmpltListResDto(ApiResponseCode returnStr, RjtTmpltListRes rjtData) {
|
||||||
|
this.retCode = returnStr.getResultCode();
|
||||||
|
this.rjtData = rjtData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class WebClientRequestService {
|
|||||||
public Object callBySyncPost(String uri, Object param) {
|
public Object callBySyncPost(String uri, Object param) {
|
||||||
Date startTime = new Date();
|
Date startTime = new Date();
|
||||||
Object result = webClient.post().uri(uri).bodyValue(param).retrieve().bodyToMono(Object.class).block();
|
Object result = webClient.post().uri(uri).bodyValue(param).retrieve().bodyToMono(Object.class).block();
|
||||||
|
log.info("callBySyncPost duration Time : {}", (new Date().getTime() - startTime.getTime()) / 1000f);
|
||||||
log.debug("callBySyncPost duration Time : {}", (new Date().getTime() - startTime.getTime()) / 1000f);
|
log.debug("callBySyncPost duration Time : {}", (new Date().getTime() - startTime.getTime()) / 1000f);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user