code format
parent
0da6a22454
commit
70d722afb5
|
@ -1,4 +1,5 @@
|
|||
package com.zzjee.wm.controller;
|
||||
|
||||
import com.zzjee.md.entity.MdBinEntity;
|
||||
import com.zzjee.md.entity.MdCusEntity;
|
||||
import com.zzjee.md.entity.MdGoodsEntity;
|
||||
|
@ -83,12 +84,11 @@ import org.springframework.http.MediaType;
|
|||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
/**
|
||||
* @author erzhongxmu
|
||||
* @version V1.0
|
||||
* @Title: Controller
|
||||
* @Description: 计费日期配置
|
||||
* @author erzhongxmu
|
||||
* @date 2017-10-11 00:26:00
|
||||
* @version V1.0
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/wmDayCostConfController")
|
||||
|
@ -126,16 +126,16 @@ public class WmDayCostConfController extends BaseController {
|
|||
*/
|
||||
|
||||
@RequestMapping(params = "datagrid")
|
||||
public void datagrid(WmDayCostConfEntity wmDayCostConf,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||
public void datagrid(WmDayCostConfEntity wmDayCostConf, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||
CriteriaQuery cq = new CriteriaQuery(WmDayCostConfEntity.class, dataGrid);
|
||||
//查询条件组装器
|
||||
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmDayCostConf, request.getParameterMap());
|
||||
try{
|
||||
try {
|
||||
//自定义追加查询条件
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
Map<String,Object> map1 = new HashMap<String,Object>();
|
||||
Map<String, Object> map1 = new HashMap<String, Object>();
|
||||
map1.put("costDate", "desc");
|
||||
cq.setOrder(map1);
|
||||
cq.add();
|
||||
|
@ -155,13 +155,12 @@ public class WmDayCostConfController extends BaseController {
|
|||
AjaxJson j = new AjaxJson();
|
||||
wmDayCostConf = systemService.getEntity(WmDayCostConfEntity.class, wmDayCostConf.getId());
|
||||
message = "计费日期配置删除成功";
|
||||
try{
|
||||
try {
|
||||
wmDayCostConf.setCostSf("N");
|
||||
wmDayCostConfService.saveOrUpdate(wmDayCostConf);
|
||||
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "计费日期配置删除失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -175,12 +174,12 @@ public class WmDayCostConfController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(params = "doBatchDel")
|
||||
@ResponseBody
|
||||
public AjaxJson doBatchDel(String ids,HttpServletRequest request){
|
||||
public AjaxJson doBatchDel(String ids, HttpServletRequest request) {
|
||||
String message = null;
|
||||
AjaxJson j = new AjaxJson();
|
||||
message = "计费日期配置删除成功";
|
||||
try{
|
||||
for(String id:ids.split(",")){
|
||||
try {
|
||||
for (String id : ids.split(",")) {
|
||||
WmDayCostConfEntity wmDayCostConf = systemService.getEntity(WmDayCostConfEntity.class,
|
||||
id
|
||||
);
|
||||
|
@ -189,9 +188,8 @@ public class WmDayCostConfController extends BaseController {
|
|||
// wmDayCostConfService.delete(wmDayCostConf);
|
||||
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
|
||||
}
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "计费日期配置删除失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -210,17 +208,17 @@ public class WmDayCostConfController extends BaseController {
|
|||
String message = null;
|
||||
AjaxJson j = new AjaxJson();
|
||||
message = "计费日期配置添加成功";
|
||||
try{
|
||||
try {
|
||||
wmDayCostConfService.save(wmDayCostConf);
|
||||
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "计费日期配置添加失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算每日费用
|
||||
*
|
||||
|
@ -236,14 +234,14 @@ public class WmDayCostConfController extends BaseController {
|
|||
|
||||
WmDayCostConfEntity t = wmDayCostConfService.get(WmDayCostConfEntity.class, request.getParameter("id"));
|
||||
|
||||
if(t.getCostSf()!=null&&t.getCostSf().equals("Y")){
|
||||
if (t.getCostSf() != null && t.getCostSf().equals("Y")) {
|
||||
j.setMsg(message);
|
||||
message = "费用已经更新";
|
||||
return j;
|
||||
}
|
||||
try{
|
||||
task.costcountv2(DateUtils.date2Str(t.getCostDate(),DateUtils.date_sdf),"Y",t);
|
||||
}catch (Exception e){
|
||||
try {
|
||||
task.costcountv2(DateUtils.date2Str(t.getCostDate(), DateUtils.date_sdf), "Y", t);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
t.setCostSf("Y");
|
||||
|
@ -253,12 +251,12 @@ public class WmDayCostConfController extends BaseController {
|
|||
// 再计算
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "费用更新失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
return j;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新计费日期配置
|
||||
*
|
||||
|
@ -278,7 +276,6 @@ public class WmDayCostConfController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "计费日期配置更新失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -299,6 +296,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
}
|
||||
return new ModelAndView("com/zzjee/wm/wmDayCostConf-add");
|
||||
}
|
||||
|
||||
/**
|
||||
* 计费日期配置编辑页面跳转
|
||||
*
|
||||
|
@ -320,7 +318,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(params = "upload")
|
||||
public ModelAndView upload(HttpServletRequest req) {
|
||||
req.setAttribute("controller_name","wmDayCostConfController");
|
||||
req.setAttribute("controller_name", "wmDayCostConfController");
|
||||
return new ModelAndView("common/upload/pub_excel_upload");
|
||||
}
|
||||
|
||||
|
@ -331,18 +329,19 @@ public class WmDayCostConfController extends BaseController {
|
|||
* @param response
|
||||
*/
|
||||
@RequestMapping(params = "exportXls")
|
||||
public String exportXls(WmDayCostConfEntity wmDayCostConf,HttpServletRequest request,HttpServletResponse response
|
||||
, DataGrid dataGrid,ModelMap modelMap) {
|
||||
public String exportXls(WmDayCostConfEntity wmDayCostConf, HttpServletRequest request, HttpServletResponse response
|
||||
, DataGrid dataGrid, ModelMap modelMap) {
|
||||
CriteriaQuery cq = new CriteriaQuery(WmDayCostConfEntity.class, dataGrid);
|
||||
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, wmDayCostConf, request.getParameterMap());
|
||||
List<WmDayCostConfEntity> wmDayCostConfs = this.wmDayCostConfService.getListByCriteriaQuery(cq,false);
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME,"计费日期配置");
|
||||
modelMap.put(NormalExcelConstants.CLASS,WmDayCostConfEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("计费日期配置列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
List<WmDayCostConfEntity> wmDayCostConfs = this.wmDayCostConfService.getListByCriteriaQuery(cq, false);
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME, "计费日期配置");
|
||||
modelMap.put(NormalExcelConstants.CLASS, WmDayCostConfEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("计费日期配置列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,wmDayCostConfs);
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST, wmDayCostConfs);
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 使模板
|
||||
*
|
||||
|
@ -350,13 +349,13 @@ public class WmDayCostConfController extends BaseController {
|
|||
* @param response
|
||||
*/
|
||||
@RequestMapping(params = "exportXlsByT")
|
||||
public String exportXlsByT(WmDayCostConfEntity wmDayCostConf,HttpServletRequest request,HttpServletResponse response
|
||||
, DataGrid dataGrid,ModelMap modelMap) {
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME,"计费日期配置");
|
||||
modelMap.put(NormalExcelConstants.CLASS,WmDayCostConfEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("计费日期配置列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(),
|
||||
public String exportXlsByT(WmDayCostConfEntity wmDayCostConf, HttpServletRequest request, HttpServletResponse response
|
||||
, DataGrid dataGrid, ModelMap modelMap) {
|
||||
modelMap.put(NormalExcelConstants.FILE_NAME, "计费日期配置");
|
||||
modelMap.put(NormalExcelConstants.CLASS, WmDayCostConfEntity.class);
|
||||
modelMap.put(NormalExcelConstants.PARAMS, new ExportParams("计费日期配置列表", "导出人:" + ResourceUtil.getSessionUserName().getRealName(),
|
||||
"导出信息"));
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList());
|
||||
modelMap.put(NormalExcelConstants.DATA_LIST, new ArrayList());
|
||||
return NormalExcelConstants.JEECG_EXCEL_VIEW;
|
||||
}
|
||||
|
||||
|
@ -375,7 +374,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<WmDayCostConfEntity> listWmDayCostConfEntitys = ExcelImportUtil.importExcel(file.getInputStream(),WmDayCostConfEntity.class,params);
|
||||
List<WmDayCostConfEntity> listWmDayCostConfEntitys = ExcelImportUtil.importExcel(file.getInputStream(), WmDayCostConfEntity.class, params);
|
||||
for (WmDayCostConfEntity wmDayCostConf : listWmDayCostConfEntitys) {
|
||||
wmDayCostConfService.save(wmDayCostConf);
|
||||
}
|
||||
|
@ -383,7 +382,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
} catch (Exception e) {
|
||||
j.setMsg("文件导入失败!");
|
||||
logger.error(ExceptionUtil.getExceptionMessage(e));
|
||||
}finally{
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
|
@ -397,7 +396,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public List<WmDayCostConfEntity> list() {
|
||||
List<WmDayCostConfEntity> listWmDayCostConfs=wmDayCostConfService.getList(WmDayCostConfEntity.class);
|
||||
List<WmDayCostConfEntity> listWmDayCostConfs = wmDayCostConfService.getList(WmDayCostConfEntity.class);
|
||||
return listWmDayCostConfs;
|
||||
}
|
||||
|
||||
|
@ -421,7 +420,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
}
|
||||
|
||||
//保存
|
||||
try{
|
||||
try {
|
||||
wmDayCostConfService.save(wmDayCostConf);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -445,7 +444,7 @@ public class WmDayCostConfController extends BaseController {
|
|||
}
|
||||
|
||||
//保存
|
||||
try{
|
||||
try {
|
||||
wmDayCostConfService.saveOrUpdate(wmDayCostConf);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -315,7 +315,6 @@ public class WmDayCostController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
message = "费用维护删除失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -343,7 +342,6 @@ public class WmDayCostController extends BaseController {
|
|||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
message = "费用维护删除失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -368,7 +366,6 @@ public class WmDayCostController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
message = "费用维护添加失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -394,7 +391,6 @@ public class WmDayCostController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "费用维护更新失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -420,7 +416,6 @@ public class WmDayCostController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "费用结清失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
@ -440,7 +435,6 @@ public class WmDayCostController extends BaseController {
|
|||
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "费用反结清失败";
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
j.setMsg(message);
|
||||
|
|
Loading…
Reference in New Issue