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);