1.修改主题网站topic从码表中获取

This commit is contained in:
zhanghongqing
2018-08-23 20:53:04 +08:00
parent be0107e748
commit 50d8d8c10f
6 changed files with 37 additions and 20 deletions

View File

@@ -33,7 +33,7 @@ public class AppTopicDomainCfg extends BaseCfg<AppTopicDomainCfg> {
private String domain;
private String cfgKeywords;
private String appName;
private Integer topic;
private String topic;
@Expose
@ExcelField(title="expression_type")
@@ -51,11 +51,11 @@ public class AppTopicDomainCfg extends BaseCfg<AppTopicDomainCfg> {
protected Integer isHexbin;
public Integer getTopic() {
public String getTopic() {
return topic;
}
public void setTopic(Integer topic) {
public void setTopic(String topic) {
this.topic = topic;
}

View File

@@ -30,9 +30,11 @@ import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.CallExternalProceduresException;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult;
import com.nis.web.security.UserUtils;
/**
@@ -879,10 +881,19 @@ public class AppCfgController extends BaseController {
public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTopicDomainCfg> searchPage=new Page<AppTopicDomainCfg>(request,response,"r");
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(searchPage, cfg);
// for(AppDomainCfg entity:page.getList()){
// for(AppTopicDomainCfg entity:page.getList()){
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
// entity.setAppName(app.getSpecServiceName());
// }
//设置topic主题
for (AppTopicDomainCfg entity:page.getList()) {
List<CodeResult> codeList = CodeDicUtils.getCodeList("serviceCode");
for (CodeResult codeResult : codeList) {
if(null!=entity.getTopic()&&codeResult.getCode().equals(entity.getTopic())){
entity.setAppName(codeResult.getItem());
}
}
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTopicDomainCfgList";
@@ -896,7 +907,7 @@ public class AppCfgController extends BaseController {
*/
@RequestMapping(value = {"topicDomainCfgForm"})
@RequiresPermissions(value={"app:topic:config"})
public String topicDomainCfgForm(Model model,String ids,AppTopicDomainCfg entity) {
public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);

View File

@@ -140,7 +140,7 @@
<resultMap id="AppTopicDomainCfgMap" type="com.nis.domain.configuration.AppTopicDomainCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="topic" property="topic" jdbcType="INTEGER" />
<result column="topic" property="topic" jdbcType="VARCHAR" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="domain" property="domain" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
@@ -398,7 +398,7 @@
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}
</sql>
<sql id="AppTopicCommonCfg_Value_List" >
#{topic,jdbcType=INTEGER},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER},
#{topic,jdbcType=VARCHAR},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER},
#{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
@@ -980,6 +980,7 @@
</otherwise>
</choose>
</select>
<!-- 主题网站列表 -->
<select id="findAppTopicDomainList" resultMap="AppTopicDomainCfgMap">
select
<include refid="AppTopicDomainCfg_Column"/>
@@ -2113,7 +2114,7 @@
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="topic != null">
TOPIC = #{topic,jdbcType=INTEGER},
TOPIC = #{topic,jdbcType=VARCHAR},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},

View File

@@ -1031,11 +1031,11 @@ public class AppCfgService extends BaseService {
maatCfg.setIsValid(entity.getIsValid());
//设置APP自定义域
// String userRegion = "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
// "DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+
// "DOMAIN_STR="+keywordsEscape(entity.getDomain());
//
// maatCfg.setUserRegion(userRegion);
// "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
String userRegion = "DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+
"DOMAIN_STR="+keywordsEscape(entity.getDomain());
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);

View File

@@ -94,9 +94,14 @@ $(function(){
<label class="control-label col-md-3">
<spring:message code="app_topic_domain_cfg" /></label>
<div class="col-md-6">
<input class="form-control number required" type="text"
name="topic"
value="${_cfg.topic}">
<%-- <c:if test="${empty _cfg.topic}"> --%>
<form:select path="_cfg.topic" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<c:forEach items="${fns:getCodeList('serviceCode')}" var="dict">
<form:option value="${dict.code}"><spring:message code="${dict.item}"/></form:option>
</c:forEach>
</form:select>
<%-- </c:if> --%>
</div>
<div for="topic"></div>
</div>
@@ -153,14 +158,14 @@ $(function(){
<div for="domain"></div>
</div>
</div>
<%-- <div class="col-md-6">
<div class="col-md-6" hidden="true">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
<input type="radio" name="doLog" checked value="0" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
@@ -171,7 +176,7 @@ $(function(){
</c:choose>
</c:forEach>
</div>
</div> --%>
</div>
</div>
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">

View File

@@ -304,7 +304,7 @@
</td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.topic }</td>
<td>${cfg.appName }</td>
<td>${cfg.domain }</td>
<td>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">