(1)增强字符串多选修改
(2)增强字符串权限增加
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -6,6 +7,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
@@ -29,6 +33,7 @@ import com.nis.web.controller.BaseController;
|
||||
public class ComplexStringCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
@RequiresPermissions(value={"cfg:complex:view"})
|
||||
public String cfgList(Model model,Integer audit,String cfgName,@ModelAttribute("cfg")ComplexkeywordCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", audit);
|
||||
@@ -43,7 +48,21 @@ public class ComplexStringCfgController extends BaseController{
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
cfg.setTableName(tableName);
|
||||
Page<ComplexkeywordCfg> page = complexStringCfgService.findPage(new Page<ComplexkeywordCfg>(request, response,"r"), cfg);
|
||||
Page<ComplexkeywordCfg> searchPage=new Page<ComplexkeywordCfg>(request,response,"r");
|
||||
String addWhrere=null;
|
||||
if(audit==Constants.CFG_PAGE){//
|
||||
addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_NO+")";
|
||||
}else if(audit==Constants.AUDIT_PAGE){
|
||||
addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_YES+")";
|
||||
}
|
||||
if(addWhrere!=null){
|
||||
if(StringUtils.isNotBlank(searchPage.getWhere())){
|
||||
searchPage.setWhere(searchPage.getWhere()+" AND "+addWhrere);
|
||||
}else{
|
||||
searchPage.setWhere(addWhrere);
|
||||
}
|
||||
}
|
||||
Page<ComplexkeywordCfg> page = complexStringCfgService.findPage(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
model.addAttribute("tableName", tableName);
|
||||
@@ -60,7 +79,8 @@ public class ComplexStringCfgController extends BaseController{
|
||||
|
||||
|
||||
@RequestMapping(value = {"form"})
|
||||
public String cfgForm(int action,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
|
||||
@RequiresPermissions(value={"cfg:complex:add"})
|
||||
public String cfgForm(int action,String cfgName,Integer serviceId,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
@@ -99,7 +119,8 @@ public class ComplexStringCfgController extends BaseController{
|
||||
return "/cfg/complexCfgForm";
|
||||
}
|
||||
@RequestMapping(value = {"updateForm"})
|
||||
public String updateStringCfgForm(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
|
||||
@RequiresPermissions(value={"cfg:complex:edit"})
|
||||
public String updateStringCfgForm(String tableName,int action,int compileId,String cfgName,Integer serviceId,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
@@ -114,9 +135,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
}
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
searchBean.setCompileId(compileId);
|
||||
searchBean.setTableName(tableName);
|
||||
ComplexkeywordCfg cfg=complexStringCfgService.getStringCfgById(searchBean);
|
||||
ComplexkeywordCfg cfg=complexStringCfgService.get(searchBean);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("tableName", tableName);
|
||||
initUpdateFormCondition(model,cfg);
|
||||
@@ -136,6 +157,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"saveOrUpdateCfg"})
|
||||
@RequiresPermissions(value={"cfg:complex:add","cfg:complex:edit"},logical=Logical.OR)
|
||||
public String saveOrUpdateStringCfg(String cfgName,Model model, ComplexkeywordCfg cfg,String areaCfgIds) {
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","complex");
|
||||
@@ -162,50 +184,68 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
public String auditStringCfg(String cfgName,ComplexkeywordCfg cfg,Model model) {
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"cfg:complex:audit"})
|
||||
public String auditStringCfg(String cfgName,int serviceId,int isAudit,int action,String tableName,String ids,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
model.addAttribute("cfgType", "complex");
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", action);
|
||||
try{
|
||||
String tableName=cfg.getTableName();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(cfg.getServiceId());
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
cfg.setTableName(tableName);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
ComplexkeywordCfg bean=complexStringCfgService.getStringCfgById(cfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
List<ComplexkeywordCfg> beans=complexStringCfgService.getList(tableName,ids);
|
||||
List<ComplexkeywordCfg> auditBeans=new ArrayList<>();
|
||||
List<AreaIpCfg> auditAreaBeans=new ArrayList<>();
|
||||
Date date=new Date();
|
||||
for(ComplexkeywordCfg bean:beans){
|
||||
ComplexkeywordCfg auditBean=new ComplexkeywordCfg();
|
||||
auditBean.setTableName(tableName);
|
||||
auditBean.setCfgId(bean.getCfgId());
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&isAudit!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
addMessage(model, "audit_failed");
|
||||
return "/cfg/resultPage";
|
||||
}else{
|
||||
auditBean.setAuditorId(bean.getCurrentUser().getId());
|
||||
auditBean.setAuditTime(date);
|
||||
auditBean.setIsAudit(isAudit);
|
||||
bean.setAuditorId(bean.getCurrentUser().getId());
|
||||
bean.setAuditTime(date);
|
||||
bean.setIsAudit(isAudit);
|
||||
if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
auditBean.setIsValid(Constants.VALID_NO);
|
||||
auditBean.setMaatTable(maatTable);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
auditBean.setIsValid(Constants.VALID_YES);
|
||||
auditBean.setMaatTable(maatTable);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId());
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
bean.setAreaCfg(areaCfg);
|
||||
auditAreaBeans.addAll(areaCfg);
|
||||
}
|
||||
auditBeans.add(auditBean);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"audit_success");
|
||||
}else{
|
||||
addMessage(model,"audit_failed");
|
||||
}
|
||||
|
||||
complexStringCfgService.auditStringCfg(isAudit,auditBeans,auditAreaBeans,beans);
|
||||
}
|
||||
addMessage(model,"audit_success");
|
||||
}catch(Exception e){
|
||||
logger.error("发生异常",e);
|
||||
addMessage(model,"audit_failed");
|
||||
@@ -221,8 +261,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"deleteCfg"})
|
||||
public String deleteStringCfg(String tableName,int action,long cfgId,int compileId,String cfgName,Integer serviceId,Model model) {
|
||||
@RequestMapping(value = {"delete"})
|
||||
@RequiresPermissions(value={"cfg:complex:delete"})
|
||||
public String deleteStringCfg(String tableName,int action,String ids,String cfgName,Integer serviceId,Model model) {
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
@@ -235,32 +276,33 @@ public class ComplexStringCfgController extends BaseController{
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(compileId);
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
List<ComplexkeywordCfg> complexCfgs=new ArrayList<ComplexkeywordCfg>();
|
||||
List<AreaIpCfg> areaCfgs=new ArrayList<AreaIpCfg>();
|
||||
Date date =new Date();
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
for(String compileIdStr:ids.split(",")){
|
||||
if(StringUtils.isNotBlank(compileIdStr)){
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(Integer.parseInt(compileIdStr));
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
c.setEditorId(c.getCurrentUser().getId());
|
||||
c.setEditTime(date);
|
||||
}
|
||||
}
|
||||
areaCfgs.addAll(areaCfg);
|
||||
ComplexkeywordCfg complexCfg=new ComplexkeywordCfg();
|
||||
complexCfg.setCompileId(Integer.parseInt(compileIdStr));
|
||||
complexCfg.setTableName(tableName);
|
||||
complexCfg.setEditorId(complexCfg.getCurrentUser().getId());
|
||||
complexCfg.setEditTime(date);
|
||||
complexCfg.setIsValid(Constants.VALID_DEL);
|
||||
complexCfgs.add(complexCfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES&&audit!=Constants.AUDIT_NOT_YES){
|
||||
ComplexkeywordCfg cfg=new ComplexkeywordCfg();
|
||||
cfg.setCfgId(cfgId);
|
||||
cfg.setTableName(tableName);
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=complexStringCfgService.deleteStringCfg(cfg,areaCfg);
|
||||
if(result==0){
|
||||
addMessage(model,"delete_failed");
|
||||
}else{
|
||||
addMessage(model,"delete_success");
|
||||
}
|
||||
}else{
|
||||
logger.error("通过审核/取消审核通过的配置不能删除!");
|
||||
addMessage(model,"delete_failed");
|
||||
}
|
||||
|
||||
complexStringCfgService.deleteStringCfg(complexCfgs,areaCfgs);
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"delete_failed");
|
||||
|
||||
@@ -310,6 +310,9 @@ public class IpCfgController extends BaseController{
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId());
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
bean.setAreaCfg(areaCfg);
|
||||
auditAreaBeans.addAll(areaCfg);
|
||||
}
|
||||
@@ -374,31 +377,6 @@ public class IpCfgController extends BaseController{
|
||||
ipCfgs.add(ipCfg);
|
||||
}
|
||||
}
|
||||
// int audit=ipCfgService.getIsAudit(tableName,cfgId);
|
||||
// List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(compileId);
|
||||
// if(areaCfg!=null&&areaCfg.size()>0){
|
||||
// for(AreaIpCfg c:areaCfg){
|
||||
// c.setTableName(AreaIpCfg.getTablename());
|
||||
// }
|
||||
// }
|
||||
//未审核时可删除
|
||||
// if(audit!=Constants.AUDIT_YES&&audit!=Constants.AUDIT_NOT_YES){
|
||||
// BaseIpCfg ipCfg=new BaseIpCfg();
|
||||
// ipCfg.setCfgId(cfgId);
|
||||
// ipCfg.setTableName(tableName);
|
||||
// ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
|
||||
// ipCfg.setEditTime(new Date());
|
||||
// ipCfg.setIsValid(Constants.VALID_DEL);
|
||||
// int result=ipCfgService.deleteIpCfg(ipCfg,areaCfg);
|
||||
// if(result==0){
|
||||
// addMessage(model,"delete_failed");
|
||||
// }else{
|
||||
// addMessage(model,"delete_success");
|
||||
// }
|
||||
// }else{
|
||||
// logger.error("通过审核/取消审核通过的配置不能删除!");
|
||||
// addMessage(model,"delete_failed");
|
||||
// }
|
||||
}
|
||||
ipCfgService.deleteIpCfg(ipCfgs,areaCfgs);
|
||||
addMessage(model,"delete_success");
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -253,6 +252,9 @@ public class StringCfgController extends BaseController{
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId());
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
bean.setAreaCfg(areaCfg);
|
||||
auditAreaBeans.addAll(areaCfg);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* IP相关配置数据处理类
|
||||
* 增强字符串相关配置数据处理类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@@ -17,6 +17,7 @@ import com.nis.web.dao.MyBatisDao;
|
||||
public interface ComplexStringCfgDao extends CrudDao<ComplexkeywordCfg>{
|
||||
public ComplexkeywordCfg getById(@Param("tableName")String tableName,@Param("cfgId")Long id) ;
|
||||
public ComplexkeywordCfg get(ComplexkeywordCfg entity) ;
|
||||
public List<ComplexkeywordCfg> getList(@Param("tableName")String tableName,@Param("ids")String ids) ;
|
||||
public List<ComplexkeywordCfg> findList(ComplexkeywordCfg entity) ;
|
||||
public int insert(ComplexkeywordCfg entity) ;
|
||||
public int updateByPrimaryKeySelective(ComplexkeywordCfg entity) ;
|
||||
@@ -27,4 +28,5 @@ public interface ComplexStringCfgDao extends CrudDao<ComplexkeywordCfg>{
|
||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||
public int getIsAudit(ComplexkeywordCfg entity);
|
||||
public int deleteByCompileId(ComplexkeywordCfg entity);
|
||||
public int delete(@Param("tableName")String tableName,@Param("ids")String ids);
|
||||
}
|
||||
|
||||
@@ -100,6 +100,11 @@
|
||||
AND IS_VALID!=-1
|
||||
</trim>
|
||||
</select>
|
||||
<select id="getList" resultMap="ComplexStringMap">
|
||||
SELECT
|
||||
<include refid="ComplexkeywordCfg_Column_List_with_id" />
|
||||
FROM ${tableName} WHERE IS_VALID!=-1 AND COMPILE_ID in (${ids})
|
||||
</select>
|
||||
<select id="findList" resultMap="ComplexStringMapWithUser">
|
||||
select
|
||||
<include refid="ComplexkeywordCfg_Column_List_with_id_alias"/>
|
||||
@@ -419,4 +424,15 @@
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.ComplexkeywordCfg" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="delete" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId !=null ">
|
||||
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -437,7 +437,7 @@
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="delete" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
<update id="delete" >
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId !=null ">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -7,9 +8,12 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
@@ -73,16 +77,27 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditStringCfg(ComplexkeywordCfg sendCfg,ComplexkeywordCfg cfg) throws Exception{
|
||||
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
|
||||
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
public void auditStringCfg(int isAduit,List<ComplexkeywordCfg> auditCfg,List<AreaIpCfg> areaCfg,List<ComplexkeywordCfg> sendCfg) throws Exception{
|
||||
List<BaseCfg[]> sendCfgs=new ArrayList<BaseCfg[]>();
|
||||
for(ComplexkeywordCfg c:sendCfg){
|
||||
BaseCfg[] cArr=new BaseCfg[1];
|
||||
cArr[0]=c;
|
||||
sendCfgs.add(cArr);
|
||||
}
|
||||
if(Constants.AUDIT_NOT_YES==isAduit||
|
||||
Constants.AUDIT_YES==isAduit){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertorBatch(isAduit,sendCfgs)){
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
this.auditIpBatch(areaCfg);
|
||||
}
|
||||
this.auditBatch(auditCfg, IpCfgDao.class);
|
||||
}
|
||||
}else{
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
this.auditIpBatch(areaCfg);
|
||||
}
|
||||
this.auditBatch(auditCfg, ComplexStringCfgDao.class);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -95,11 +110,11 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteStringCfg(ComplexkeywordCfg cfg,List<AreaIpCfg> areaCfg){
|
||||
public void deleteStringCfg(List<ComplexkeywordCfg> cfgs,List<AreaIpCfg> areaCfg){
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
this.deleteIpBatch(areaCfg);
|
||||
}
|
||||
return complexStringCfgDao.updateValid(cfg);
|
||||
this.deleteBatch(cfgs, ComplexStringCfgDao.class);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -127,4 +142,18 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return complexStringCfgDao.getIsAudit(tableName,id);
|
||||
}
|
||||
/**
|
||||
* getList(这里用一句话描述这个方法的作用)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param tableName
|
||||
* @param ids
|
||||
* @return
|
||||
*List<BaseIpCfg>
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public List<ComplexkeywordCfg> getList(String tableName, String ids) {
|
||||
// TODO Auto-generated method stub
|
||||
return complexStringCfgDao.getList(tableName, ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,19 @@
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -50,10 +54,12 @@
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<%-- <button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/complex/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button> --%>
|
||||
<c:if test="${audit==0}">
|
||||
<shiro:hasPermission name="cfg:complex:add">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/cfg/complex/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
</shiro:hasPermission>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
@@ -107,27 +113,38 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<%-- <button type="button" class="btn btn-default btn-sm" onclick="return page()">
|
||||
<i class="fa fa-edit"></i><spring:message code="search"></spring:message>
|
||||
</button> --%>
|
||||
<%-- <div class="pull-left">
|
||||
<c:set var="sortI18n"><spring:message code="sort"/></c:set>
|
||||
<select name="orderBy" class="selectpicker select2 input-small">
|
||||
<option value="" <c:if test="${empty page.orderBy}">selected</c:if> ><spring:message code="${sortI18n}"/></option>
|
||||
<option value="${page.alias}.create_time asc" <c:if test="${fn:contains(page.orderBy,'create_time asc') }">selected</c:if> ><spring:message code="createTime_asc"/></option>
|
||||
<option value="${page.alias}.create_time desc" <c:if test="${fn:contains(page.orderBy , 'create_time desc') }">selected</c:if> ><spring:message code="createTime_desc"/></option>
|
||||
<option value="${page.alias}.edit_time asc" <c:if test="${fn:contains(page.orderBy , 'edit_time asc') }">selected</c:if> ><spring:message code="editTime_asc"/></option>
|
||||
<option value="${page.alias}.edit_time desc" <c:if test="${fn:contains(page.orderBy , 'edit_time desc') }">selected</c:if> ><spring:message code="editTime_desc"/></option>
|
||||
<option value="${page.alias}.audit_time asc" <c:if test="${fn:contains(page.orderBy , 'audit_time asc') }">selected</c:if> ><spring:message code="auditTime_asc"/></option>
|
||||
<option value="${page.alias}.audit_time desc" <c:if test="${fn:contains(page.orderBy , 'audit_time desc') }">selected</c:if> ><spring:message code="auditTime_desc"/></option>
|
||||
</select>
|
||||
</div> --%>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<c:if test="${audit==0}">
|
||||
<shiro:hasPermission name="cfg:complex:edit">
|
||||
<button type="button" class="btn btn-default" onClick="edit('${ctx}/cfg/complex/updateForm?serviceId=${serviceId}&action=${action}&tableName=${tableName}&cfgName=${cfgName}')">
|
||||
<i class="fa fa-edit"></i> <spring:message code="edit"></spring:message></button>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="cfg:complex:delete">
|
||||
<sys:delRow url="${ctx}/cfg/complex/delete?serviceId=${serviceId}&action=${action}&tableName=${tableName}&cfgName=${cfgName}" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
<!-- <button type="button" class="btn btn-default">
|
||||
<i class="fa fa-download"></i> 导出</button> -->
|
||||
</c:if>
|
||||
<c:if test="${audit==1}">
|
||||
<shiro:hasPermission name="cfg:complex:audit">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><sys:delRow url="${ctx}/cfg/complex/audit?serviceId=${serviceId}&action=${action}&tableName=${tableName}&cfgName=${cfgName}&isAudit=1" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/complex/audit?serviceId=${serviceId}&action=${action}&tableName=${tableName}&cfgName=${cfgName}&isAudit=2" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/complex/audit?serviceId=${serviceId}&action=${action}&tableName=${tableName}&cfgName=${cfgName}&isAudit=3" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
</c:if>
|
||||
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||
<i class="icon-wrench"></i>
|
||||
@@ -265,6 +282,7 @@
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="key_word"/></th>
|
||||
@@ -282,12 +300,13 @@
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th><spring:message code="operation"></spring:message></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.compileId}" value="${cfg.isAudit}"></td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<%-- <td>${cfg.district }</td> --%>
|
||||
@@ -349,7 +368,7 @@
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>
|
||||
<%-- <td>
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="operation"></spring:message><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
@@ -377,7 +396,7 @@
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</td> --%>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user