package com.shlanbao.tzsc.pms.equ.eqpMaintain.controller;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpSession;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import com.shlanbao.tzsc.base.mapping.EqmWheelCovelParam;
|
import com.shlanbao.tzsc.base.mapping.EqmWheelCovelPlanInfo;
|
import com.shlanbao.tzsc.base.model.DataGrid;
|
import com.shlanbao.tzsc.base.model.Json;
|
import com.shlanbao.tzsc.base.model.PageParams;
|
import com.shlanbao.tzsc.pms.equ.eqpMaintain.service.EqpMaintainServiceI;
|
/**
|
* 设备维保计划控制层
|
* @author Administrator
|
*
|
*/
|
@Controller
|
@RequestMapping("/pms/eqpMaintain")
|
public class EqpMaintainController {
|
|
@Autowired
|
private EqpMaintainServiceI eqpMainService;
|
|
@ResponseBody
|
@RequestMapping("/queryMaintainPlan")
|
public DataGrid queryWCPlan(EqmWheelCovelPlanInfo wcpBean,PageParams pageParams,HttpServletRequest request){
|
try {
|
DataGrid gd = eqpMainService.queryEqmMaintainPlan(wcpBean,pageParams);
|
return gd;
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return null;
|
}
|
|
|
/**
|
* 查询设备保养信息
|
* @param bean
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping("/queryMaintainInfo")
|
public DataGrid queryMaintainInfo(EqmWheelCovelParam bean){
|
try {
|
return eqpMainService.queryMaintainInfo(bean);
|
} catch (Exception e) {
|
}
|
return null;
|
}
|
|
/**
|
* 查询维保计划详细
|
* @param bean
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping("/queryParam")
|
public DataGrid queryWcpParam(EqmWheelCovelParam bean){
|
try {
|
return eqpMainService.queryplanDetail(bean);
|
} catch (Exception e) {
|
}
|
return null;
|
}
|
|
|
/**设备保养记录反馈*/
|
@ResponseBody
|
@RequestMapping("/dasSendEquipmentWorkOrderResult")
|
public Json dasSendEquipmentWorkOrderResult(String type,String ids,HttpSession session){
|
Json json = new Json();
|
int flag=eqpMainService.dasSendEquipmentWorkOrderResult(type,ids);
|
json.setSuccess(flag==0?false:true);
|
json.setMsg(flag==0?"反馈失败!":"反馈成功!");
|
return json;
|
}
|
|
/**
|
* 编辑设备保养详细项
|
* @param id
|
*/
|
@RequestMapping("/goToEditParamsDetailJsp")
|
public String goToEditParamsDetailJsp(String id,HttpServletRequest request){
|
request.setAttribute("paramsBean", eqpMainService.queryDetailById(id));
|
return "/pms/equ/maintain/editEqpOrderDetail";
|
}
|
|
/**
|
* 维保修改详细项
|
* @param id
|
* @param request
|
*/
|
@ResponseBody
|
@RequestMapping("/editParamsBean")
|
public Json editParamsBean(EqmWheelCovelParam bean,HttpSession session){
|
Json json=new Json();
|
try {
|
eqpMainService.editParams(bean,session);
|
json.setSuccess(true);
|
json.setMsg("修改维保详细成功!");
|
} catch (Exception e) {
|
e.printStackTrace();
|
json.setMsg("修改维保详细失败!");
|
}
|
return json;
|
}
|
|
/**
|
* 完成设备维保项
|
* @param bean
|
* @param session
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping("/finishMaintainPlan")
|
public Json finishMaintainPlan(String id,HttpSession session){
|
Json json=new Json();
|
try {
|
eqpMainService.finishMainTainPlan(id,session);
|
json.setSuccess(true);
|
json.setMsg("修改维保计划状态成功!");
|
} catch (Exception e) {
|
e.printStackTrace();
|
json.setMsg("修改维保计划状态失败!");
|
}
|
return json;
|
}
|
|
/**
|
* 查询维修工信息
|
* @param id
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping("/queryMaintenanceman")
|
public DataGrid queryMaintenanceman(){
|
return eqpMainService.callMaintenanceman();
|
}
|
|
/**
|
* 添加维修呼叫记录
|
* @return
|
*/
|
@ResponseBody
|
@RequestMapping("/addCallInfo")
|
public Json addCallInfo(String id,String rId,String rName,String rType,HttpSession session){
|
return eqpMainService.addCallInfo(id,rId,rName,rType,session);
|
}
|
/**删除设备保养记录
|
* @param ids
|
* @author Rengj
|
* @return json
|
* */
|
@ResponseBody
|
@RequestMapping("/delMainTainPlan")
|
public Json delMainTainPlan(String ids){
|
Json json = new Json();
|
int flag=eqpMainService.delMainTainPlan(ids);
|
json.setSuccess(flag==0?false:true);
|
json.setMsg(flag==0?"删除失败!":"删除成功!");
|
return json;
|
}
|
|
|
/**
|
* @Description // 明细项撤回
|
* @Author bsw
|
* @Date 2020/9/28 16:56
|
* @Param [ids]
|
* @return com.shlanbao.tzsc.base.model.Json
|
**/
|
@ResponseBody
|
@RequestMapping("/recallParam")
|
public Json recallParam(String ids){
|
Json json = new Json();
|
try {
|
int flag=eqpMainService.recallParam(ids);
|
json.setSuccess(flag==0?false:true);
|
json.setMsg(flag<0?"撤回失败!":"撤回成功!");
|
} catch (Exception e) {
|
json.setSuccess(false);
|
json.setMsg("撤回失败");
|
}
|
|
|
return json;
|
}
|
|
|
|
}
|