Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -25,7 +25,7 @@ public class ServiceDictInfoService extends BaseService{
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询业务字典分页(无条件查询)
|
||||
* 查询业务字典顶层分页
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
@@ -61,11 +61,67 @@ public class ServiceDictInfoService extends BaseService{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ServiceDictInfo sd = new ServiceDictInfo();
|
||||
sd.setServiceDictId(0);
|
||||
for(ServiceDictInfo se:parentList){
|
||||
se.setParent(sd);
|
||||
}
|
||||
if(tempType!=0){
|
||||
serviceDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
serviceDictInfo.setItemType(null);
|
||||
}
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有数据
|
||||
* @param serviceDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllServiceDictInfo(ServiceDictInfo serviceDictInfo,Integer[] itType,String orderBy){
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempIntegerList.get(0));
|
||||
list = serviceDictInfoDao.findAllServiceDictInfoN(serviceDictInfo,orderBy);
|
||||
}
|
||||
}
|
||||
if(tempType!=0){
|
||||
serviceDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
serviceDictInfo.setItemType(null);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
* @return
|
||||
@@ -91,178 +147,6 @@ public class ServiceDictInfoService extends BaseService{
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictTopSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo, Integer[] itType) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
//根据条件查询符合数据
|
||||
List<ServiceDictInfo> allList = Lists.newArrayList();
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempIntegerList.get(0));
|
||||
allList = serviceDictInfoDao.findDictTopSearchListN(serviceDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
ServiceDictInfo tempSe = new ServiceDictInfo();
|
||||
tempSe.setServiceDictId(0);
|
||||
for(ServiceDictInfo se:allList){
|
||||
se.setParent(tempSe);
|
||||
}
|
||||
page.setList(allList);
|
||||
|
||||
|
||||
/*//根据条件查询符合数据
|
||||
List<ServiceDictInfo> allList = Lists.newArrayList();
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> listChild = Lists.newArrayList();
|
||||
List<ServiceDictInfo> listParent = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
Integer total = 0;
|
||||
Integer pageCount = 0;
|
||||
Integer lostCount = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempIntegerList.get(0));
|
||||
allList = serviceDictInfoDao.findDictSearchListN(serviceDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//处理数据
|
||||
//page.list中有多少个不是page.list中的顶层(其上级在page.list)
|
||||
ServiceDictInfo tempSe = new ServiceDictInfo();
|
||||
tempSe.setServiceDictId(0);
|
||||
//取出主键优化处理
|
||||
for(ServiceDictInfo se:allList){
|
||||
if(se!=null&&se.getServiceDictId()!=null){
|
||||
tempList.add(se.getServiceDictId());
|
||||
}
|
||||
}
|
||||
|
||||
for(ServiceDictInfo se:allList){
|
||||
if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null){
|
||||
//ServiceDictInfo temp = serviceDictInfoDao.getDictById(se.getParent().getServiceDictId());
|
||||
if(tempList.contains(se.getParent().getServiceDictId())){
|
||||
listChild.add(se);
|
||||
lostCount+=lostCount;
|
||||
}else{
|
||||
se.setParent(tempSe);
|
||||
listParent.add(se);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//确定总页数
|
||||
total = allList.size() - lostCount;
|
||||
pageCount = total%page.getPageSize()==0?total%page.getPageSize():(total%page.getPageSize()+1);
|
||||
if(pageCount==0){
|
||||
pageCount=1;
|
||||
}
|
||||
//取出所有的顶层
|
||||
//获取分页 每页数量pageSize、、当前页数pageNo (排序,,,) 每页第一个(pageNo-1)*pageSize+1 最后一个pageNo*pageSize
|
||||
List<ServiceDictInfo> parentShow = Lists.newArrayList();
|
||||
for(int i=0;i<listParent.size();i++){
|
||||
if(i>=((page.getPageNo()-1)*page.getPageSize())&&i<page.getPageNo()*page.getPageSize()){
|
||||
parentShow.add(listParent.get(i));
|
||||
}
|
||||
}
|
||||
parentShow.addAll(listChild);
|
||||
|
||||
ServiceDictInfo.sortList(list,parentShow,0,true);
|
||||
|
||||
page.setList(list);*/
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 条件查询所有数据
|
||||
* @param serviceDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictSearchList(ServiceDictInfo serviceDictInfo,Integer[] itType){
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempIntegerList.get(0));
|
||||
list = serviceDictInfoDao.findAllDictSearchListN(serviceDictInfo);
|
||||
}
|
||||
}
|
||||
if(tempType!=0){
|
||||
serviceDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
serviceDictInfo.setItemType(null);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param serviceDictId
|
||||
|
||||
@@ -24,126 +24,32 @@ public class SysDictInfoService extends BaseService{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询顶层分页(无条件查询)
|
||||
* 查询顶层分页(含条件查询,考虑排序接入可行性)
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public Page<SysDictInfo> findTopDictList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
|
||||
// 设置分页参数
|
||||
sysDictInfo.setPage(page);
|
||||
List<SysDictInfo> parentList = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
//预留以后分开用
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}
|
||||
//查出顶层分页查询
|
||||
if(itType.length==1){
|
||||
sysDictInfo.setItemType(itType[0]);
|
||||
parentList = sysDictInfoDao.findTopDictList(sysDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
parentList = sysDictInfoDao.findTopDictList(sysDictInfo);
|
||||
}else{
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
tempList.add(1);tempList.add(2);tempList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempList.contains(itType[0])){
|
||||
tempList.remove(itType[0]);
|
||||
}
|
||||
if(tempList.contains(itType[1])){
|
||||
tempList.remove(itType[1]);
|
||||
}
|
||||
sysDictInfo.setItemType(tempList.get(0));
|
||||
parentList = sysDictInfoDao.findTopDictListN(sysDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
*/
|
||||
public List<SysDictInfo> findAllDictList() {
|
||||
return sysDictInfoDao.findAllDictList(new SysDictInfo());
|
||||
|
||||
}
|
||||
/**
|
||||
* 条件查询所有数据
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findAllDictSearchList(SysDictInfo sysDictInfo, Integer[] itType) {
|
||||
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
sysDictInfo.setItemType(itType[0]);
|
||||
list = sysDictInfoDao.findAllDictSearchList(sysDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
list = sysDictInfoDao.findAllDictSearchList(sysDictInfo);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
sysDictInfo.setItemType(tempIntegerList.get(0));
|
||||
list = sysDictInfoDao.findAllDictSearchListN(sysDictInfo);
|
||||
}
|
||||
}
|
||||
if(tempType!=0){
|
||||
sysDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
sysDictInfo.setItemType(null);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public Page<SysDictInfo> findDictTopSearchList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
|
||||
// 设置分页参数
|
||||
sysDictInfo.setPage(page);
|
||||
//根据条件查询符合数据
|
||||
List<SysDictInfo> allList = Lists.newArrayList();
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
sysDictInfo.setItemType(itType[0]);
|
||||
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
|
||||
allList = sysDictInfoDao.findTopDictList(sysDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
|
||||
allList = sysDictInfoDao.findTopDictList(sysDictInfo);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
@@ -151,11 +57,16 @@ public class SysDictInfoService extends BaseService{
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
sysDictInfo.setItemType(tempIntegerList.get(0));
|
||||
allList = sysDictInfoDao.findDictTopSearchListN(sysDictInfo);
|
||||
allList = sysDictInfoDao.findTopDictListN(sysDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
|
||||
//allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
|
||||
if(tempType!=0){
|
||||
sysDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
sysDictInfo.setItemType(null);
|
||||
}
|
||||
SysDictInfo tempSe = new SysDictInfo();
|
||||
tempSe.setSysDictId(0);
|
||||
for(SysDictInfo se:allList){
|
||||
@@ -166,6 +77,60 @@ public class SysDictInfoService extends BaseService{
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findAllSysDictInfo(SysDictInfo sysDictInfo, Integer[] itType,String orderBy) {
|
||||
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}
|
||||
if(itType.length==1){
|
||||
sysDictInfo.setItemType(itType[0]);
|
||||
list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy);
|
||||
}else{
|
||||
List<Integer> tempIntegerList = Lists.newArrayList();
|
||||
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
|
||||
if(tempIntegerList.contains(itType[0])){
|
||||
tempIntegerList.remove(itType[0]);
|
||||
}
|
||||
if(tempIntegerList.contains(itType[1])){
|
||||
tempIntegerList.remove(itType[1]);
|
||||
}
|
||||
sysDictInfo.setItemType(tempIntegerList.get(0));
|
||||
list = sysDictInfoDao.findAllSysDictInfoN(sysDictInfo,orderBy);
|
||||
}
|
||||
}
|
||||
if(tempType!=0){
|
||||
sysDictInfo.setItemType(tempType);
|
||||
}else{
|
||||
sysDictInfo.setItemType(null);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
*/
|
||||
public List<SysDictInfo> findAllDictList() {
|
||||
return sysDictInfoDao.findAllDictList(new SysDictInfo());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询生效范围字典详细信息
|
||||
|
||||
@@ -36,12 +36,13 @@ public class TaskInfoService extends BaseService{
|
||||
public void saveOrUpdate(TaskInfo taskInfo) {
|
||||
if (StringUtil.isEmpty(taskInfo.getId())) {
|
||||
//设置默认参数值
|
||||
taskInfo.setIsValid(1);//有效
|
||||
taskInfo.setIsValid(0);//无效
|
||||
taskInfo.setIsAudit(0);//未审核
|
||||
taskInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员
|
||||
taskInfo.setCreateTime(new Date());//创建时间
|
||||
taskInfoDao.insert(taskInfo);
|
||||
}else{
|
||||
taskInfo.setIsAudit(0);//修改后状态为未审核
|
||||
taskInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员
|
||||
taskInfo.setEditTime(new Date());//修改时间
|
||||
taskInfoDao.update(taskInfo);
|
||||
@@ -63,6 +64,7 @@ public class TaskInfoService extends BaseService{
|
||||
for (int i = 0; i < exId.length; i++) {
|
||||
taskInfo.setId(Long.valueOf(exId[i]));
|
||||
taskInfo.setIsAudit(1);//审核通过
|
||||
taskInfo.setIsValid(1);//审核通过
|
||||
taskInfo.setAuditTime(new Date());
|
||||
taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
taskInfoDao.update(taskInfo);
|
||||
@@ -85,6 +87,7 @@ public class TaskInfoService extends BaseService{
|
||||
for (int i = 0; i < cancelId.length; i++) {
|
||||
taskInfo.setId(Long.valueOf(cancelId[i]));
|
||||
taskInfo.setIsAudit(3);//取消审核通过
|
||||
taskInfo.setIsValid(0);
|
||||
taskInfo.setAuditTime(new Date());
|
||||
taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
taskInfoDao.update(taskInfo);
|
||||
|
||||
@@ -40,12 +40,13 @@ public class RequestInfoService extends BaseService{
|
||||
public void saveOrUpdate(RequestInfo requestInfo) {
|
||||
if (StringUtil.isEmpty(requestInfo.getId())) {
|
||||
//设置默认参数值
|
||||
requestInfo.setIsValid(1);//有效
|
||||
requestInfo.setIsValid(0);//无效
|
||||
requestInfo.setIsAudit(0);//未审核
|
||||
requestInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员
|
||||
requestInfo.setCreateTime(new Date());//创建时间
|
||||
requestInfoDao.insert(requestInfo);
|
||||
}else{
|
||||
requestInfo.setIsAudit(0);//修改后状态为未审核
|
||||
requestInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员
|
||||
requestInfo.setEditTime(new Date());//修改时间
|
||||
requestInfoDao.update(requestInfo);
|
||||
@@ -67,6 +68,7 @@ public class RequestInfoService extends BaseService{
|
||||
for (int i = 0; i < exId.length; i++) {
|
||||
requestInfo.setId(Long.valueOf(exId[i]));
|
||||
requestInfo.setIsAudit(1);//审核通过
|
||||
requestInfo.setIsValid(1);//审核通过有效
|
||||
requestInfo.setAuditTime(new Date());
|
||||
requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
requestInfoDao.update(requestInfo);
|
||||
@@ -89,6 +91,7 @@ public class RequestInfoService extends BaseService{
|
||||
for (int i = 0; i < cancelId.length; i++) {
|
||||
requestInfo.setId(Long.valueOf(cancelId[i]));
|
||||
requestInfo.setIsAudit(3);//取消审核通过
|
||||
requestInfo.setIsValid(0);//取消审核通过无效
|
||||
requestInfo.setAuditTime(new Date());
|
||||
requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员
|
||||
requestInfoDao.update(requestInfo);
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.nis.web.service.specific;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class SpecificServiceCfgService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private SpecificServiceCfgDao specificServiceCfgDao;
|
||||
|
||||
/**
|
||||
* 根据id查询对象
|
||||
* @param specServiceId
|
||||
* @return
|
||||
*/
|
||||
public SpecificServiceCfg getBySpecServiceId(Integer specServiceId) {
|
||||
return specificServiceCfgDao.getBySpecServiceId(specServiceId);
|
||||
}
|
||||
/**
|
||||
* 查询所有符合条件的顶层分页
|
||||
* @param page
|
||||
* @param specificServiceCfg
|
||||
* @return
|
||||
*/
|
||||
public Page<SpecificServiceCfg> findTopPage(Page<SpecificServiceCfg> page, SpecificServiceCfg specificServiceCfg){
|
||||
// 设置分页参数
|
||||
specificServiceCfg.setPage(page);
|
||||
// 执行分页查询
|
||||
List<SpecificServiceCfg> list = Lists.newArrayList();
|
||||
list = specificServiceCfgDao.findTopPage(specificServiceCfg);
|
||||
SpecificServiceCfg ss = new SpecificServiceCfg();
|
||||
ss.setSpecServiceId(0);
|
||||
for(SpecificServiceCfg ssc:list){
|
||||
ssc.setParent(ss);
|
||||
}
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有符合条件的数据
|
||||
* @param specificServiceCfg
|
||||
* @return
|
||||
*/
|
||||
public List<SpecificServiceCfg> findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg, String orderBy) {
|
||||
return specificServiceCfgDao.findAllSpecificServiceCfg(specificServiceCfg,orderBy);
|
||||
}
|
||||
/**
|
||||
* 保存或修改
|
||||
* @param specificServiceCfg
|
||||
*/
|
||||
public void saveOrUpdate(SpecificServiceCfg specificServiceCfg, Integer oldId) {
|
||||
if(specificServiceCfg.getGroupId()==null){
|
||||
specificServiceCfg.setGroupId(0);
|
||||
}
|
||||
if(oldId==null){//新增
|
||||
specificServiceCfg.setIsValid(1);
|
||||
specificServiceCfg.setOpTime(new Date());
|
||||
specificServiceCfgDao.insert(specificServiceCfg);
|
||||
}else{//修改
|
||||
specificServiceCfg.setOpTime(new Date());
|
||||
//修改id则将其子类的parent_id一并修改
|
||||
if(oldId!=specificServiceCfg.getSpecServiceId()){
|
||||
//找出所有子类
|
||||
List<SpecificServiceCfg> list = specificServiceCfgDao.getChildrenById(oldId);
|
||||
SpecificServiceCfg se =new SpecificServiceCfg();
|
||||
se.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
||||
for(SpecificServiceCfg ss:list){
|
||||
if(ss!=null){
|
||||
ss.setParent(se);
|
||||
specificServiceCfgDao.update(ss,ss.getSpecServiceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
specificServiceCfgDao.update(specificServiceCfg,oldId);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param specificServiceCfg
|
||||
*/
|
||||
public void delete(String mulitId) {
|
||||
String[] ids = mulitId.split(",");
|
||||
for(String id:ids){
|
||||
if (!id.equals("")) {
|
||||
SpecificServiceCfg specificServiceCfg = specificServiceCfgDao.getBySpecServiceId(Integer.valueOf(id));
|
||||
List<SpecificServiceCfg> list = Lists.newArrayList();
|
||||
//找出所有下级
|
||||
if(specificServiceCfg!=null){
|
||||
SpecificServiceCfg.sortList(list, specificServiceCfgDao.findAllSpecificServiceCfg(new SpecificServiceCfg(),""), specificServiceCfg.getSpecServiceId(), true);
|
||||
list.add(specificServiceCfg);
|
||||
for(SpecificServiceCfg ss:list){
|
||||
ss.setIsValid(0);
|
||||
specificServiceCfgDao.delete(ss);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据specServiceId查询所有下级
|
||||
* @param specServiceId
|
||||
* @return
|
||||
*/
|
||||
public List<SpecificServiceCfg> getChildrenById(Integer specServiceId) {
|
||||
return specificServiceCfgDao.getChildrenById(specServiceId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.nis.web.service.specific;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.specific.SpecificServiceHostCfg;
|
||||
import com.nis.web.dao.specific.SpecificServiceHostCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class SpecificServiceHostCfgService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private SpecificServiceHostCfgDao specificServiceHostCfgDao;
|
||||
|
||||
/**
|
||||
* 根据主键查询数据对象
|
||||
* @param hostId
|
||||
* @return
|
||||
*/
|
||||
public SpecificServiceHostCfg getDictByHostId(Integer hostId) {
|
||||
return specificServiceHostCfgDao.getByHostId(hostId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查出分页
|
||||
* @param page
|
||||
* @param specificServiceHostCfg
|
||||
* @return
|
||||
*/
|
||||
public Page<SpecificServiceHostCfg> findSpecHostList(Page<SpecificServiceHostCfg> page,
|
||||
SpecificServiceHostCfg specificServiceHostCfg) {
|
||||
specificServiceHostCfg.setPage(page);
|
||||
page.setList(specificServiceHostCfgDao.findSpecHostList(specificServiceHostCfg));
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param specificServiceHostCfg
|
||||
*/
|
||||
public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) {
|
||||
SysUser user = UserUtils.getUser();
|
||||
Date date = new Date();
|
||||
if(specificServiceHostCfg.getHostId()==null){//新增
|
||||
specificServiceHostCfg.setIsValid(1);
|
||||
specificServiceHostCfg.setCreator(user);
|
||||
specificServiceHostCfg.setCreateTime(date);
|
||||
specificServiceHostCfg.setEditor(user);
|
||||
specificServiceHostCfg.setEditTime(date);
|
||||
specificServiceHostCfg.setAuditor(user);
|
||||
specificServiceHostCfg.setAuditTime(date);
|
||||
specificServiceHostCfgDao.insert(specificServiceHostCfg);
|
||||
}else{//修改
|
||||
//是否进行了审核操作
|
||||
//SpecificServiceHostCfg ssh = specificServiceHostCfgDao.getByHostId(specificServiceHostCfg.getHostId());
|
||||
/*if(ssh.getIsAudit()!=specificServiceHostCfg.getIsAudit()){
|
||||
specificServiceHostCfg.setAuditor(user);
|
||||
specificServiceHostCfg.setAuditTime(date);
|
||||
}*/
|
||||
specificServiceHostCfg.setEditor(user);
|
||||
specificServiceHostCfg.setEditTime(date);
|
||||
specificServiceHostCfg.setAuditor(user);
|
||||
specificServiceHostCfg.setAuditTime(date);
|
||||
specificServiceHostCfgDao.update(specificServiceHostCfg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查出所有
|
||||
* @return
|
||||
*/
|
||||
public List<SpecificServiceHostCfg> getAll() {
|
||||
|
||||
return specificServiceHostCfgDao.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param mulitId
|
||||
*/
|
||||
public void delete(String mulitId) {
|
||||
String[] ids = mulitId.split(",");
|
||||
for(String hostId:ids){
|
||||
if (!StringUtils.isEmpty(hostId)) {
|
||||
specificServiceHostCfgDao.delete(Integer.valueOf(hostId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据协议ID查询对象
|
||||
* @param specServiceId
|
||||
* @return
|
||||
*/
|
||||
public SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId) {
|
||||
|
||||
return specificServiceHostCfgDao.getBySpecServiceId(specServiceId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user