// 增 必须把获取的map转为bean对数据库进行操作 @POST public String insert() throws IOException { Map formMap = this.getParams(); formMap = SysUtil.removeFilter(formMap); WaybillSign waybillSign = new WaybillSign(); // 把map转成bean对象 ParseFormToBean pftb = new ParseFormToBean(); waybillSign = (WaybillSign) pftb.parseToBean(formMap, waybillSign); // 将map转为bean对象 WaybillSignDao waybillSignDao = (WaybillSignDao) SofaSpringContext.getBean("waybillSignDao"); // 调用接口(实现类) // 获取登录用户信息 HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); String sureman = sessionBean.getRealname(); waybillSign.setInputman(sureman); // 输入人 waybillSign.setInputdate(GetFormatDate.getCurrentDate()); String msgJson = waybillSignDao.insert(waybillSign); // 调用Dao同名方法 // 添加日志操作记录 String currrentDate = GetFormatDate.getCurrentDate(); formMap.put("status", "已签收"); formMap.put("trace", "运单已签收"); formMap.put("inputDate", currrentDate); formMap.put("inputMan", sureman); WaybillLogDao waybillLogDao = (WaybillLogDao) SofaSpringContext.getBean("waybillLogDao"); // 调用接口(实现类) waybillLogDao.insert(formMap); // 保存日志操作记录 HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse() .responseJson(response, msgJson); // 返回给第1外包 Json格式: msg:ok|错误信息,id:int值 }
/** hkf 获取admin的partyname 2013.1.31 */ @POST public String addPartyName() { HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); String partyname = sessionBean.getPartyname(); partyname = JsonGenerateUtil.getMsgJson(partyname); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, partyname); }
/** hkf 子账号列表 2013.1.9 */ @POST public String list_json() { Map paramsMap = this.getParams(); paramsMap = SysUtil.removeFilter(paramsMap); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); paramsMap.put("partyid", sessionBean.getPartyid()); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); String backlist = operatorService.selectPageByKey(paramsMap); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, backlist); }
/** hkf 删除子账号 2013.1.9 */ @GET public String delete() { Map map = this.getParams(); map = SysUtil.removeFilter(map); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); map.put("partyid", sessionBean.getPartyid()); String msg = operatorService.delete(map); String jsonmsg = JsonGenerateUtil.getMsgJson(msg); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, jsonmsg); }
/** * hkf 用partyid查询admin操作员信息 2013.7.11 * * @return */ @GET public String selectMsgByPartyid() { Map paramsMap = new HashMap(); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); paramsMap.put("partyid", sessionBean.getPartyid()); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); String str = operatorService.selectAdminMsgByPartyid(paramsMap); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, str); }
/** hkf 判断是否为admin账户 2013.5.20 */ @GET public String checkOperatocPermission() { String per = ""; HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); String oper = (String) sessionBean.getOperator(); if (oper.equals("admin")) { per = "ok"; } per = JsonGenerateUtil.getMsgJson(per); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, per); }
/** * hkf 更新操作员信息 * * <p>2013.1.15 */ @POST public String updateoperatormsg() { Map map = this.getParams(); map = SysUtil.removeFilter(map); // String operator=SysUtil.getDecode(this.getParam("operator").toString()); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); map.put("partyid", sessionBean.getPartyid()); // map.put("partyid", "1"); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); String msg = operatorService.updateoperatormsg(map); msg = JsonGenerateUtil.getMsgJson(msg); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, msg); }
/** hkf 验证子账号名 2013.1.9 */ @GET public String checkoperator() { String operator = SysUtil.getDecode(this.getParam("operator").toString()); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); HttpServletResponse response = this.getResponseHelper().getResponse(); if (operator.equals("admin")) { String jsonmsg = JsonGenerateUtil.getMsgJson("sorry"); return new JsonResponse().responseJson(response, jsonmsg); } Map map = new HashMap(); map.put("operator", operator); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); map.put("partyid", sessionBean.getPartyid()); String msg = operatorService.checkoperator(map); msg = JsonGenerateUtil.getMsgJson(msg); return new JsonResponse().responseJson(response, msg); }
/** hkf 根据operatorid查询操作员 */ @GET public String list_query_detail_json() { String id = this.getParam("id").toString(); Map map = new HashMap(); if (id.contains("/")) { map.put("operatorid", id.split("/")[0]); } else { map.put("operatorid", id); } // map.put("operator", id.split("/")[1]); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); map.put("partyid", sessionBean.getPartyid()); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); String msg = operatorService.selectbyid(map); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, msg); }
/** hkf 插入操作员 2013.1.10 */ @POST public String save() { Map map = this.getParams(); map = SysUtil.removeFilter(map); Map mymap = new HashMap(); mymap.put("operator", map.get("username")); mymap.put("realname", map.get("realname")); mymap.put("mobilenumber", map.get("mobileInfo")); mymap.put("telephonenumber", map.get("tel")); mymap.put("password", MD5.md5(map.get("pwd").toString())); mymap.put("securitypermission", map.get("securitypermission")); // mymap.put("partyid", "1"); HttpServletRequest request = this.getResponseHelper().getRequest(); SessionBean sessionBean = SessionUtil.getSession(request); mymap.put("partyid", sessionBean.getPartyid()); OperatorService operatorService = (OperatorService) SofaSpringContext.getBean("operatorService"); String msg = operatorService.save(mymap); msg = JsonGenerateUtil.getMsgJson(msg); HttpServletResponse response = this.getResponseHelper().getResponse(); return new JsonResponse().responseJson(response, msg); }