Commit 8e9187b2 authored by 赵啸非's avatar 赵啸非

修改controller实现方式

parent 64dcf832
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.area.service;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import java.util.List;
import com.mortals.framework.exception.AppException;
......
package com.mortals.xhx.module.area.web;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.area.service.AreaService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 区域
......@@ -33,7 +29,7 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("area")
public class AreaController extends BaseCRUDJsonPhpController<AreaService,AreaForm,AreaEntity,Long> {
public class AreaController extends BasePhpCRUDJsonMappingController<AreaService,AreaForm,AreaEntity,Long> {
@Autowired
private ParamService paramService;
......@@ -44,14 +40,14 @@ public class AreaController extends BaseCRUDJsonPhpController<AreaService,AreaFo
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, AreaForm form, Map<String, Object> model, Context context) {
protected void init( Map<String, Object> model, Context context) {
this.addDict(model, "haveSonArea", paramService.getParamBySecondOrganize("Area","haveSonArea"));
this.addDict(model, "haveSonDept", paramService.getParamBySecondOrganize("Area","haveSonDept"));
this.addDict(model, "haveGetDept", paramService.getParamBySecondOrganize("Area","haveGetDept"));
this.addDict(model, "haveGetMatterList", paramService.getParamBySecondOrganize("Area","haveGetMatterList"));
this.addDict(model, "areaLevel", paramService.getParamBySecondOrganize("Area","areaLevel"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Area","status"));
super.init(request, response, form, model, context);
super.init( model, context);
}
@PostMapping("list/exclude")
......@@ -127,124 +123,5 @@ public class AreaController extends BaseCRUDJsonPhpController<AreaService,AreaFo
return ret.toJSONString();
}
/**
* 查询区域
*/
@PostMapping(value = "list")
public String list(@RequestBody AreaQuery query) {
try {
AreaForm form = new AreaForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询区域列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 区域模块
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
AreaForm form = new AreaForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("区域模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存区域
*/
@PostMapping(value = "save")
public String save(@RequestBody AreaEntity entity) {
try {
AreaForm form = new AreaForm();
form.setArea(entity);
return super.save(form);
} catch (Exception e) {
log.error("区域模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除区域
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
AreaForm form = new AreaForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除区域错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看区域
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
AreaForm form = new AreaForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看区域错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 模块导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("区域导入模板下载错误", e);
}
}
/**
* 模块导入
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("区域导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.business.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,7 +38,7 @@ import static com.mortals.framework.ap.SysConstains.RESULT_KEY;
*/
@RestController
@RequestMapping("business")
public class BusinessController extends BaseCRUDJsonPhpController<BusinessService,BusinessForm,BusinessEntity,Long> {
public class BusinessController extends BasePhpCRUDJsonMappingController<BusinessService,BusinessForm,BusinessEntity,Long> {
@Autowired
private ParamService paramService;
......@@ -48,37 +49,21 @@ public class BusinessController extends BaseCRUDJsonPhpController<BusinessServic
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, BusinessForm form, Map<String, Object> model, Context context) {
protected void init( Map<String, Object> model, Context context) {
this.addDict(model, "isBusiness", paramService.getParamBySecondOrganize("Business","isBusiness"));
this.addDict(model, "canorder", paramService.getParamBySecondOrganize("Business","canorder"));
this.addDict(model, "cantake", paramService.getParamBySecondOrganize("Business","cantake"));
this.addDict(model, "datashow", paramService.getParamBySecondOrganize("Business","datashow"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Business","status"));
this.addDict(model, "businessType", paramService.getParamBySecondOrganize("Business","businessType"));
super.init(request, response, form, model, context);
super.init(model, context);
}
/**
* 查询站点业务
*/
@PostMapping(value = "list")
public String list(@RequestBody BusinessQuery query) {
try {
BusinessForm form = new BusinessForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点业务列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
@Override
protected int doListAfter(HttpServletRequest request, HttpServletResponse response, BusinessForm form, Map<String, Object> model, Context context) throws AppException {
protected int doListAfter( BusinessEntity query, Map<String, Object> model, Context context) throws AppException {
List<BusinessEntity> businessEntities = (List<BusinessEntity>) model.get(RESULT_KEY);
if(!ObjectUtils.isEmpty(businessEntities)){
businessEntities.stream().peek(item->{
......@@ -91,7 +76,7 @@ public class BusinessController extends BaseCRUDJsonPhpController<BusinessServic
}).count();
model.put(RESULT_KEY,businessEntities);
}
return super.doListAfter(request, response, form, model, context);
return super.doListAfter(query, model, context);
}
/**
......@@ -116,138 +101,7 @@ public class BusinessController extends BaseCRUDJsonPhpController<BusinessServic
return jsonObject.toJSONString();
}
/**
* 新增站点业务
*/
@PostMapping(value = "add")
public String add() {
try {
BusinessForm form = new BusinessForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑站点业务
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
BusinessForm form = new BusinessForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点业务
*/
@PostMapping(value = "save")
public String save(@RequestBody BusinessEntity entity) {
try {
BusinessForm form = new BusinessForm();
form.setBusiness(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点业务
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
BusinessForm form = new BusinessForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点业务
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
BusinessForm form = new BusinessForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点业务导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点业务导入模板下载错误", e);
}
}
/**
* 站点业务导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点业务导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点业务导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody BusinessQuery query) {
try {
BusinessForm form = new BusinessForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点业务导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.business.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PostMapping;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.module.business.model.BusinessMatterEntity;
import com.mortals.xhx.module.business.model.BusinessMatterQuery;
import com.mortals.xhx.module.business.service.BusinessMatterService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
/**
*
* 业务事项关联
*
* @author zxfei
* @date 2022-01-12
*/
* 业务事项关联
*
* @author zxfei
* @date 2022-01-12
*/
@RestController
@RequestMapping("business/matter")
public class BusinessMatterController extends BaseCRUDJsonMappingController<BusinessMatterService,BusinessMatterForm,BusinessMatterEntity,Long> {
public class BusinessMatterController extends BasePhpCRUDJsonMappingController<BusinessMatterService, BusinessMatterForm, BusinessMatterEntity, Long> {
@Autowired
private ParamService paramService;
public BusinessMatterController(){
public BusinessMatterController() {
super.setFormClass(BusinessMatterForm.class);
super.setModuleDesc( "业务事项关联");
super.setModuleDesc("业务事项关联");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, BusinessMatterForm form, Map<String, Object> model, Context context) {
super.init(request, response, form, model, context);
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.dept.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 部门
*
* @author zxfei
......@@ -32,177 +40,26 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("dept")
public class DeptController extends BaseCRUDJsonPhpController<DeptService,DeptForm,DeptEntity,Long> {
public class DeptController extends BasePhpCRUDJsonMappingController<DeptService, DeptForm, DeptEntity, Long> {
@Autowired
private ParamService paramService;
public DeptController(){
public DeptController() {
super.setFormClass(DeptForm.class);
super.setModuleDesc( "部门");
super.setModuleDesc("部门");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, DeptForm form, Map<String, Object> model, Context context) {
this.addDict(model, "isAutotable", paramService.getParamBySecondOrganize("Dept","isAutotable"));
this.addDict(model, "isOrder", paramService.getParamBySecondOrganize("Dept","isOrder"));
this.addDict(model, "isBkb", paramService.getParamBySecondOrganize("Dept","isBkb"));
this.addDict(model, "isWorkGuide", paramService.getParamBySecondOrganize("Dept","isWorkGuide"));
this.addDict(model, "usValid", paramService.getParamBySecondOrganize("Dept","usValid"));
this.addDict(model, "isSecphone", paramService.getParamBySecondOrganize("Dept","isSecphone"));
this.addDict(model, "isEnglish", paramService.getParamBySecondOrganize("Dept","isEnglish"));
super.init(request, response, form, model, context);
}
/**
* 查询部门
*/
@PostMapping(value = "list")
public String list(@RequestBody DeptQuery query) {
try {
DeptForm form = new DeptForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询部门列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "isAutotable", paramService.getParamBySecondOrganize("Dept", "isAutotable"));
this.addDict(model, "isOrder", paramService.getParamBySecondOrganize("Dept", "isOrder"));
this.addDict(model, "isBkb", paramService.getParamBySecondOrganize("Dept", "isBkb"));
this.addDict(model, "isWorkGuide", paramService.getParamBySecondOrganize("Dept", "isWorkGuide"));
this.addDict(model, "usValid", paramService.getParamBySecondOrganize("Dept", "usValid"));
this.addDict(model, "isSecphone", paramService.getParamBySecondOrganize("Dept", "isSecphone"));
this.addDict(model, "isEnglish", paramService.getParamBySecondOrganize("Dept", "isEnglish"));
super.init(model, context);
}
/**
* 新增部门
*/
@PostMapping(value = "add")
public String add() {
try {
DeptForm form = new DeptForm();
return super.add(form);
} catch (Exception e) {
log.error("新增部门错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑部门
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
DeptForm form = new DeptForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("部门模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存部门
*/
@PostMapping(value = "save")
public String save(@RequestBody DeptEntity entity) {
try {
DeptForm form = new DeptForm();
form.setDept(entity);
return super.save(form);
} catch (Exception e) {
log.error("部门模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除部门
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
DeptForm form = new DeptForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除部门错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看部门
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
DeptForm form = new DeptForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看部门错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 部门导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("部门导入模板下载错误", e);
}
}
/**
* 部门导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("部门导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 部门导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody DeptQuery query) {
try {
DeptForm form = new DeptForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("部门导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.holiday.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.holiday.model.HolidayEntity;
import com.mortals.xhx.module.holiday.model.HolidayQuery;
import com.mortals.xhx.module.holiday.service.HolidayService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 节假日
*
* @author zxfei
......@@ -32,171 +40,20 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("holiday")
public class HolidayController extends BaseCRUDJsonPhpController<HolidayService,HolidayForm,HolidayEntity,Long> {
public class HolidayController extends BasePhpCRUDJsonMappingController<HolidayService, HolidayForm, HolidayEntity, Long> {
@Autowired
private ParamService paramService;
public HolidayController(){
public HolidayController() {
super.setFormClass(HolidayForm.class);
super.setModuleDesc( "节假日");
super.setModuleDesc("节假日");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, HolidayForm form, Map<String, Object> model, Context context) {
this.addDict(model, "workorholiday", paramService.getParamBySecondOrganize("Holiday","workorholiday"));
super.init(request, response, form, model, context);
}
/**
* 查询节假日
*/
@PostMapping(value = "list")
public String list(@RequestBody HolidayQuery query) {
try {
HolidayForm form = new HolidayForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询节假日列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "workorholiday", paramService.getParamBySecondOrganize("Holiday", "workorholiday"));
super.init(model, context);
}
/**
* 新增节假日
*/
@PostMapping(value = "add")
public String add() {
try {
HolidayForm form = new HolidayForm();
return super.add(form);
} catch (Exception e) {
log.error("新增节假日错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑节假日
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
HolidayForm form = new HolidayForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("节假日模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存节假日
*/
@PostMapping(value = "save")
public String save(@RequestBody HolidayEntity entity) {
try {
HolidayForm form = new HolidayForm();
form.setHoliday(entity);
return super.save(form);
} catch (Exception e) {
log.error("节假日模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除节假日
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
HolidayForm form = new HolidayForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除节假日错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看节假日
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
HolidayForm form = new HolidayForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看节假日错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 节假日导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("节假日导入模板下载错误", e);
}
}
/**
* 节假日导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("节假日导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 节假日导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody HolidayQuery query) {
try {
HolidayForm form = new HolidayForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("节假日导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterAcceptEntity;
import com.mortals.xhx.module.matter.model.MatterAcceptQuery;
import com.mortals.xhx.module.matter.service.MatterAcceptService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项受理条件
*
* @author zxfei
......@@ -32,171 +40,20 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/accept")
public class MatterAcceptController extends BaseCRUDJsonPhpController<MatterAcceptService,MatterAcceptForm,MatterAcceptEntity,Long> {
public class MatterAcceptController extends BasePhpCRUDJsonMappingController<MatterAcceptService, MatterAcceptForm, MatterAcceptEntity, Long> {
@Autowired
private ParamService paramService;
public MatterAcceptController(){
public MatterAcceptController() {
super.setFormClass(MatterAcceptForm.class);
super.setModuleDesc( "事项受理条件");
super.setModuleDesc("事项受理条件");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterAcceptForm form, Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterAccept","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项受理条件
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterAcceptQuery query) {
try {
MatterAcceptForm form = new MatterAcceptForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项受理条件列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterAccept", "source"));
super.init(model, context);
}
/**
* 新增事项受理条件
*/
@PostMapping(value = "add")
public String add() {
try {
MatterAcceptForm form = new MatterAcceptForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项受理条件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑事项受理条件
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterAcceptForm form = new MatterAcceptForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项受理条件模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项受理条件
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterAcceptEntity entity) {
try {
MatterAcceptForm form = new MatterAcceptForm();
form.setMatterAccept(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项受理条件模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项受理条件
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterAcceptForm form = new MatterAcceptForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项受理条件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项受理条件
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterAcceptForm form = new MatterAcceptForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项受理条件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项受理条件导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项受理条件导入模板下载错误", e);
}
}
/**
* 事项受理条件导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项受理条件导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项受理条件导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterAcceptQuery query) {
try {
MatterAcceptForm form = new MatterAcceptForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项受理条件导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterChargesEntity;
import com.mortals.xhx.module.matter.model.MatterChargesQuery;
import com.mortals.xhx.module.matter.service.MatterChargesService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项收费标准
*
* @author zxfei
......@@ -32,171 +40,20 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/charges")
public class MatterChargesController extends BaseCRUDJsonPhpController<MatterChargesService,MatterChargesForm,MatterChargesEntity,Long> {
public class MatterChargesController extends BasePhpCRUDJsonMappingController<MatterChargesService, MatterChargesForm, MatterChargesEntity, Long> {
@Autowired
private ParamService paramService;
public MatterChargesController(){
public MatterChargesController() {
super.setFormClass(MatterChargesForm.class);
super.setModuleDesc( "事项收费标准");
super.setModuleDesc("事项收费标准");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterChargesForm form, Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterCharges","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项收费标准
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterChargesQuery query) {
try {
MatterChargesForm form = new MatterChargesForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项收费标准列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterCharges", "source"));
super.init(model, context);
}
/**
* 新增事项收费标准
*/
@PostMapping(value = "add")
public String add() {
try {
MatterChargesForm form = new MatterChargesForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项收费标准错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑事项收费标准
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterChargesForm form = new MatterChargesForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项收费标准模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项收费标准
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterChargesEntity entity) {
try {
MatterChargesForm form = new MatterChargesForm();
form.setMatterCharges(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项收费标准模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项收费标准
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterChargesForm form = new MatterChargesForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项收费标准错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项收费标准
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterChargesForm form = new MatterChargesForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项收费标准错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项收费标准导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项收费标准导入模板下载错误", e);
}
}
/**
* 事项收费标准导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项收费标准导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项收费标准导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterChargesQuery query) {
try {
MatterChargesForm form = new MatterChargesForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项收费标准导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -32,7 +33,7 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/datum/file")
public class MatterDatumFileController extends BaseCRUDJsonPhpController<MatterDatumFileService,MatterDatumFileForm,MatterDatumFileEntity,Long> {
public class MatterDatumFileController extends BasePhpCRUDJsonMappingController<MatterDatumFileService,MatterDatumFileForm,MatterDatumFileEntity,Long> {
@Autowired
private ParamService paramService;
......@@ -43,161 +44,10 @@ public class MatterDatumFileController extends BaseCRUDJsonPhpController<MatterD
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterDatumFileForm form, Map<String, Object> model, Context context) {
protected void init( Map<String, Object> model, Context context) {
this.addDict(model, "filetype", paramService.getParamBySecondOrganize("MatterDatumFile","filetype"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterDatumFile","source"));
super.init(request, response, form, model, context);
super.init( model, context);
}
/**
* 查询材料附件
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterDatumFileQuery query) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询材料附件列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增材料附件
*/
@PostMapping(value = "add")
public String add() {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
return super.add(form);
} catch (Exception e) {
log.error("新增材料附件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑材料附件
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("材料附件模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存材料附件
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterDatumFileEntity entity) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
form.setMatterDatumFile(entity);
return super.save(form);
} catch (Exception e) {
log.error("材料附件模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除材料附件
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除材料附件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看材料附件
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看材料附件错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 材料附件导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("材料附件导入模板下载错误", e);
}
}
/**
* 材料附件导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("材料附件导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 材料附件导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterDatumFileQuery query) {
try {
MatterDatumFileForm form = new MatterDatumFileForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("材料附件导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterFlowlimitEntity;
import com.mortals.xhx.module.matter.model.MatterFlowlimitQuery;
import com.mortals.xhx.module.matter.service.MatterFlowlimitService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项办理流程
*
* @author zxfei
......@@ -32,171 +40,21 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/flowlimit")
public class MatterFlowlimitController extends BaseCRUDJsonPhpController<MatterFlowlimitService,MatterFlowlimitForm,MatterFlowlimitEntity,Long> {
public class MatterFlowlimitController extends BasePhpCRUDJsonMappingController<MatterFlowlimitService, MatterFlowlimitForm, MatterFlowlimitEntity, Long> {
@Autowired
private ParamService paramService;
public MatterFlowlimitController(){
public MatterFlowlimitController() {
super.setFormClass(MatterFlowlimitForm.class);
super.setModuleDesc( "事项办理流程");
super.setModuleDesc("事项办理流程");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterFlowlimitForm form, Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterFlowlimit","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项办理流程
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterFlowlimitQuery query) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项办理流程列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增事项办理流程
*/
@PostMapping(value = "add")
public String add() {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项办理流程错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterFlowlimit", "source"));
super.init(model, context);
}
/**
* 编辑事项办理流程
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项办理流程模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项办理流程
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterFlowlimitEntity entity) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
form.setMatterFlowlimit(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项办理流程模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项办理流程
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项办理流程错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项办理流程
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项办理流程错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项办理流程导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项办理流程导入模板下载错误", e);
}
}
/**
* 事项办理流程导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项办理流程导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项办理流程导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterFlowlimitQuery query) {
try {
MatterFlowlimitForm form = new MatterFlowlimitForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项办理流程导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterIntermediaryEntity;
import com.mortals.xhx.module.matter.model.MatterIntermediaryQuery;
import com.mortals.xhx.module.matter.service.MatterIntermediaryService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项中介服务
*
* @author zxfei
......@@ -32,171 +40,20 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/intermediary")
public class MatterIntermediaryController extends BaseCRUDJsonPhpController<MatterIntermediaryService,MatterIntermediaryForm,MatterIntermediaryEntity,Long> {
public class MatterIntermediaryController extends BasePhpCRUDJsonMappingController<MatterIntermediaryService, MatterIntermediaryForm, MatterIntermediaryEntity, Long> {
@Autowired
private ParamService paramService;
public MatterIntermediaryController(){
public MatterIntermediaryController() {
super.setFormClass(MatterIntermediaryForm.class);
super.setModuleDesc( "事项中介服务");
super.setModuleDesc("事项中介服务");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterIntermediaryForm form, Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterIntermediary","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项中介服务
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterIntermediaryQuery query) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项中介服务列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterIntermediary", "source"));
super.init(model, context);
}
/**
* 新增事项中介服务
*/
@PostMapping(value = "add")
public String add() {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项中介服务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑事项中介服务
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项中介服务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项中介服务
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterIntermediaryEntity entity) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
form.setMatterIntermediary(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项中介服务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项中介服务
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项中介服务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项中介服务
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项中介服务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项中介服务导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项中介服务导入模板下载错误", e);
}
}
/**
* 事项中介服务导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项中介服务导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项中介服务导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterIntermediaryQuery query) {
try {
MatterIntermediaryForm form = new MatterIntermediaryForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项中介服务导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterQuestionEntity;
import com.mortals.xhx.module.matter.model.MatterQuestionQuery;
import com.mortals.xhx.module.matter.service.MatterQuestionService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项常见问题
*
* @author zxfei
......@@ -32,171 +40,21 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/question")
public class MatterQuestionController extends BaseCRUDJsonPhpController<MatterQuestionService,MatterQuestionForm,MatterQuestionEntity,Long> {
public class MatterQuestionController extends BasePhpCRUDJsonMappingController<MatterQuestionService, MatterQuestionForm, MatterQuestionEntity, Long> {
@Autowired
private ParamService paramService;
public MatterQuestionController(){
public MatterQuestionController() {
super.setFormClass(MatterQuestionForm.class);
super.setModuleDesc( "事项常见问题");
super.setModuleDesc("事项常见问题");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterQuestionForm form, Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterQuestion","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项常见问题
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterQuestionQuery query) {
try {
MatterQuestionForm form = new MatterQuestionForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项常见问题列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterQuestion", "source"));
super.init(model, context);
}
/**
* 新增事项常见问题
*/
@PostMapping(value = "add")
public String add() {
try {
MatterQuestionForm form = new MatterQuestionForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项常见问题错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑事项常见问题
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterQuestionForm form = new MatterQuestionForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项常见问题模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项常见问题
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterQuestionEntity entity) {
try {
MatterQuestionForm form = new MatterQuestionForm();
form.setMatterQuestion(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项常见问题模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项常见问题
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterQuestionForm form = new MatterQuestionForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项常见问题错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项常见问题
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterQuestionForm form = new MatterQuestionForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项常见问题错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项常见问题导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项常见问题导入模板下载错误", e);
}
}
/**
* 事项常见问题导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项常见问题导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项常见问题导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterQuestionQuery query) {
try {
MatterQuestionForm form = new MatterQuestionForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项常见问题导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.matter.model.MatterSetbaseEntity;
import com.mortals.xhx.module.matter.model.MatterSetbaseQuery;
import com.mortals.xhx.module.matter.service.MatterSetbaseService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项设定依据
*
* @author zxfei
......@@ -32,172 +40,21 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/setbase")
public class MatterSetbaseController extends BaseCRUDJsonPhpController<MatterSetbaseService,MatterSetbaseForm,MatterSetbaseEntity,Long> {
public class MatterSetbaseController extends BasePhpCRUDJsonMappingController<MatterSetbaseService, MatterSetbaseForm, MatterSetbaseEntity, Long> {
@Autowired
private ParamService paramService;
public MatterSetbaseController(){
public MatterSetbaseController() {
super.setFormClass(MatterSetbaseForm.class);
super.setModuleDesc( "事项设定依据");
super.setModuleDesc("事项设定依据");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, MatterSetbaseForm form, Map<String, Object> model, Context context) {
this.addDict(model, "policyType", paramService.getParamBySecondOrganize("MatterSetbase","policyType"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterSetbase","source"));
super.init(request, response, form, model, context);
}
/**
* 查询事项设定依据
*/
@PostMapping(value = "list")
public String list(@RequestBody MatterSetbaseQuery query) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询事项设定依据列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "policyType", paramService.getParamBySecondOrganize("MatterSetbase", "policyType"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("MatterSetbase", "source"));
super.init(model, context);
}
/**
* 新增事项设定依据
*/
@PostMapping(value = "add")
public String add() {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
return super.add(form);
} catch (Exception e) {
log.error("新增事项设定依据错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑事项设定依据
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("事项设定依据模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存事项设定依据
*/
@PostMapping(value = "save")
public String save(@RequestBody MatterSetbaseEntity entity) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
form.setMatterSetbase(entity);
return super.save(form);
} catch (Exception e) {
log.error("事项设定依据模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除事项设定依据
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除事项设定依据错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看事项设定依据
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看事项设定依据错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项设定依据导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("事项设定依据导入模板下载错误", e);
}
}
/**
* 事项设定依据导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("事项设定依据导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 事项设定依据导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody MatterSetbaseQuery query) {
try {
MatterSetbaseForm form = new MatterSetbaseForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("事项设定依据导出错误", e);
}
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.mortals.xhx.module.model.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery;
......@@ -15,8 +16,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Map;
/**
*
* 模块
*
* @author zxfei
......@@ -24,170 +25,20 @@ import java.util.Map;
*/
@RestController
@RequestMapping("model")
public class ModelController extends BaseCRUDJsonPhpController<ModelService,ModelForm,ModelEntity,Long> {
public class ModelController extends BasePhpCRUDJsonMappingController<ModelService, ModelForm, ModelEntity, Long> {
@Autowired
private ParamService paramService;
public ModelController(){
public ModelController() {
super.setFormClass(ModelForm.class);
super.setModuleDesc( "模块");
super.setModuleDesc("模块");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, ModelForm form, Map<String, Object> model, Context context) {
super.init(request, response, form, model, context);
}
/**
* 查询模块
*/
@PostMapping(value = "list")
public String list(@RequestBody ModelQuery query) {
try {
ModelForm form = new ModelForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询模块列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增模块
*/
@PostMapping(value = "add")
public String add() {
try {
ModelForm form = new ModelForm();
return super.add(form);
} catch (Exception e) {
log.error("新增模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑模块
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
ModelForm form = new ModelForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("模块模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存模块
*/
@PostMapping(value = "save")
public String save(@RequestBody ModelEntity entity) {
try {
ModelForm form = new ModelForm();
form.setModel(entity);
return super.save(form);
} catch (Exception e) {
log.error("模块模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
/**
* 删除模块
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
ModelForm form = new ModelForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看模块
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
ModelForm form = new ModelForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 模块导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("模块导入模板下载错误", e);
}
}
/**
* 模块导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("模块导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 模块导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody ModelQuery query) {
try {
ModelForm form = new ModelForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("模块导出错误", e);
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.site.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessQuery;
......@@ -41,7 +42,7 @@ import static com.mortals.framework.ap.SysConstains.RESULT_KEY;
*/
@RestController
@RequestMapping("site/business")
public class SiteBusinessController extends BaseCRUDJsonPhpController<SiteBusinessService, SiteBusinessForm, SiteBusinessEntity, Long> {
public class SiteBusinessController extends BasePhpCRUDJsonMappingController<SiteBusinessService, SiteBusinessForm, SiteBusinessEntity, Long> {
@Autowired
private ParamService paramService;
......@@ -52,18 +53,16 @@ public class SiteBusinessController extends BaseCRUDJsonPhpController<SiteBusine
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SiteBusinessForm form, Map<String, Object> model, Context context) {
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "isBusiness", paramService.getParamBySecondOrganize("SiteBusiness", "isBusiness"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("SiteBusiness", "status"));
super.init(request, response, form, model, context);
super.init(model, context);
}
@Override
protected int doListAfter(HttpServletRequest request, HttpServletResponse response, SiteBusinessForm form, Map<String, Object> model, Context context) throws AppException {
protected int doListAfter(SiteBusinessEntity query, Map<String, Object> model, Context context) throws AppException {
List<SiteBusinessEntity> businessEntities = (List<SiteBusinessEntity>) model.get(RESULT_KEY);
if (!ObjectUtils.isEmpty(businessEntities)) {
businessEntities.stream().peek(item -> {
List<SiteBusinessEntity> childs = this.service.find(new SiteBusinessQuery().parentId(item.getBusinessId()));
if (!ObjectUtils.isEmpty(childs)) {
......@@ -74,7 +73,7 @@ public class SiteBusinessController extends BaseCRUDJsonPhpController<SiteBusine
}).count();
model.put(RESULT_KEY, businessEntities);
}
return super.doListAfter(request, response, form, model, context);
return super.doListAfter(query, model, context);
}
@PostMapping("list/exclude")
......@@ -126,158 +125,4 @@ public class SiteBusinessController extends BaseCRUDJsonPhpController<SiteBusine
return ret.toJSONString();
}
/**
* 查询站点业务
*/
@PostMapping(value = "list")
public String list(@RequestBody SiteBusinessQuery query) {
try {
SiteBusinessForm form = new SiteBusinessForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点业务列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增站点业务
*/
@PostMapping(value = "add")
public String add() {
try {
SiteBusinessForm form = new SiteBusinessForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑站点业务
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SiteBusinessForm form = new SiteBusinessForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点业务
*/
@PostMapping(value = "save")
public String save(@RequestBody SiteBusinessEntity entity) {
try {
SiteBusinessForm form = new SiteBusinessForm();
form.setSiteBusiness(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点业务
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SiteBusinessForm form = new SiteBusinessForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点业务
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SiteBusinessForm form = new SiteBusinessForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点业务导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点业务导入模板下载错误", e);
}
}
/**
* 站点业务导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点业务导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点业务导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SiteBusinessQuery query) {
try {
SiteBusinessForm form = new SiteBusinessForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点业务导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService;
......@@ -8,25 +9,32 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 站点
*
* @author zxfei
......@@ -34,185 +42,35 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("site")
public class SiteController extends BaseCRUDJsonPhpController<SiteService,SiteForm,SiteEntity,Long> {
public class SiteController extends BasePhpCRUDJsonMappingController<SiteService, SiteForm, SiteEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private ModelService modelService;
public SiteController(){
public SiteController() {
super.setFormClass(SiteForm.class);
super.setModuleDesc( "站点");
super.setModuleDesc("站点");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SiteForm form, Map<String, Object> model, Context context) {
this.addDict(model, "haveSonArea", paramService.getParamBySecondOrganize("Site","haveSonArea"));
this.addDict(model, "workday1", paramService.getParamBySecondOrganize("Site","workday1"));
this.addDict(model, "workday2", paramService.getParamBySecondOrganize("Site","workday2"));
this.addDict(model, "workday3", paramService.getParamBySecondOrganize("Site","workday3"));
this.addDict(model, "workday4", paramService.getParamBySecondOrganize("Site","workday4"));
this.addDict(model, "workday5", paramService.getParamBySecondOrganize("Site","workday5"));
this.addDict(model, "workday6", paramService.getParamBySecondOrganize("Site","workday6"));
this.addDict(model, "workday7", paramService.getParamBySecondOrganize("Site","workday7"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("Site","level"));
this.addDict(model, "building", paramService.getParamBySecondOrganize("Site","building"));
this.addDict(model, "isSite", paramService.getParamBySecondOrganize("Site","isSite"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Site","status"));
this.addDict(model, "modelIds", modelService.find(new ModelQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getModelName())));
super.init(request, response, form, model, context);
}
/**
* 查询站点
*/
@PostMapping(value = "list")
public String list(@RequestBody SiteQuery query) {
try {
SiteForm form = new SiteForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增站点
*/
@PostMapping(value = "add")
public String add() {
try {
SiteForm form = new SiteForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "haveSonArea", paramService.getParamBySecondOrganize("Site", "haveSonArea"));
this.addDict(model, "workday1", paramService.getParamBySecondOrganize("Site", "workday1"));
this.addDict(model, "workday2", paramService.getParamBySecondOrganize("Site", "workday2"));
this.addDict(model, "workday3", paramService.getParamBySecondOrganize("Site", "workday3"));
this.addDict(model, "workday4", paramService.getParamBySecondOrganize("Site", "workday4"));
this.addDict(model, "workday5", paramService.getParamBySecondOrganize("Site", "workday5"));
this.addDict(model, "workday6", paramService.getParamBySecondOrganize("Site", "workday6"));
this.addDict(model, "workday7", paramService.getParamBySecondOrganize("Site", "workday7"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("Site", "level"));
this.addDict(model, "building", paramService.getParamBySecondOrganize("Site", "building"));
this.addDict(model, "isSite", paramService.getParamBySecondOrganize("Site", "isSite"));
this.addDict(model, "status", paramService.getParamBySecondOrganize("Site", "status"));
this.addDict(model, "modelIds", modelService.find(new ModelQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getModelName())));
super.init(model, context);
}
/**
* 编辑站点
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SiteForm form = new SiteForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点
*/
@PostMapping(value = "save")
public String save(@RequestBody SiteEntity entity) {
try {
SiteForm form = new SiteForm();
form.setSite(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SiteForm form = new SiteForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SiteForm form = new SiteForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点导入模板下载错误", e);
}
}
/**
* 站点导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SiteQuery query) {
try {
SiteForm form = new SiteForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 站点事项
*
* @author zxfei
......@@ -32,170 +40,14 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("site/matter")
public class SiteMatterController extends BaseCRUDJsonPhpController<SiteMatterService,SiteMatterForm,SiteMatterEntity,Long> {
public class SiteMatterController extends BasePhpCRUDJsonMappingController<SiteMatterService, SiteMatterForm, SiteMatterEntity, Long> {
@Autowired
private ParamService paramService;
public SiteMatterController(){
public SiteMatterController() {
super.setFormClass(SiteMatterForm.class);
super.setModuleDesc( "站点事项");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SiteMatterForm form, Map<String, Object> model, Context context) {
super.init(request, response, form, model, context);
}
/**
* 查询站点事项
*/
@PostMapping(value = "list")
public String list(@RequestBody SiteMatterQuery query) {
try {
SiteMatterForm form = new SiteMatterForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点事项列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增站点事项
*/
@PostMapping(value = "add")
public String add() {
try {
SiteMatterForm form = new SiteMatterForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点事项错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
super.setModuleDesc("站点事项");
}
/**
* 编辑站点事项
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SiteMatterForm form = new SiteMatterForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点事项模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点事项
*/
@PostMapping(value = "save")
public String save(@RequestBody SiteMatterEntity entity) {
try {
SiteMatterForm form = new SiteMatterForm();
form.setSiteMatter(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点事项模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点事项
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SiteMatterForm form = new SiteMatterForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点事项错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点事项
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SiteMatterForm form = new SiteMatterForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点事项错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点事项导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点事项导入模板下载错误", e);
}
}
/**
* 站点事项导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点事项导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点事项导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SiteMatterQuery query) {
try {
SiteMatterForm form = new SiteMatterForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点事项导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.site.model.SiteModelEntity;
import com.mortals.xhx.module.site.model.SiteModelQuery;
import com.mortals.xhx.module.site.service.SiteModelService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 站点模块
*
* @author zxfei
......@@ -32,170 +40,13 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("site/model")
public class SiteModelController extends BaseCRUDJsonPhpController<SiteModelService,SiteModelForm,SiteModelEntity,Long> {
public class SiteModelController extends BasePhpCRUDJsonMappingController<SiteModelService, SiteModelForm, SiteModelEntity, Long> {
@Autowired
private ParamService paramService;
public SiteModelController(){
public SiteModelController() {
super.setFormClass(SiteModelForm.class);
super.setModuleDesc( "站点模块");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SiteModelForm form, Map<String, Object> model, Context context) {
super.init(request, response, form, model, context);
}
/**
* 查询站点模块
*/
@PostMapping(value = "list")
public String list(@RequestBody SiteModelQuery query) {
try {
SiteModelForm form = new SiteModelForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点模块列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增站点模块
*/
@PostMapping(value = "add")
public String add() {
try {
SiteModelForm form = new SiteModelForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑站点模块
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SiteModelForm form = new SiteModelForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点模块模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点模块
*/
@PostMapping(value = "save")
public String save(@RequestBody SiteModelEntity entity) {
try {
SiteModelForm form = new SiteModelForm();
form.setSiteModel(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点模块模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点模块
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SiteModelForm form = new SiteModelForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点模块
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SiteModelForm form = new SiteModelForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点模块导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点模块导入模板下载错误", e);
}
}
/**
* 站点模块导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点模块导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点模块导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SiteModelQuery query) {
try {
SiteModelForm form = new SiteModelForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点模块导出错误", e);
}
super.setModuleDesc("站点模块");
}
}
\ No newline at end of file
package com.mortals.xhx.module.sms.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.sms.model.SmsSetEntity;
import com.mortals.xhx.module.sms.model.SmsSetQuery;
import com.mortals.xhx.module.sms.service.SmsSetService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 短信设置
*
* @author zxfei
......@@ -32,172 +40,21 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("sms/set")
public class SmsSetController extends BaseCRUDJsonPhpController<SmsSetService,SmsSetForm,SmsSetEntity,Long> {
public class SmsSetController extends BasePhpCRUDJsonMappingController<SmsSetService, SmsSetForm, SmsSetEntity, Long> {
@Autowired
private ParamService paramService;
public SmsSetController(){
public SmsSetController() {
super.setFormClass(SmsSetForm.class);
super.setModuleDesc( "短信设置");
super.setModuleDesc("短信设置");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SmsSetForm form, Map<String, Object> model, Context context) {
this.addDict(model, "messageoff", paramService.getParamBySecondOrganize("SmsSet","messageoff"));
this.addDict(model, "smsplatform", paramService.getParamBySecondOrganize("SmsSet","smsplatform"));
super.init(request, response, form, model, context);
}
/**
* 查询短信设置
*/
@PostMapping(value = "list")
public String list(@RequestBody SmsSetQuery query) {
try {
SmsSetForm form = new SmsSetForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询短信设置列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "messageoff", paramService.getParamBySecondOrganize("SmsSet", "messageoff"));
this.addDict(model, "smsplatform", paramService.getParamBySecondOrganize("SmsSet", "smsplatform"));
super.init(model, context);
}
/**
* 新增短信设置
*/
@PostMapping(value = "add")
public String add() {
try {
SmsSetForm form = new SmsSetForm();
return super.add(form);
} catch (Exception e) {
log.error("新增短信设置错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑短信设置
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SmsSetForm form = new SmsSetForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("短信设置模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存短信设置
*/
@PostMapping(value = "save")
public String save(@RequestBody SmsSetEntity entity) {
try {
SmsSetForm form = new SmsSetForm();
form.setSmsSet(entity);
return super.save(form);
} catch (Exception e) {
log.error("短信设置模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除短信设置
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SmsSetForm form = new SmsSetForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除短信设置错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看短信设置
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SmsSetForm form = new SmsSetForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看短信设置错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 短信设置导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("短信设置导入模板下载错误", e);
}
}
/**
* 短信设置导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("短信设置导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 短信设置导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SmsSetQuery query) {
try {
SmsSetForm form = new SmsSetForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("短信设置导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.sms.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.sms.model.SmsTemplateEntity;
import com.mortals.xhx.module.sms.model.SmsTemplateQuery;
import com.mortals.xhx.module.sms.service.SmsTemplateService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 短信模板
*
* @author zxfei
......@@ -32,172 +40,21 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("sms/template")
public class SmsTemplateController extends BaseCRUDJsonPhpController<SmsTemplateService,SmsTemplateForm,SmsTemplateEntity,Long> {
public class SmsTemplateController extends BasePhpCRUDJsonMappingController<SmsTemplateService, SmsTemplateForm, SmsTemplateEntity, Long> {
@Autowired
private ParamService paramService;
public SmsTemplateController(){
public SmsTemplateController() {
super.setFormClass(SmsTemplateForm.class);
super.setModuleDesc( "短信模板");
super.setModuleDesc("短信模板");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, SmsTemplateForm form, Map<String, Object> model, Context context) {
this.addDict(model, "type", paramService.getParamBySecondOrganize("SmsTemplate","type"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("SmsTemplate","source"));
super.init(request, response, form, model, context);
}
/**
* 查询短信模板
*/
@PostMapping(value = "list")
public String list(@RequestBody SmsTemplateQuery query) {
try {
SmsTemplateForm form = new SmsTemplateForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询短信模板列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", paramService.getParamBySecondOrganize("SmsTemplate", "type"));
this.addDict(model, "source", paramService.getParamBySecondOrganize("SmsTemplate", "source"));
super.init(model, context);
}
/**
* 新增短信模板
*/
@PostMapping(value = "add")
public String add() {
try {
SmsTemplateForm form = new SmsTemplateForm();
return super.add(form);
} catch (Exception e) {
log.error("新增短信模板错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑短信模板
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
SmsTemplateForm form = new SmsTemplateForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("短信模板模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存短信模板
*/
@PostMapping(value = "save")
public String save(@RequestBody SmsTemplateEntity entity) {
try {
SmsTemplateForm form = new SmsTemplateForm();
form.setSmsTemplate(entity);
return super.save(form);
} catch (Exception e) {
log.error("短信模板模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除短信模板
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
SmsTemplateForm form = new SmsTemplateForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除短信模板错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看短信模板
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
SmsTemplateForm form = new SmsTemplateForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看短信模板错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 短信模板导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("短信模板导入模板下载错误", e);
}
}
/**
* 短信模板导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("短信模板导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 短信模板导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody SmsTemplateQuery query) {
try {
SmsTemplateForm form = new SmsTemplateForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("短信模板导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.window.model.WindowBusinessEntity;
import com.mortals.xhx.module.window.model.WindowBusinessQuery;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 窗口业务
*
* @author zxfei
......@@ -32,170 +40,14 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("window/business")
public class WindowBusinessController extends BaseCRUDJsonPhpController<WindowBusinessService,WindowBusinessForm,WindowBusinessEntity,Long> {
public class WindowBusinessController extends BasePhpCRUDJsonMappingController<WindowBusinessService, WindowBusinessForm, WindowBusinessEntity, Long> {
@Autowired
private ParamService paramService;
public WindowBusinessController(){
public WindowBusinessController() {
super.setFormClass(WindowBusinessForm.class);
super.setModuleDesc( "窗口业务");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, WindowBusinessForm form, Map<String, Object> model, Context context) {
super.init(request, response, form, model, context);
}
/**
* 查询窗口业务
*/
@PostMapping(value = "list")
public String list(@RequestBody WindowBusinessQuery query) {
try {
WindowBusinessForm form = new WindowBusinessForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询窗口业务列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 新增窗口业务
*/
@PostMapping(value = "add")
public String add() {
try {
WindowBusinessForm form = new WindowBusinessForm();
return super.add(form);
} catch (Exception e) {
log.error("新增窗口业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
super.setModuleDesc("窗口业务");
}
/**
* 编辑窗口业务
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
WindowBusinessForm form = new WindowBusinessForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("窗口业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存窗口业务
*/
@PostMapping(value = "save")
public String save(@RequestBody WindowBusinessEntity entity) {
try {
WindowBusinessForm form = new WindowBusinessForm();
form.setWindowBusiness(entity);
return super.save(form);
} catch (Exception e) {
log.error("窗口业务模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除窗口业务
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
WindowBusinessForm form = new WindowBusinessForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除窗口业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看窗口业务
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
WindowBusinessForm form = new WindowBusinessForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看窗口业务错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 窗口业务导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("窗口业务导入模板下载错误", e);
}
}
/**
* 窗口业务导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("窗口业务导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 窗口业务导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody WindowBusinessQuery query) {
try {
WindowBusinessForm form = new WindowBusinessForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("窗口业务导出错误", e);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.web;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonPhpController;
import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.model.WindowQuery;
import com.mortals.xhx.module.window.service.WindowService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 站点部门窗口
*
* @author zxfei
......@@ -32,173 +40,22 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("window")
public class WindowController extends BaseCRUDJsonPhpController<WindowService,WindowForm,WindowEntity,Long> {
public class WindowController extends BasePhpCRUDJsonMappingController<WindowService, WindowForm, WindowEntity, Long> {
@Autowired
private ParamService paramService;
public WindowController(){
public WindowController() {
super.setFormClass(WindowForm.class);
super.setModuleDesc( "站点部门窗口");
super.setModuleDesc("站点部门窗口");
}
@Override
protected void init(HttpServletRequest request, HttpServletResponse response, WindowForm form, Map<String, Object> model, Context context) {
this.addDict(model, "hongqi", paramService.getParamBySecondOrganize("Window","hongqi"));
this.addDict(model, "building", paramService.getParamBySecondOrganize("Window","building"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("Window","level"));
super.init(request, response, form, model, context);
}
/**
* 查询站点部门窗口
*/
@PostMapping(value = "list")
public String list(@RequestBody WindowQuery query) {
try {
WindowForm form = new WindowForm();
form.setQuery(query);
return super.list(form);
} catch (Exception e) {
log.error("查询站点部门窗口列表错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "hongqi", paramService.getParamBySecondOrganize("Window", "hongqi"));
this.addDict(model, "building", paramService.getParamBySecondOrganize("Window", "building"));
this.addDict(model, "level", paramService.getParamBySecondOrganize("Window", "level"));
super.init(model, context);
}
/**
* 新增站点部门窗口
*/
@PostMapping(value = "add")
public String add() {
try {
WindowForm form = new WindowForm();
return super.add(form);
} catch (Exception e) {
log.error("新增站点部门窗口错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 编辑站点部门窗口
*/
@GetMapping(value = "edit")
public String edit(Long id) {
try {
WindowForm form = new WindowForm();
form.setId(new Long[]{id});
return super.edit(form);
} catch (Exception e) {
log.error("站点部门窗口模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 保存站点部门窗口
*/
@PostMapping(value = "save")
public String save(@RequestBody WindowEntity entity) {
try {
WindowForm form = new WindowForm();
form.setWindow(entity);
return super.save(form);
} catch (Exception e) {
log.error("站点部门窗口模块错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 删除站点部门窗口
*/
@GetMapping(value = "delete")
public String delete(String id) {
try {
WindowForm form = new WindowForm();
String[] split = id.split(",");
Long[] ids = Arrays.asList(split).stream().map(Long::parseLong).toArray(Long[]::new);
form.setId(ids);
return super.delete(form);
} catch (Exception e) {
log.error("删除站点部门窗口错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 查看站点部门窗口
*/
@GetMapping(value = "info")
public String info(Long id) {
try {
WindowForm form = new WindowForm();
form.setId(new Long[]{id});
return super.view(form);
} catch (Exception e) {
log.error("查看站点部门窗口错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点部门窗口导入模板下载
*/
@PostMapping(value = "downloadTemplate")
public void downloadTemplate() {
try {
super.downloadTemplate();
} catch (Exception e) {
log.error("站点部门窗口导入模板下载错误", e);
}
}
/**
* 站点部门窗口导出
*/
@PostMapping(value = "importData")
public String importData(MultipartFile file, boolean updateSupport) {
try {
return super.importData(file, updateSupport);
} catch (Exception e) {
log.error("站点部门窗口导入错误", e);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
/**
* 站点部门窗口导出
*/
@PostMapping("exportExcel")
public void exportExcel(@RequestBody WindowQuery query) {
try {
WindowForm form = new WindowForm();
form.setQuery(query);
super.exportExcel(form);
} catch (Exception e) {
log.error("站点部门窗口导出错误", e);
}
}
}
\ No newline at end of file
......@@ -4,9 +4,8 @@ POST {{baseUrl}}/area/list
Content-Type: application/json
{
"name":"cpfz6z" ,
"page":1,
"size":10
"size":5
}
......@@ -15,19 +14,20 @@ POST {{baseUrl}}/area/save
Content-Type: application/json
{
"id": 36357,
"ancestors":"xk5j2k",
"name":"o0vynb",
"name":"11111111111",
"iid":"4eeoc8",
"parentId":"v92wze",
"haveSonArea":"1jo91t",
"haveSonDept":"40nazy",
"haveGetDept":"zyesnd",
"haveGetMatterList":"54lurh",
"pid":"0",
"haveSonArea":"True",
"haveSonDept":"True",
"haveGetDept":"True",
"haveGetMatterList":"True",
"areaCode":"gm0rjt",
"areaLevel":6348,
"areaLevel":1,
"shortName":"694fo7",
"domain":"ml27ym",
"status":4693
"status":1
}
> {%
......
......@@ -17,27 +17,42 @@ POST {{baseUrl}}/matter/datum/save
Content-Type: application/json
{
"matterId":583,
"matterName":"b2j0m3",
"materialName":"ojr00x",
"isMust":"jhv91k",
"materialType":"ptpoxo",
"materialProperty":"4l0bsv",
"electronicgs":"ypepxy",
"materialSource":"h1golu",
"paperNum":9732,
"paperGg":"zf6bbd",
"jianmMs":"41ejle",
"sealWay":"wbntt8",
"isjianm":"6l4zj5",
"isLack":"css4p5",
"ybUrl":"fk2mii",
"materialSourceSm":"wles9k",
"remarkSub":"mopce4",
"clauseContent":"ww01oz",
"summary":"0nxq74",
"remark":"gjtlrv",
"source":4151
"clauseContent":"测试材料带附件33",
"datumFileList":[
{
"fileName":"表格.xlsx",
"fileUrl":"/file/fileupload/1647420389903.xlsx",
"filetype":2,
"materialName":"测试材料带附件88",
"source":1
},
{
"fileName":"表格.xlsx",
"fileUrl":"/file/fileupload/1647420392415.xlsx",
"filetype":1,
"materialName":"测试材料带附件88",
"source":1
}
],
"electronicgs":"不限",
"isLack":"是",
"isMust":"必要",
"isjianm":"否",
"jianmMs":"无",
"materialName":"测试材料带附件88",
"materialProperty":"电子",
"materialSource":"申请人自备",
"materialSourceSm":"测试材料带附件33",
"materialType":"原件",
"matterDatumFileList":[
],
"paperGg":"A3",
"paperNum":3,
"remark":"测试材料带附件33",
"remarkSub":"测试材料带附件33",
"sealWay":"签证处盖章",
"summary":"测试材料带附件33"
}
> {%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment