Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.nis.domain.configuration;
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -131,6 +131,7 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
public static void sortList(List<ServiceDictInfo> list, List<ServiceDictInfo> sourcelist, Integer parentId, boolean cascade){
|
||||
for (int i=0; i<sourcelist.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = sourcelist.get(i);
|
||||
//System.out.println(serviceDictInfo.getServiceDictId()+">>>>>"+serviceDictInfo.getParent().getServiceDictId());
|
||||
if (serviceDictInfo.getParent()!=null && serviceDictInfo.getParent().getServiceDictId()!=null
|
||||
&& serviceDictInfo.getParent().getServiceDictId().equals(parentId)){
|
||||
list.add(serviceDictInfo);
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.nis.domain.configuration;
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.BaseEntity;
|
||||
|
||||
public class RequestInfo extends BaseEntity<RequestInfo>{
|
||||
|
||||
private Long taskId;
|
||||
|
||||
private String requestNumber;
|
||||
|
||||
private String requestOrg;
|
||||
@@ -39,8 +42,18 @@ public class RequestInfo extends BaseEntity<RequestInfo>{
|
||||
private Date beginDate;//开始时间
|
||||
private Date endDate;//结束时间
|
||||
private String timeType;//时间类型
|
||||
private String taskName;//专项任务
|
||||
|
||||
public String getRequestNumber() {
|
||||
|
||||
public Long getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(Long taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getRequestNumber() {
|
||||
return requestNumber;
|
||||
}
|
||||
|
||||
@@ -191,5 +204,13 @@ public class RequestInfo extends BaseEntity<RequestInfo>{
|
||||
public void setTimeType(String timeType) {
|
||||
this.timeType = timeType;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
}
|
||||
131
src/main/java/com/nis/domain/configuration/TaskInfo.java
Normal file
131
src/main/java/com/nis/domain/configuration/TaskInfo.java
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.nis.domain.BaseEntity;
|
||||
|
||||
public class TaskInfo extends BaseEntity<TaskInfo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String taskName;
|
||||
|
||||
private String taskOrg;
|
||||
|
||||
private Date taskTime;
|
||||
|
||||
private String taskDesc;
|
||||
|
||||
private Integer isValid;
|
||||
|
||||
private Integer isAudit;
|
||||
|
||||
private Integer creatorId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Integer editorId;
|
||||
|
||||
private Date editTime;
|
||||
|
||||
private Integer auditorId;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskOrg() {
|
||||
return taskOrg;
|
||||
}
|
||||
|
||||
public void setTaskOrg(String taskOrg) {
|
||||
this.taskOrg = taskOrg;
|
||||
}
|
||||
|
||||
public Date getTaskTime() {
|
||||
return taskTime;
|
||||
}
|
||||
|
||||
public void setTaskTime(Date taskTime) {
|
||||
this.taskTime = taskTime;
|
||||
}
|
||||
|
||||
public String getTaskDesc() {
|
||||
return taskDesc;
|
||||
}
|
||||
|
||||
public void setTaskDesc(String taskDesc) {
|
||||
this.taskDesc = taskDesc;
|
||||
}
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public Integer getIsAudit() {
|
||||
return isAudit;
|
||||
}
|
||||
|
||||
public void setIsAudit(Integer isAudit) {
|
||||
this.isAudit = isAudit;
|
||||
}
|
||||
|
||||
public Integer getCreatorId() {
|
||||
return creatorId;
|
||||
}
|
||||
|
||||
public void setCreatorId(Integer creatorId) {
|
||||
this.creatorId = creatorId;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Integer getEditorId() {
|
||||
return editorId;
|
||||
}
|
||||
|
||||
public void setEditorId(Integer editorId) {
|
||||
this.editorId = editorId;
|
||||
}
|
||||
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
|
||||
public Integer getAuditorId() {
|
||||
return auditorId;
|
||||
}
|
||||
|
||||
public void setAuditorId(Integer auditorId) {
|
||||
this.auditorId = auditorId;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -9,11 +9,11 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.web.dao.SysDictDao;
|
||||
import com.nis.web.dao.configuration.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.configuration.SysDictInfoDao;
|
||||
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.nis.web.service.OfficeService;
|
||||
import com.nis.web.service.RoleService;
|
||||
import com.nis.web.service.SystemService;
|
||||
import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.ServiceDictInfoService;
|
||||
import com.nis.web.service.basics.SysDictInfoService;
|
||||
import com.nis.web.service.configuration.AppCfgService;
|
||||
import com.nis.web.service.configuration.ComplexStringCfgService;
|
||||
import com.nis.web.service.configuration.FtpCfgService;
|
||||
@@ -34,10 +36,8 @@ import com.nis.web.service.configuration.MailCfgService;
|
||||
import com.nis.web.service.configuration.MediaCfgService;
|
||||
import com.nis.web.service.configuration.NumCfgService;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
import com.nis.web.service.configuration.ServiceDictInfoService;
|
||||
import com.nis.web.service.configuration.SslCfgService;
|
||||
import com.nis.web.service.configuration.StringCfgService;
|
||||
import com.nis.web.service.configuration.SysDictInfoService;
|
||||
import com.nis.web.service.configuration.TunnelCfgService;
|
||||
import com.nis.web.service.configuration.WebCfgService;
|
||||
import com.nis.web.service.systemService.ServiceConfigInfoService;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -19,14 +19,13 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/configuration/serviceDictInfo")
|
||||
@RequestMapping(value = "${adminPath}/basics/serviceDictInfo")
|
||||
public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
|
||||
@@ -78,6 +77,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
model.addAttribute("selectedType", serviceDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
serviceDictInfo.setItemType(selectedType);
|
||||
}
|
||||
|
||||
//查出顶层分页数据
|
||||
@@ -87,32 +87,19 @@ public class ServiceDictInfoController extends BaseController {
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){
|
||||
for(ServiceDictInfo topTemp:page.getList()){
|
||||
if(temp.getServiceDictId()==topTemp.getServiceDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
ServiceDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null&&se.getParent().getServiceDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
allList.addAll(page.getList());
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/serviceDictList";
|
||||
return "/basics/serviceDictList";
|
||||
}
|
||||
|
||||
|
||||
@@ -134,9 +121,9 @@ public class ServiceDictInfoController extends BaseController {
|
||||
Integer selectedType = null;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
selectedType = serviceDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
}
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType;
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
@@ -149,7 +136,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
model.addAttribute("page", page);
|
||||
|
||||
|
||||
return "/cfg/serviceDictInfoSearchList";
|
||||
return "/basics/serviceDictInfoSearchList";
|
||||
}
|
||||
|
||||
|
||||
@@ -162,12 +149,12 @@ public class ServiceDictInfoController extends BaseController {
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(ServiceDictInfo serviceDictInfo, Model model,String doAction,String itType) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictInfo";
|
||||
return "/basics/serviceDictInfo";
|
||||
}
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getServiceDictId() == null||serviceDictInfo.getParent().getServiceDictId() == 0) {
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
parent.setItemValue("无上级");
|
||||
parent.setItemValue("根节点");
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
@@ -178,7 +165,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("serviceDictInfo", serviceDictInfo);
|
||||
model.addAttribute("itType", itType);
|
||||
return "/cfg/serviceDictForm";
|
||||
return "/basics/serviceDictForm";
|
||||
}
|
||||
/**
|
||||
* 新增或修改
|
||||
@@ -199,7 +186,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
|
||||
|
||||
|
||||
}
|
||||
@@ -220,7 +207,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
|
||||
@@ -237,9 +224,9 @@ public class ServiceDictInfoController extends BaseController {
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response, String itType) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", -1);
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("name","无上级");
|
||||
map2.put("name","根节点");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
//找出该类型所有的非叶子配置
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -19,14 +19,13 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/configuration/sysDictInfo")
|
||||
@RequestMapping(value = "${adminPath}/basics/sysDictInfo")
|
||||
public class SysDictInfoController extends BaseController {
|
||||
|
||||
|
||||
@@ -78,6 +77,7 @@ public class SysDictInfoController extends BaseController {
|
||||
model.addAttribute("selectedType", sysDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
sysDictInfo.setItemType(selectedType);
|
||||
}
|
||||
|
||||
//查出顶层分页数据
|
||||
@@ -87,32 +87,19 @@ public class SysDictInfoController extends BaseController {
|
||||
List<SysDictInfo> allList = sysDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getSysDictId()!=null&&temp.getParent().getSysDictId()==0){
|
||||
for(SysDictInfo topTemp:page.getList()){
|
||||
if(temp.getSysDictId()==topTemp.getSysDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
|
||||
SysDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getParent()!=null&&se.getParent().getSysDictId()!=null&&se.getParent().getSysDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
|
||||
allList.addAll(page.getList());
|
||||
SysDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/sysDictList";
|
||||
return "/basics/sysDictList";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,9 +120,9 @@ public class SysDictInfoController extends BaseController {
|
||||
Integer selectedType = null;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
selectedType = sysDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/configuration/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
}
|
||||
return "redirect:"+ adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
@@ -148,7 +135,7 @@ public class SysDictInfoController extends BaseController {
|
||||
model.addAttribute("page", page);
|
||||
|
||||
|
||||
return "/cfg/sysDictInfoSearchList";
|
||||
return "/basics/sysDictInfoSearchList";
|
||||
}
|
||||
|
||||
|
||||
@@ -169,12 +156,12 @@ public class SysDictInfoController extends BaseController {
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(SysDictInfo sysDictInfo, Model model, String doAction, String itType) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/sysDictInfo";
|
||||
return "/basics/sysDictInfo";
|
||||
}
|
||||
if (sysDictInfo.getParent() == null || sysDictInfo.getParent().getSysDictId() == null||sysDictInfo.getParent().getSysDictId() == 0) {
|
||||
SysDictInfo parent = new SysDictInfo();
|
||||
parent.setSysDictId(0);
|
||||
parent.setItemValue("无上级");
|
||||
parent.setItemValue("根节点");
|
||||
sysDictInfo.setParent(parent);
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
@@ -185,7 +172,7 @@ public class SysDictInfoController extends BaseController {
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("sysDictInfo", sysDictInfo);
|
||||
model.addAttribute("itType", itType);
|
||||
return "/cfg/sysDictForm";
|
||||
return "/basics/sysDictForm";
|
||||
}
|
||||
/**
|
||||
* 新增或修改
|
||||
@@ -206,7 +193,7 @@ public class SysDictInfoController extends BaseController {
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +211,7 @@ public class SysDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
|
||||
@@ -241,9 +228,9 @@ public class SysDictInfoController extends BaseController {
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response, String itType) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", -1);
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("name","无上级");
|
||||
map2.put("name","根节点");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
//找出该类型所有的非叶子配置
|
||||
@@ -17,7 +17,7 @@ import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
|
||||
@@ -1,136 +1,146 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
/**
|
||||
* 测试类
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/request")
|
||||
public class RequestInfoController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
|
||||
/**
|
||||
*来函列表
|
||||
*/
|
||||
@RequestMapping(value = {"list",""})
|
||||
public String list(RequestInfo requestInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<RequestInfo> page = requestInfoService.findRequestInfo(new Page<RequestInfo>(request, response), requestInfo);
|
||||
model.addAttribute("page", page);
|
||||
return "/cfg/requestList";
|
||||
}
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(RequestInfo requestInfo, Model model) {
|
||||
if(requestInfo.getId()!=null){
|
||||
requestInfo = requestInfoService.getRequestInfoById(requestInfo.getId());
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
}
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
return "/cfg/requestForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(RequestInfo requestInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
if(requestInfo.getId()!=null){
|
||||
// 保存用户信息
|
||||
logger.info(requestInfo.getId()+"修改成功");
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
}else{
|
||||
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
||||
logger.info(requestInfo.getRequestNumber()+"重复数据");
|
||||
addMessage(model, "error");
|
||||
return form(requestInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
logger.info(requestInfo.getId()+"保存成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
addMessage(model, "error");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否有效
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "checkRequestNumber")
|
||||
public String checkRequestNumber(String requestNumber) {
|
||||
if (requestNumber !=null && requestInfoService.getRequestInfoByRequestNumber(requestNumber) == null) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestExamine")
|
||||
public String requestExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.requestExamine(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 取消审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestCancelExamine")
|
||||
public String requestCancelExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.requestCancelExamine(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.delete(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.configuration.RequestInfoService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/request")
|
||||
public class RequestInfoController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private RequestInfoService requestInfoService;
|
||||
|
||||
|
||||
/**
|
||||
*来函列表
|
||||
*/
|
||||
@RequestMapping(value = {"list",""})
|
||||
public String list(RequestInfo requestInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
Page<RequestInfo> page = requestInfoService.findRequestInfo(new Page<RequestInfo>(request, response), requestInfo);
|
||||
model.addAttribute("page", page);
|
||||
return "/cfg/requestList";
|
||||
}
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(RequestInfo requestInfo, Model model) {
|
||||
TaskInfo taskInfo = new TaskInfo();
|
||||
taskInfo.setId(requestInfo.getTaskId());
|
||||
showTask(taskInfo,model);
|
||||
if(requestInfo.getId()!=null){
|
||||
requestInfo = requestInfoService.getRequestInfoById(requestInfo.getId());
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
}else{
|
||||
model.addAttribute("requestInfo", requestInfo);
|
||||
}
|
||||
return "/cfg/requestForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(RequestInfo requestInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
if(requestInfo.getId()!=null){
|
||||
// 保存用户信息
|
||||
logger.info(requestInfo.getId()+"修改成功");
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
}else{
|
||||
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
||||
logger.info(requestInfo.getRequestNumber()+"重复数据");
|
||||
addMessage(model, "error");
|
||||
return form(requestInfo, model);
|
||||
}
|
||||
// 保存用户信息
|
||||
requestInfoService.saveOrUpdate(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
logger.info(requestInfo.getId()+"保存成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
e.printStackTrace();
|
||||
addMessage(model, "error");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否有效
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "checkRequestNumber")
|
||||
public String checkRequestNumber(String requestNumber) {
|
||||
if (requestNumber !=null && requestInfoService.getRequestInfoByRequestNumber(requestNumber) == null) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestExamine")
|
||||
public String requestExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.requestExamine(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 取消审核
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "requestCancelExamine")
|
||||
public String requestCancelExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.requestCancelExamine(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param requestInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){
|
||||
requestInfoService.delete(requestInfo);
|
||||
addMessage(redirectAttributes, "success");
|
||||
return "redirect:" + adminPath + "/cfg/request/list?repage";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询专项任务
|
||||
* @param taskInfo
|
||||
* @param model
|
||||
*/
|
||||
public void showTask(TaskInfo taskInfo ,Model model){
|
||||
List<TaskInfo> taskInfos = requestInfoService.showTask(taskInfo);
|
||||
model.addAttribute("taskInfos", taskInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@@ -70,12 +70,18 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findByItemCode(Integer itemCode);
|
||||
/**
|
||||
* 查询itemCode最大值
|
||||
* @return
|
||||
*/
|
||||
Integer findMaxItemCode();
|
||||
|
||||
|
||||
|
||||
|
||||
List<ServiceDictInfo> findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid);
|
||||
List<ServiceDictInfo> findAllItemDict(@Param("itemType")int itemType);
|
||||
|
||||
|
||||
|
||||
|
||||
284
src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml
Normal file
284
src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml
Normal file
@@ -0,0 +1,284 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.basics.ServiceDictInfoDao" >
|
||||
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.basics.ServiceDictInfo" >
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.basics.ServiceDictInfo">
|
||||
<id column="parent_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
</association>
|
||||
<!-- 创建人员 -->
|
||||
<association property="serviceDictCreator" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="creator_id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
<!-- 修改人员 -->
|
||||
<association property="serviceDictEditor" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="editor_id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="serviceDictInfoColumns">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.parent_id AS "parent.serviceDictId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid,
|
||||
s.creator_id AS "serviceDictCreator.id",
|
||||
s.create_time AS createTime,
|
||||
s.editor_id AS "serviceDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询顶层分页列表 (!=)-->
|
||||
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 查出所有 -->
|
||||
<select id="findAllDictList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.basics.ServiceDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(!=) -->
|
||||
<select id="findDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != ${itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.basics.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.service_dict_id = #{serviceDictId}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from service_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.basics.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
<!-- 查出最大的itemCode值 -->
|
||||
<select id="findMaxItemCode" resultType="java.lang.Integer">
|
||||
select max(s.item_code) from service_dict_info s
|
||||
</select>
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
|
||||
<insert id="insertDict" parameterType="com.nis.domain.basics.ServiceDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into service_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time)
|
||||
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
|
||||
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
|
||||
#{parent.serviceDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},
|
||||
#{serviceDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
UPDATE service_dict_info s SET
|
||||
s.service_dict_id = #{serviceDictId},
|
||||
s.item_type = #{itemType},
|
||||
s.item_code = #{itemCode},
|
||||
s.item_value = #{itemValue},
|
||||
s.item_desc = #{itemDesc},
|
||||
s.parent_id = #{parent.serviceDictId},
|
||||
s.is_leaf = #{isLeaf},
|
||||
s.creator_id = #{serviceDictCreator.id},
|
||||
s.editor_id = #{serviceDictEditor.id},
|
||||
s.edit_time = #{editTime}
|
||||
WHERE s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<!-- 删除 -->
|
||||
|
||||
<update id="delete">
|
||||
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<select id="findItemDict" resultMap="dictResultMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType} and s.is_valid=#{isValid};
|
||||
</select>
|
||||
<select id="findAllItemDict" resultMap="dictResultMap">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
|
||||
</select>
|
||||
|
||||
<sql id="menuJoins">
|
||||
LEFT JOIN service_dict_info p ON p.service_dict_id = s.parent_id
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@@ -69,6 +69,12 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
*/
|
||||
List<SysDictInfo> getDictByParentId(Integer parentId);
|
||||
|
||||
/**
|
||||
* 查询最大itemCode值
|
||||
* @return
|
||||
*/
|
||||
Integer findMaxItemCode();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.SysDictInfoDao" >
|
||||
<mapper namespace="com.nis.web.dao.basics.SysDictInfoDao" >
|
||||
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.configuration.SysDictInfo" >
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.basics.SysDictInfo" >
|
||||
<id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
@@ -13,23 +13,18 @@
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.configuration.SysDictInfo">
|
||||
<id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<association property="parent" javaType="com.nis.domain.basics.SysDictInfo">
|
||||
<id column="parent_id" property="sysDictId" jdbcType="INTEGER" />
|
||||
</association>
|
||||
<!-- 创建人员 -->
|
||||
<association property="sysDictCreator" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<id property="id" column="creator_id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
<!-- 修改人员 -->
|
||||
<association property="sysDictEditor" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<id property="id" column="editor_id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
@@ -54,7 +49,7 @@
|
||||
</sql>
|
||||
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
@@ -94,7 +89,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
@@ -127,7 +122,7 @@
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.configuration.SysDictInfo">
|
||||
<select id="getDictById" resultType="com.nis.domain.basics.SysDictInfo">
|
||||
select
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
from sys_dict_info s where s.sys_dict_id = #{sysDictId}
|
||||
@@ -135,7 +130,7 @@
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
|
||||
<insert id="insertDict" parameterType="com.nis.domain.configuration.SysDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
<insert id="insertDict" parameterType="com.nis.domain.basics.SysDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into sys_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time)
|
||||
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
|
||||
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
|
||||
@@ -147,7 +142,7 @@
|
||||
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.SysDictInfo" parameterType="java.lang.Integer">
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.basics.SysDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
FROM sys_dict_info s
|
||||
@@ -179,7 +174,7 @@
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.SysDictInfo">
|
||||
<select id="findByItemCode" resultType="com.nis.domain.basics.SysDictInfo">
|
||||
select
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
from sys_dict_info s where s.item_code = #{itemCode}
|
||||
@@ -192,5 +187,9 @@
|
||||
from sys_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<!-- 查询最大itemCode值 -->
|
||||
<select id="findMaxItemCode" resultType="java.lang.Integer">
|
||||
select max(s.item_code) from sys_dict_info s
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@@ -20,14 +21,8 @@ public interface RequestInfoDao extends CrudDao {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
List<TaskInfo> showTask(TaskInfo taskInfo);
|
||||
|
||||
int insertSelective(RequestInfo requestInfo);
|
||||
|
||||
RequestInfo selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(RequestInfo requestInfo);
|
||||
|
||||
int updateByPrimaryKey(RequestInfo requestInfo);
|
||||
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
<result column="edit_time" jdbcType="DATE" property="editTime" />
|
||||
<result column="auditor_id" jdbcType="INTEGER" property="auditorId" />
|
||||
<result column="audit_time" jdbcType="DATE" property="auditTime" />
|
||||
<result column="task_id" jdbcType="BIGINT" property="taskId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, request_number, request_org, request_time, request_title, request_content, is_valid,
|
||||
@@ -25,6 +26,7 @@
|
||||
<select id="findRequestInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
r.id AS id,
|
||||
r.task_id AS taskId,
|
||||
r.request_number AS requestNumber,
|
||||
r.request_org AS requestOrg,
|
||||
r.request_time AS requestTime,
|
||||
@@ -37,11 +39,13 @@
|
||||
u.name AS editorName,
|
||||
r.edit_time AS editTime,
|
||||
e.name AS currentName,
|
||||
r.audit_time AS auditTime
|
||||
r.audit_time AS auditTime,
|
||||
t.task_name AS taskName
|
||||
from request_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user u on r.editor_id=u.id
|
||||
left join sys_user e on r.auditor_id=e.id
|
||||
left join task_info t on r.task_id=t.id
|
||||
where r.is_valid=1 and r.is_audit !=3
|
||||
<if test="requestTitle != null and requestTitle != ''">
|
||||
AND r.request_title like
|
||||
@@ -159,159 +163,4 @@
|
||||
where id = #{id,jdbcType=BIGINT} and is_audit !=1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<insert id="insertSelective" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
insert into request_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="requestNumber != null">
|
||||
request_number,
|
||||
</if>
|
||||
<if test="requestOrg != null">
|
||||
request_org,
|
||||
</if>
|
||||
<if test="requestTime != null">
|
||||
request_time,
|
||||
</if>
|
||||
<if test="requestTitle != null">
|
||||
request_title,
|
||||
</if>
|
||||
<if test="requestContent != null">
|
||||
request_content,
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
is_valid,
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
is_audit,
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
editor_id,
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
edit_time,
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
auditor_id,
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
audit_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="requestNumber != null">
|
||||
#{requestNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestOrg != null">
|
||||
#{requestOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestTime != null">
|
||||
#{requestTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="requestTitle != null">
|
||||
#{requestTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="requestContent != null">
|
||||
#{requestContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
#{editTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
#{auditTime,jdbcType=DATE},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.configuration.RequestInfo">
|
||||
update request_info
|
||||
set request_number = #{requestNumber,jdbcType=VARCHAR},
|
||||
request_org = #{requestOrg,jdbcType=VARCHAR},
|
||||
request_time = #{requestTime,jdbcType=DATE},
|
||||
request_title = #{requestTitle,jdbcType=VARCHAR},
|
||||
request_content = #{requestContent,jdbcType=VARCHAR},
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=DATE},
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
edit_time = #{editTime,jdbcType=DATE},
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
audit_time = #{auditTime,jdbcType=DATE}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<select id="findAllList" resultMap="BaseResultMap">
|
||||
select
|
||||
r.id AS id,
|
||||
r.request_number AS requestNumber,
|
||||
r.request_org AS requestOrg,
|
||||
r.request_time AS requestTime,
|
||||
r.request_title AS requestTitle,
|
||||
r.request_content AS requestContent,
|
||||
r.is_valid AS isValid,
|
||||
r.is_audit AS isAudit,
|
||||
s.name AS creatorName,
|
||||
r.create_time AS createTime,
|
||||
u.name AS editorName,
|
||||
r.edit_time AS editTime,
|
||||
e.name AS currentName,
|
||||
r.audit_time AS auditTime
|
||||
from request_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user u on r.editor_id=u.id
|
||||
left join sys_user e on r.auditor_id=e.id
|
||||
<trim prefix="where" prefixOverrides="AND|OR">
|
||||
<if test="requestTitle != null and requestTitle != ''">
|
||||
AND r.request_title like
|
||||
<if test="dbName == 'mysql'">CONCAT('%',#{requestTitle}, '%')</if>
|
||||
</if>
|
||||
<if test="requestContent != null and requestContent != ''">
|
||||
AND r.request_content like
|
||||
<if test="dbName == 'mysql'">CONCAT('%',#{requestContent},'%')</if>
|
||||
</if>
|
||||
<if test="requestNumber != null and requestNumber != ''">
|
||||
AND r.request_number=#{requestNumber}
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.is_audit=${isAudit}
|
||||
</if>
|
||||
<if test=" timeType = 'requestTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
|
||||
AND r.request_time between #{beginDate} and #{endDate}
|
||||
</if>
|
||||
<if test="timeType = 'createTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
|
||||
AND (r.create_time between #{beginDate} and #{endDate}) or (r.audit_time between #{beginDate} and #{endDate})
|
||||
</if>
|
||||
</trim>
|
||||
order by r.request_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface TaskInfoDao extends CrudDao<TaskInfo>{
|
||||
}
|
||||
192
src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml
Normal file
192
src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml
Normal file
@@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nis.web.dao.configuration.TaskInfoDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.configuration.TaskInfo">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
|
||||
<result column="task_org" jdbcType="VARCHAR" property="taskOrg" />
|
||||
<result column="task_time" jdbcType="DATE" property="taskTime" />
|
||||
<result column="task_desc" jdbcType="VARCHAR" property="taskDesc" />
|
||||
<result column="is_valid" jdbcType="INTEGER" property="isValid" />
|
||||
<result column="is_audit" jdbcType="INTEGER" property="isAudit" />
|
||||
<result column="creator_id" jdbcType="INTEGER" property="creatorId" />
|
||||
<result column="create_time" jdbcType="DATE" property="createTime" />
|
||||
<result column="editor_id" jdbcType="INTEGER" property="editorId" />
|
||||
<result column="edit_time" jdbcType="DATE" property="editTime" />
|
||||
<result column="auditor_id" jdbcType="INTEGER" property="auditorId" />
|
||||
<result column="audit_time" jdbcType="DATE" property="auditTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, task_name, task_org, task_time, task_desc, is_valid, is_audit, creator_id, create_time,
|
||||
editor_id, edit_time, auditor_id, audit_time
|
||||
</sql>
|
||||
|
||||
<select id="findList" parameterType="com.nis.domain.configuration.TaskInfo" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from task_info
|
||||
<if test="id!=null">
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from task_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
insert into task_info (id, task_name, task_org,
|
||||
task_time, task_desc, is_valid,
|
||||
is_audit, creator_id, create_time,
|
||||
editor_id, edit_time, auditor_id,
|
||||
audit_time)
|
||||
values (#{id,jdbcType=BIGINT}, #{taskName,jdbcType=VARCHAR}, #{taskOrg,jdbcType=VARCHAR},
|
||||
#{taskTime,jdbcType=DATE}, #{taskDesc,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=DATE},
|
||||
#{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=DATE}, #{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=DATE})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
insert into task_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taskName != null">
|
||||
task_name,
|
||||
</if>
|
||||
<if test="taskOrg != null">
|
||||
task_org,
|
||||
</if>
|
||||
<if test="taskTime != null">
|
||||
task_time,
|
||||
</if>
|
||||
<if test="taskDesc != null">
|
||||
task_desc,
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
is_valid,
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
is_audit,
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
editor_id,
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
edit_time,
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
auditor_id,
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
audit_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="taskName != null">
|
||||
#{taskName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskOrg != null">
|
||||
#{taskOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskTime != null">
|
||||
#{taskTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="taskDesc != null">
|
||||
#{taskDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
#{editTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
#{auditTime,jdbcType=DATE},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
update task_info
|
||||
<set>
|
||||
<if test="taskName != null">
|
||||
task_name = #{taskName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskOrg != null">
|
||||
task_org = #{taskOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taskTime != null">
|
||||
task_time = #{taskTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="taskDesc != null">
|
||||
task_desc = #{taskDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="editorId != null">
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null">
|
||||
edit_time = #{editTime,jdbcType=DATE},
|
||||
</if>
|
||||
<if test="auditorId != null">
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null">
|
||||
audit_time = #{auditTime,jdbcType=DATE},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.nis.domain.configuration.TaskInfo">
|
||||
update task_info
|
||||
set task_name = #{taskName,jdbcType=VARCHAR},
|
||||
task_org = #{taskOrg,jdbcType=VARCHAR},
|
||||
task_time = #{taskTime,jdbcType=DATE},
|
||||
task_desc = #{taskDesc,jdbcType=VARCHAR},
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=DATE},
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
edit_time = #{editTime,jdbcType=DATE},
|
||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
||||
audit_time = #{auditTime,jdbcType=DATE}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,265 +1,265 @@
|
||||
/**
|
||||
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
|
||||
*/
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
|
||||
/**
|
||||
* Service基类
|
||||
* @author ThinkGem
|
||||
* @version 2014-05-16
|
||||
*/
|
||||
public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>> extends BaseService {
|
||||
|
||||
/**
|
||||
* 持久层对象
|
||||
*/
|
||||
@Autowired
|
||||
protected D dao;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public T get(Long id) {
|
||||
return dao.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public T get(T entity) {
|
||||
return dao.get(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public List<T> findList(T entity) {
|
||||
return dao.findList(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<T> findPage(Page<T> page, T entity) {
|
||||
entity.setPage(page);
|
||||
page.setList(dao.findList(entity));
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param entity
|
||||
*/
|
||||
public void save(T entity) {
|
||||
if (entity.getIsNewRecord()){
|
||||
dao.insert(entity);
|
||||
}else{
|
||||
dao.update(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param entity
|
||||
*/
|
||||
public void delete(T entity) {
|
||||
dao.delete(entity);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* saveBatch(批量全部保存数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void saveBatch(List<T> data,@SuppressWarnings("rawtypes")Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).insert(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateBatch(批量更新全部数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void updateBatch(List<T> data,@SuppressWarnings("rawtypes") Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).update(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* deleteBatch(批量删除全部数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void deleteBatch(List<T> data,@SuppressWarnings("rawtypes") Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).delete(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* sendToMaatConvertor(转换配置为Maat格式)
|
||||
* (所有的配置需拥有一样的编译ID,action,serviceId,等属性)
|
||||
* @param cfg
|
||||
* @return
|
||||
*boolean
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public boolean sendToMaatConvertor(AreaIpCfg[] areaCfg,T ... cfg){
|
||||
if(cfg==null){
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
long compileId=0l;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
if(cfg[0] instanceof BaseIpCfg){
|
||||
maatCfg.setIpCfg((BaseIpCfg[])cfg);
|
||||
compileId=((BaseIpCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof BaseStringCfg){
|
||||
maatCfg.setStrCfg((BaseStringCfg[])cfg);
|
||||
compileId=((BaseStringCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof ComplexkeywordCfg){
|
||||
maatCfg.setComplexStrCfg((ComplexkeywordCfg[])cfg);
|
||||
compileId=((ComplexkeywordCfg)cfg[0]).getCompileId();
|
||||
}
|
||||
if(areaCfg!=null){
|
||||
AreaIpCfg[] cfgArray=new AreaIpCfg[1];
|
||||
|
||||
}
|
||||
List<MaatCfg> serviceCfg=new ArrayList<>();
|
||||
serviceCfg.add(maatCfg);
|
||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||
if(compileId==0l){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}else{
|
||||
toMaatBean.setCompileId(compileId);
|
||||
}
|
||||
if(baseCfg.getAction()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的action");
|
||||
}else{
|
||||
toMaatBean.setAction(baseCfg.getAction());
|
||||
}
|
||||
if(baseCfg.getIsAreaEffective()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
||||
}else{
|
||||
toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
||||
}
|
||||
if(baseCfg.getIsValid()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
||||
}else{
|
||||
toMaatBean.setIsValid(baseCfg.getIsValid());
|
||||
}
|
||||
if(baseCfg.getRequestId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
||||
}else{
|
||||
toMaatBean.setRequestId(baseCfg.getRequestId());
|
||||
}
|
||||
if(baseCfg.getServiceId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
||||
}else{
|
||||
toMaatBean.setServiceId(baseCfg.getServiceId());
|
||||
}
|
||||
toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
||||
toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||
toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||
toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
String json=gson.toJson(toMaatBean);
|
||||
//发送至maat,待完成
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
|
||||
*/
|
||||
package com.nis.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
|
||||
/**
|
||||
* Service基类
|
||||
* @author ThinkGem
|
||||
* @version 2014-05-16
|
||||
*/
|
||||
public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>> extends BaseService {
|
||||
|
||||
/**
|
||||
* 持久层对象
|
||||
*/
|
||||
@Autowired
|
||||
protected D dao;
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public T get(Long id) {
|
||||
return dao.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public T get(T entity) {
|
||||
return dao.get(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public List<T> findList(T entity) {
|
||||
return dao.findList(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<T> findPage(Page<T> page, T entity) {
|
||||
entity.setPage(page);
|
||||
page.setList(dao.findList(entity));
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param entity
|
||||
*/
|
||||
public void save(T entity) {
|
||||
if (entity.getIsNewRecord()){
|
||||
dao.insert(entity);
|
||||
}else{
|
||||
dao.update(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param entity
|
||||
*/
|
||||
public void delete(T entity) {
|
||||
dao.delete(entity);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* saveBatch(批量全部保存数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void saveBatch(List<T> data,@SuppressWarnings("rawtypes")Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).insert(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateBatch(批量更新全部数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void updateBatch(List<T> data,@SuppressWarnings("rawtypes") Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).update(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* deleteBatch(批量删除全部数据)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param data 数据集合
|
||||
* @param mClass 传入的dao.xml里的mapper
|
||||
* @author wx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void deleteBatch(List<T> data,@SuppressWarnings("rawtypes") Class mClass) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < data.size();index++){
|
||||
T t = data.get(index);
|
||||
((CrudDao<T>) batchSqlSession.getMapper(mClass)).delete(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
// }catch (Exception e){
|
||||
// batchSqlSession.rollback();
|
||||
// throw e;
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* sendToMaatConvertor(转换配置为Maat格式)
|
||||
* (所有的配置需拥有一样的编译ID,action,serviceId,等属性)
|
||||
* @param cfg
|
||||
* @return
|
||||
*boolean
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public boolean sendToMaatConvertor(AreaIpCfg[] areaCfg,T ... cfg){
|
||||
if(cfg==null){
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
long compileId=0l;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
if(cfg[0] instanceof BaseIpCfg){
|
||||
maatCfg.setIpCfg((BaseIpCfg[])cfg);
|
||||
compileId=((BaseIpCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof BaseStringCfg){
|
||||
maatCfg.setStrCfg((BaseStringCfg[])cfg);
|
||||
compileId=((BaseStringCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof ComplexkeywordCfg){
|
||||
maatCfg.setComplexStrCfg((ComplexkeywordCfg[])cfg);
|
||||
compileId=((ComplexkeywordCfg)cfg[0]).getCompileId();
|
||||
}
|
||||
if(areaCfg!=null){
|
||||
AreaIpCfg[] cfgArray=new AreaIpCfg[1];
|
||||
|
||||
}
|
||||
List<MaatCfg> serviceCfg=new ArrayList<>();
|
||||
serviceCfg.add(maatCfg);
|
||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||
if(compileId==0l){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}else{
|
||||
toMaatBean.setCompileId(compileId);
|
||||
}
|
||||
if(baseCfg.getAction()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的action");
|
||||
}else{
|
||||
toMaatBean.setAction(baseCfg.getAction());
|
||||
}
|
||||
if(baseCfg.getIsAreaEffective()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
||||
}else{
|
||||
toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
||||
}
|
||||
if(baseCfg.getIsValid()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
||||
}else{
|
||||
toMaatBean.setIsValid(baseCfg.getIsValid());
|
||||
}
|
||||
if(baseCfg.getRequestId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
||||
}else{
|
||||
toMaatBean.setRequestId(baseCfg.getRequestId());
|
||||
}
|
||||
if(baseCfg.getServiceId()==null){
|
||||
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
||||
}else{
|
||||
toMaatBean.setServiceId(baseCfg.getServiceId());
|
||||
}
|
||||
toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
||||
toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||
toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||
toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
String json=gson.toJson(toMaatBean);
|
||||
//发送至maat,待完成
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.nis.web.service.configuration;
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -10,10 +10,10 @@ import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.basics.ServiceDictInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@@ -172,6 +172,8 @@ public class ServiceDictInfoService extends BaseService{
|
||||
}
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(serviceDictInfo.getServiceDictId())) {//新增
|
||||
Integer maxCode = serviceDictInfoDao.findMaxItemCode();
|
||||
serviceDictInfo.setItemCode(maxCode==null?1:(maxCode+1));
|
||||
serviceDictInfo.setIsValid(1);
|
||||
serviceDictInfo.setServiceDictCreator(user);
|
||||
serviceDictInfo.setCreateTime(new Date());
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.nis.web.service.configuration;
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -9,11 +9,9 @@ import org.springframework.stereotype.Service;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.SysDictInfoDao;
|
||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@@ -105,6 +103,10 @@ public class SysDictInfoService extends BaseService{
|
||||
}
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(sysDictInfo.getSysDictId())) {//新增
|
||||
if(sysDictInfo.getItemCode()==null){
|
||||
Integer maxCode = sysDictInfoDao.findMaxItemCode();
|
||||
sysDictInfo.setItemCode(maxCode==null?1:(maxCode+1));
|
||||
}
|
||||
sysDictInfo.setIsValid(1);
|
||||
sysDictInfo.setSysDictCreator(user);
|
||||
sysDictInfo.setCreateTime(new Date());
|
||||
@@ -11,9 +11,11 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.TaskInfo;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.RequestInfoDao;
|
||||
import com.nis.web.dao.configuration.TaskInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@@ -23,6 +25,8 @@ public class RequestInfoService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private RequestInfoDao requestInfoDao;
|
||||
@Autowired
|
||||
private TaskInfoDao taskInfoDao;
|
||||
|
||||
public Page<RequestInfo> findRequestInfo(Page<RequestInfo> page, RequestInfo requestInfo) {
|
||||
// 设置分页参数
|
||||
@@ -81,4 +85,8 @@ public class RequestInfoService extends BaseService{
|
||||
RequestInfo requestInfo=new RequestInfo();
|
||||
return requestInfoDao.findAllList(requestInfo);
|
||||
}
|
||||
|
||||
public List<TaskInfo> showTask(TaskInfo taskInfo) {
|
||||
return taskInfoDao.findList(taskInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user