package com.shlanbao.tzsc.pms.md.fixCode.controller;
|
|
import java.util.List;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import com.shlanbao.tzsc.pms.md.fixCode.beans.AccessParam;
|
import com.shlanbao.tzsc.pms.md.fixCode.beans.SelfCheckParam;
|
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.controller.BaseController;
|
import com.shlanbao.tzsc.base.mapping.MdFixCode;
|
import com.shlanbao.tzsc.base.model.DataGrid;
|
import com.shlanbao.tzsc.base.model.Json;
|
import com.shlanbao.tzsc.pms.md.fixCode.beans.FixCodeBean;
|
import com.shlanbao.tzsc.pms.md.fixCode.service.FixCodeServiceI;
|
import com.shlanbao.tzsc.utils.tools.BeanConvertor;
|
|
@Controller
|
@RequestMapping("/pms/fixCode")
|
public class FixCodeController extends BaseController{
|
|
@Autowired
|
public FixCodeServiceI fixCodeService;
|
|
/**
|
* 【功能说明】:查询综合基础数据
|
* @author wanchanghuang
|
* @createTime 2016年6月2日15:56:12
|
* @return
|
*
|
* */
|
@ResponseBody
|
@RequestMapping("/queryFixCode")
|
public DataGrid querFixCode(FixCodeBean fixBean){
|
try {
|
List<FixCodeBean> list=fixCodeService.queryFixCode(fixBean);
|
long count=0l;
|
if(list.size()>0){
|
count=list.size()+0l;
|
}
|
return new DataGrid(list, count);
|
} catch (Exception e) {
|
log.error("查询所有计量单位异常", e);
|
}
|
return null;
|
}
|
|
/**
|
* 刷新数据
|
*/
|
@ResponseBody
|
@RequestMapping("/refrushData")
|
public Json refrushData(){
|
Json json=new Json();
|
try {
|
fixCodeService.refrushData();
|
json.setMsg("刷新成功!");
|
json.setSuccess(true);
|
} catch (Exception e) {
|
json.setMsg("刷新失败!");
|
json.setSuccess(false);
|
e.printStackTrace();
|
}
|
return json;
|
}
|
|
/**
|
*新增或修改FixCodeBean数据
|
*/
|
@ResponseBody
|
@RequestMapping("/editMdFixCode")
|
public Json editMdFixCode(FixCodeBean bean){
|
Json json=new Json();
|
try {
|
MdFixCode mdFixCode=BeanConvertor.copyProperties(bean, MdFixCode.class);
|
json=fixCodeService.saveFixCode(mdFixCode, bean);
|
} catch (Exception e) {
|
e.printStackTrace();
|
json.setSuccess(false);
|
json.setMsg("新增或修改FixCodeBean数据异常!");
|
}
|
return json;
|
}
|
|
/**
|
*修改FixCodeBean数据页面
|
*/
|
@RequestMapping("/editMdFixCodeJsp")
|
public String editMdFixCodeJsp(HttpServletRequest request,FixCodeBean bean){
|
FixCodeBean b=fixCodeService.queryFixCode(bean).get(0);
|
request.setAttribute("bean", b);
|
return "/pms/md/fixcode/fixCodeAdd";
|
}
|
|
/**
|
*新增或修改FixCodeBean数据页面
|
*/
|
@RequestMapping("/addMdFixCodeJsp")
|
public String addMdFixCodeJsp(){
|
return "/pms/md/fixcode/fixCodeAdd";
|
}
|
|
|
/**
|
*删除FixCodeBean数据
|
*/
|
@ResponseBody
|
@RequestMapping("/deleteMdFixCode")
|
public Json deleteMdFixCode(String id){
|
Json json=new Json();
|
try {
|
|
json=fixCodeService.deleteFixCode(id);
|
} catch (Exception e) {
|
e.printStackTrace();
|
json.setSuccess(false);
|
json.setMsg("删除数据异常!");
|
}
|
return json;
|
}
|
|
|
|
/**
|
*批量删除FixCodeBean数据
|
*/
|
@ResponseBody
|
@RequestMapping("/batchDeleteMdFixCode")
|
public Json batchDeleteMdFixCode(String ids){
|
Json json=new Json();
|
try {
|
|
fixCodeService.batchDeleteMdFixCode(ids);
|
json.setMsg("删除数据成功");
|
json.setSuccess(true);
|
} catch (Exception e) {
|
e.printStackTrace();
|
json.setSuccess(false);
|
json.setMsg("删除数据异常!");
|
}
|
return json;
|
}
|
|
|
|
|
/**
|
* @Author bsw
|
* @Description 获取工资考核参数
|
* @Date 2021/6/25 14:06
|
* @Param []
|
* @return com.shlanbao.tzsc.base.model.Json
|
**/
|
@ResponseBody
|
@RequestMapping("/queryWagesAccess")
|
public Json queryWagesAccess(){
|
Json json = new Json();
|
try {
|
AccessParam accessParam = fixCodeService.queryWagesAccess();
|
json.setObj(accessParam);
|
|
json.setSuccess(true);
|
}catch (Exception e ) {
|
e.printStackTrace();
|
json.setSuccess(false);
|
}
|
return json;
|
}
|
|
|
/**
|
* @Author bsw
|
* @Description 获取物理自检考核报表参数
|
* @Date 2021/6/28 14:00
|
* @Param []
|
* @return com.shlanbao.tzsc.base.model.Json
|
**/
|
@ResponseBody
|
@RequestMapping("/queryWlkh")
|
public Json queryWlkh(String upcode){
|
Json json = new Json();
|
try {
|
SelfCheckParam param = fixCodeService.queryWlkh(upcode);
|
json.setObj(param);
|
|
json.setSuccess(true);
|
}catch (Exception e ) {
|
e.printStackTrace();
|
json.setSuccess(false);
|
}
|
return json;
|
}
|
|
|
|
/**
|
* @Author bsw
|
* @Description 保存工资考核参数
|
* @Date 2021/6/25 14:34
|
* @Param [accessParam]
|
* @return com.shlanbao.tzsc.base.model.Json
|
**/
|
@ResponseBody
|
@RequestMapping("/saveWagesAccess")
|
public Json saveWagesAccess(AccessParam accessParam) {
|
Json json = new Json();
|
try {
|
fixCodeService.saveWagesAccess(accessParam);
|
json.setMsg("修改成功");
|
json.setSuccess(true);
|
}catch (Exception e ) {
|
e.printStackTrace();
|
json.setMsg("修改失败!");
|
json.setSuccess(false);
|
}
|
return json;
|
}
|
|
|
/**
|
* @Author bsw
|
* @Description 自检测考核参数维护
|
* @Date 2021/6/28 14:18
|
* @Param [param]
|
* @return com.shlanbao.tzsc.base.model.Json
|
**/
|
@ResponseBody
|
@RequestMapping("/saveWlkh")
|
public Json saveWlkh(SelfCheckParam param,String upcode) {
|
Json json = new Json();
|
try {
|
fixCodeService.saveWlkh(param,upcode);
|
json.setMsg("修改成功");
|
json.setSuccess(true);
|
}catch (Exception e ) {
|
e.printStackTrace();
|
json.setMsg("修改失败!");
|
json.setSuccess(false);
|
}
|
return json;
|
}
|
|
|
|
}
|