| | |
| | | package cn.ksource.web.facade.satis; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import cn.ksource.beans.AUDITING_SATIS_INFO; |
| | | import cn.ksource.beans.CUSTOMER_SATIS_TEMPLATE; |
| | | import cn.ksource.beans.ORDER_SATIS_INFO; |
| | | import cn.ksource.beans.SC_WORKFLOW_INCIDENT; |
| | | import cn.ksource.beans.SC_WORKFLOW_INCIDENT_LOCAL; |
| | | import cn.ksource.beans.WORKFLOW_BASE; |
| | | import cn.ksource.beans.*; |
| | | import cn.ksource.core.dao.BaseDao; |
| | | import cn.ksource.core.dao.SqlParameter; |
| | | import cn.ksource.core.page.PageInfo; |
| | |
| | | import cn.ksource.web.Constants; |
| | | import cn.ksource.web.facade.incident.IncidentFacade; |
| | | import cn.ksource.web.service.file.FileService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("satisfationFacade") |
| | | public class SatisfactionFacadeImpl implements SatisfactionFacade { |
| | | |
| | | |
| | | @Autowired |
| | | private BaseDao baseDao; |
| | | |
| | | @Autowired |
| | | private FileService fileService; |
| | | |
| | | |
| | | @Autowired |
| | | private IncidentFacade incidentFacade; |
| | | |
| | | |
| | | @Override |
| | | public int queryIncisatisCount(Map<String, String> params) { |
| | | StringBuilder sql = new StringBuilder(); |
| | |
| | | @Override |
| | | public PageInfo queryIncisatisData(PageInfo pageInfo, |
| | | Map<String, String> params) { |
| | | |
| | | |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append("SELECT DISTINCT WB.ID,WB.ORDER_CODE,WB.ENDTIME,WB.WFNAME,WB.BUSINESSTYPE,WB.CREATERNAME,WB.CREATETIME,WB.WFNOTE,B.CONTACT_NAME,B.CONTACT_PHONE, "); |
| | | sql.append("SELECT DISTINCT WB.ID,WB.ORDER_CODE,WB.ENDTIME,WB.WFNAME,WB.BUSINESSTYPE,WB.CREATERNAME,WB.CREATETIME,B.CONTACT_NAME,B.CONTACT_PHONE, "); |
| | | sql.append("WB.CURRENT_NODE_ID,WB.CURRENT_NODE_NAME,WB.CUSTOMER_NAME,WB.CURRENT_DEALER_NAME,WB.BUSINESS_ID,WB.WFSTATE,C.SCORE "); |
| | | sql.append("FROM SC_WORKFLOW_INCIDENT B,WORKFLOW_BASE WB LEFT JOIN ORDER_SATIS_INFO C ON C.BUSINESS_ID = WB.ID WHERE WB.BUSINESS_ID = B.ID "); |
| | | sql.append("AND WB.BUSINESSTYPE = :businessType "); |
| | | params.put("businessType", ConvertUtil.obj2StrBlank(Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT)); |
| | | |
| | | |
| | | sql = getIncidentSql(sql,params); |
| | | |
| | | |
| | | sql.append( " ORDER BY WB.CREATETIME DESC "); |
| | | return baseDao.queryforSplitPageInfo(pageInfo,sql.toString(),params); |
| | | } |
| | | @Override |
| | | public PageInfo queryIncisatisLocalData(PageInfo pageInfo, |
| | | Map<String, String> params) { |
| | | |
| | | |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append("SELECT DISTINCT WB.ID,WB.ORDER_CODE,WB.ENDTIME,WB.WFNAME,WB.BUSINESSTYPE,WB.CREATERNAME,WB.CREATETIME,WB.WFNOTE,B.CONTACT_NAME,B.CONTACT_PHONE, "); |
| | | sql.append("SELECT DISTINCT WB.ID,WB.ORDER_CODE,WB.ENDTIME,WB.WFNAME,WB.BUSINESSTYPE,WB.CREATERNAME,WB.CREATETIME,B.CONTACT_NAME,B.CONTACT_PHONE, "); |
| | | sql.append("WB.CURRENT_NODE_ID,WB.CURRENT_NODE_NAME,WB.CUSTOMER_NAME,WB.CURRENT_DEALER_NAME,WB.BUSINESS_ID,WB.WFSTATE,C.SCORE "); |
| | | sql.append("FROM SC_WORKFLOW_INCIDENT_LOCAL B,WORKFLOW_BASE WB LEFT JOIN ORDER_SATIS_INFO C ON C.BUSINESS_ID = WB.ID WHERE WB.BUSINESS_ID = B.ID "); |
| | | sql.append("AND WB.BUSINESSTYPE = :businessType "); |
| | | params.put("businessType", ConvertUtil.obj2StrBlank(Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT_LOCAL)); |
| | | |
| | | |
| | | sql = getIncidentSql(sql,params); |
| | | |
| | | |
| | | sql.append( " ORDER BY WB.CREATETIME DESC "); |
| | | return baseDao.queryforSplitPageInfo(pageInfo,sql.toString(),params); |
| | | } |
| | | public StringBuilder getIncidentSql(StringBuilder sql,Map<String, String> params){ |
| | | |
| | | |
| | | String customer_id = params.get("customer_id"); |
| | | |
| | | |
| | | if(StringUtil.notEmpty(customer_id)) { |
| | | sql.append(" AND B.CUSTOMER_ID = :customer_id "); |
| | | params.put("customer_id", customer_id); |
| | | } |
| | | |
| | | |
| | | String contract = params.get("contract"); |
| | | if(StringUtil.notEmpty(contract)) { |
| | | sql.append(" AND B.CONTACT_NAME LIKE :contract "); |
| | | params.put("contract", "%"+contract+"%"); |
| | | } |
| | | |
| | | |
| | | String phone = params.get("phone"); |
| | | if(StringUtil.notEmpty(phone)) { |
| | | sql.append(" AND B.CONTACT_PHONE = :phone "); |
| | | params.put("phone", phone); |
| | | } |
| | | |
| | | |
| | | String ordercode = params.get("ordercode"); |
| | | if(StringUtil.notEmpty(ordercode)) { |
| | | sql.append(" AND WB.ORDER_CODE LIKE :ordercode "); |
| | | params.put("ordercode", "%"+ordercode+"%"); |
| | | } |
| | | |
| | | |
| | | String orderName = params.get("orderName"); |
| | | if(StringUtil.notEmpty(orderName)) { |
| | | sql.append(" AND WB.WFNAME LIKE :orderName "); |
| | | params.put("orderName", "%"+orderName+"%"); |
| | | } |
| | | |
| | | |
| | | String begin_time = params.get("begin_time"); |
| | | if(StringUtil.notEmpty(begin_time)) { |
| | | sql.append(" AND WB.CREATETIME >= :begin_time "); |
| | |
| | | sql.append(" AND WB.CREATETIME <= :end_time "); |
| | | params.put("end_time", end_time+"240000"); |
| | | } |
| | | |
| | | |
| | | String satistype = params.get("satistype"); |
| | | if(StringUtil.notEmpty(satistype)) { |
| | | String[] satistypes = satistype.split(","); |
| | | |
| | | |
| | | sql.append(" AND WB.WFSTATE IN ("); |
| | | for(int i=0; i<satistypes.length; i++) { |
| | | sql.append(" :state"+i); |
| | |
| | | } |
| | | return sql; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map gettjmsg(String cusId,String type) { |
| | | |
| | | |
| | | String month = ConvertUtil.obj2StrBlank(DateUtil.getCurrentDate6()); |
| | | String sql = "SELECT * FROM TOTLE_SATIS_INFO A,TOTLE_SATIS_DETAIL B WHERE A.CUSTOMER_ID = :cusId AND A.MONTH = :month AND A.ID = B.BUS_ID AND B.SATIS_TYPE = :type "; |
| | | Map param = new HashMap(); |
| | |
| | | nowmsgMap.put("ddc", NumberUtil.sub(ConvertUtil.obj2Double(nowmsgMap.get("ALL_COUNT")), ConvertUtil.obj2Double(nowmsgMap.get("SATIS_COUNT")))); |
| | | } |
| | | nowmsgMap.put("before", beformsgMap.get("ALL_SCORE")); |
| | | |
| | | |
| | | if(StringUtil.isNotBlank(ConvertUtil.obj2StrBlank(nowmsgMap.get("ID")))&&!StringUtil.isEmpty(ConvertUtil.obj2StrBlank(beformsgMap.get("ALL_SCORE")))){ |
| | | double subnum = NumberUtil.sub(ConvertUtil.obj2Double(nowmsgMap.get("ALL_SCORE")),ConvertUtil.obj2Double(nowmsgMap.get("before"))); |
| | | double divnum = NumberUtil.div(subnum, ConvertUtil.obj2Double(nowmsgMap.get("before")),4); |
| | |
| | | } |
| | | return nowmsgMap; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map querysatisitemData(String type,String busId) { |
| | | StringBuffer sql = new StringBuffer("SELECT WB.ID,WB.BUSINESS_ID,WB.ORDER_CODE,WB.CUSTOMER_NAME,WB.WFNAME,WB.BUSINESSTYPE,A.CUSTOMER_CODE FROM WORKFLOW_BASE WB ,SC_PARTNER_CUSTOMER_INFO A "); |
| | |
| | | List<Map> itemYjList = baseDao.queryForList(sqlYj.toString(),param); |
| | | List<Map> itemList = baseDao.queryForList(sqlEj.toString(),param); |
| | | List<Map> evaList = baseDao.queryForList(sqlEva.toString(),param); |
| | | |
| | | |
| | | if(itemList != null && itemList.size()>0){ |
| | | for(Map item:itemList){ |
| | | List<Map> evaluList = new ArrayList<Map>(); |
| | |
| | | evaluList.add(eva); |
| | | } |
| | | } |
| | | |
| | | |
| | | item.put("EVALUATION", evaluList); |
| | | item.put("ROWSPAN", evaluList.size()); |
| | | } |
| | | } |
| | | if(itemYjList.size()>0){ |
| | | |
| | | |
| | | for(Map temp:itemYjList){ |
| | | List<Map> itemEjList = new ArrayList(); |
| | | for(Map item:itemList){ |
| | |
| | | } |
| | | return cardMap; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getnumbh(String busId) { |
| | | String newcodes = ""; |
| | |
| | | newcodes = ConvertUtil.obj2StrBlank(newcode); |
| | | } |
| | | } |
| | | |
| | | |
| | | return newcodes; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveSatisResult(HttpServletRequest request) { |
| | | |
| | | |
| | | String busId = request.getParameter("busId"); |
| | | String template_id = request.getParameter("template_id"); |
| | | CUSTOMER_SATIS_TEMPLATE template = new CUSTOMER_SATIS_TEMPLATE(template_id).getInstanceById(); |
| | |
| | | String customer_person_name = request.getParameter("customer_person_name"); |
| | | String customer_person_telphone = request.getParameter("customer_person_telphone"); |
| | | String upload_time = request.getParameter("uploadtime").replace("-", ""); |
| | | |
| | | |
| | | Map userMap = WebUtil.getLoginUser(request).getLoginUser(); |
| | | |
| | | |
| | | ORDER_SATIS_INFO satisOrder = new ORDER_SATIS_INFO(); |
| | | satisOrder.setBusiness_id(busId).setTemplate_id(template_id) |
| | | .setCard_month(ConvertUtil.obj2Long(DateUtil.format("yyyyMM", customerMap.get("ENDTIME")))).setCustomer_contact_name(customer_person_name).setCode(reportcode) |
| | |
| | | scoreNum = NumberUtil.div(scoreNum, 10000.00, 2); |
| | | satisOrder.setScore(scoreNum).insert(); |
| | | fileService.uploadFile(request, satisOrder.getId(),null,null); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | for(int j=0;j<item_ids.length;j++){ |
| | | if(!"nocheck".equals(scores[j])){ |
| | | |
| | | |
| | | String score[] = scores[j].split("&"); |
| | | SqlParameter param = new SqlParameter(); |
| | | param.addValue("ID", StringUtil.getUUID()); |
| | |
| | | SC_WORKFLOW_INCIDENT incident = new SC_WORKFLOW_INCIDENT(base.getBusiness_id()); |
| | | incident.setState(ConvertUtil.obj2Integer(Constants.SC_WORKFLOW_INCIDENT_STATE_YPJ)).update(); |
| | | } |
| | | |
| | | |
| | | } |
| | | @Override |
| | | public void saveSatisLocalResult(HttpServletRequest request) { |
| | | |
| | | |
| | | String busId = request.getParameter("busId"); |
| | | String template_id = request.getParameter("template_id"); |
| | | CUSTOMER_SATIS_TEMPLATE template = new CUSTOMER_SATIS_TEMPLATE(template_id).getInstanceById(); |
| | |
| | | String customer_person_name = request.getParameter("customer_person_name"); |
| | | String customer_person_telphone = request.getParameter("customer_person_telphone"); |
| | | String upload_time = request.getParameter("uploadtime").replace("-", ""); |
| | | |
| | | |
| | | Map userMap = WebUtil.getLoginUser(request).getLoginUser(); |
| | | |
| | | |
| | | ORDER_SATIS_INFO satisOrder = new ORDER_SATIS_INFO(); |
| | | satisOrder.setBusiness_id(busId).setTemplate_id(template_id) |
| | | .setCard_month(ConvertUtil.obj2Long(DateUtil.format("yyyyMM", customerMap.get("ENDTIME")))).setCustomer_contact_name(customer_person_name).setCode(reportcode) |
| | |
| | | scoreNum = NumberUtil.div(scoreNum, 10000.00, 2); |
| | | satisOrder.setScore(scoreNum).insert(); |
| | | fileService.uploadFile(request, satisOrder.getId(),null,null); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | for(int j=0;j<item_ids.length;j++){ |
| | | if(!"nocheck".equals(scores[j])){ |
| | | |
| | | |
| | | String score[] = scores[j].split("&"); |
| | | SqlParameter param = new SqlParameter(); |
| | | param.addValue("ID", StringUtil.getUUID()); |
| | |
| | | SC_WORKFLOW_INCIDENT_LOCAL incident = new SC_WORKFLOW_INCIDENT_LOCAL(base.getBusiness_id()); |
| | | incident.setState(ConvertUtil.obj2Integer(Constants.SC_WORKFLOW_INCIDENT_STATE_YPJ)).update(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map getReportDetail(String busId,String type) { |
| | | |
| | | |
| | | StringBuffer sql = new StringBuffer("SELECT O.*,WB.ID AS FLOWID,WB.BUSINESS_ID AS BUS_ID,WB.ORDER_CODE,WB.WFNAME,WB.BUSINESSTYPE FROM WORKFLOW_BASE WB,ORDER_SATIS_INFO O "); |
| | | sql.append(" WHERE WB.ID = :busId AND O.BUSINESS_ID = WB.ID "); |
| | | Map customerMap = baseDao.queryForMap(sql.toString(), new SqlParameter("busId",busId)); |
| | |
| | | List<Map> itemYjList = baseDao.queryForList(sqlYj.toString(),param); |
| | | List<Map> itemList = baseDao.queryForList(sqlEj.toString(),param); |
| | | List<Map> evaList = baseDao.queryForList(sqlEva.toString(),param); |
| | | |
| | | |
| | | StringBuffer sqlitem = new StringBuffer("SELECT B.* FROM ORDER_SATIS_INFO A,SATIS_INFO_DETAIL B"); |
| | | sqlitem.append(" WHERE B.BUSINESS_ID = A.ID AND A.BUSINESS_ID = :business_id "); |
| | | Map paramitem = new HashMap(); |
| | |
| | | item.put("EVALUATION", evaluList); |
| | | } |
| | | for(Map items:itemList){ |
| | | |
| | | |
| | | List<Map> evaluation = (List)items.get("EVALUATION"); |
| | | for(Map it:itList){ |
| | | if(it.get("CONFIGID").equals(items.get("ID"))){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | if(itemYjList.size()>0){ |
| | | |
| | | |
| | | for(Map temp:itemYjList){ |
| | | List<Map> itemEjList = new ArrayList(); |
| | | for(Map item:itemList){ |
| | |
| | | cardMap.put("count",itemYjList.size()+itemList.size()); |
| | | return cardMap; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getImageMsg(String busId) { |
| | | String sql = "SELECT ID FROM ORDER_SATIS_INFO WHERE BUSINESS_ID = :business_id "; |
| | |
| | | String path=""; |
| | | if(fileList.size() > 0){ |
| | | path = ConvertUtil.obj2Str(fileList.get(0).get("FILE_PATH")); |
| | | |
| | | |
| | | } |
| | | return path; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int checkMonth(HttpServletRequest request) { |
| | | String userid = WebUtil.getLoginedUserId(request); |
| | |
| | | |
| | | @Override |
| | | public int queryZcsatisCount(Map<String, String> params) { |
| | | |
| | | |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append("SELECT COUNT(F.ZC_ID) FROM ( "); |
| | | |
| | | |
| | | sql = getZcsql(sql,params); |
| | | |
| | | |
| | | sql.append(")F "); |
| | | |
| | | |
| | | return baseDao.queryForInteger(sql.toString(), params); |
| | | } |
| | | |
| | |
| | | public PageInfo queryZcsatisData(PageInfo pageInfo, |
| | | Map<String, String> params) { |
| | | StringBuilder sql = new StringBuilder(); |
| | | |
| | | |
| | | |
| | | |
| | | sql = getZcsql(sql,params); |
| | | |
| | | |
| | | |
| | | |
| | | return baseDao.queryforSplitPageInfo(pageInfo,sql.toString(),params); |
| | | } |
| | | |
| | | |
| | | public StringBuilder getZcsql(StringBuilder sql,Map<String, String> params){ |
| | | |
| | | |
| | | sql.append("SELECT E.ID,E.CARD_MONTH,E.SCORE,E.STATE ,E.SUBMIT_TIME,E.CREATE_TIME,D.USER_ID AS ZC_ID,D.ALLUSER,D.SUB_CUSTOMER_ID,D.SUB_CUSTOMER_NAME,D.CUSTOMER_ID,D.CUSTOMER_NAME FROM ((SELECT A.USER_ID ,A.USER_NAME AS ALLUSER,A.CUSTOMER_ID AS SUB_CUSTOMER_ID,B.CUSTOMER_NAME AS SUB_CUSTOMER_NAME ,B.CUSTOMER_ID,C.CUSTOMER_NAME FROM SC_CUSTOMER_ZC_UESR A , SC_PARTNER_CUSTOMER_SUB B ,SC_PARTNER_CUSTOMER_INFO C WHERE A.CUSTOMER_ID = B.ID AND B.CUSTOMER_ID = C.ID ) "); |
| | | sql.append(" UNION ALL "); |
| | | sql.append(" (SELECT A.USER_ID ,A.USER_NAME AS ALLUSER,A.CUSTOMER_ID AS SUB_CUSTOMER_ID,C.CUSTOMER_NAME AS SUB_CUSTOMER_NAME ,C.ID AS CUSTOMER_ID,C.CUSTOMER_NAME FROM SC_CUSTOMER_ZC_UESR A , SC_PARTNER_CUSTOMER_INFO C WHERE A.CUSTOMER_ID = C.ID ) ) D "); |
| | | |
| | | |
| | | sql.append(" LEFT JOIN AUDITING_SATIS_INFO E ON E.USER_ID = D.USER_ID WHERE 1 = 1 "); |
| | | String ismy = params.get("ismy"); |
| | | |
| | | |
| | | if("1".equals(ismy)){ |
| | | sql.append(" AND D.USER_ID = :userId "); |
| | | } |
| | | |
| | | |
| | | String customer_id = params.get("customer_id"); |
| | | |
| | | |
| | | if(StringUtil.notEmpty(customer_id)) { |
| | | sql.append(" AND D.CUSTOMER_ID = :customer_id "); |
| | | } |
| | | |
| | | |
| | | String sub_customer_id = params.get("sub_customer_id"); |
| | | if(StringUtil.notEmpty(sub_customer_id)) { |
| | | sql.append(" AND D.SUB_CUSTOMER_ID = :sub_customer_id "); |
| | | } |
| | | |
| | | |
| | | String beginMonth = params.get("begin_month"); |
| | | String endMonth = params.get("end_month"); |
| | | |
| | | |
| | | if(StringUtil.notEmpty(beginMonth)) { |
| | | sql.append(" AND E.CARD_MONTH >= :begin_month "); |
| | | } |
| | | |
| | | |
| | | if(StringUtil.notEmpty(endMonth)) { |
| | | sql.append(" AND E.CARD_MONTH <= :end_month "); |
| | | } |
| | | |
| | | |
| | | String spstate = params.get("spstate"); |
| | | if(StringUtil.notEmpty(spstate)) { |
| | | sql.append(" AND E.STATE = :spstate "); |
| | | |
| | | |
| | | } |
| | | sql.append( " ORDER BY E.CARD_MONTH DESC,E.SUBMIT_TIME DESC "); |
| | | return sql; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveZcSatisResult(HttpServletRequest request) { |
| | | String id = request.getParameter("busId"); |
| | |
| | | String customer_id = request.getParameter("customer_id"); |
| | | String customer_name = request.getParameter("customer_name"); |
| | | String upload_time = request.getParameter("uploadtime").replace("-", ""); |
| | | |
| | | |
| | | Map userMap = WebUtil.getLoginUser(request).getLoginUser(); |
| | | |
| | | |
| | | AUDITING_SATIS_INFO satis = new AUDITING_SATIS_INFO(); |
| | | if(StringUtil.isEmpty(id)){ |
| | | satis.setCustomer_id(customer_id) |
| | | .setCustomer_name(customer_name); |
| | | .setCustomer_name(customer_name); |
| | | satis.setTemplate_id(template_id) |
| | | .setSub_customer_id(sub_customer_id).setSub_customer_name(sub_customer_name) |
| | | .setCreate_time(DateUtil.getCurrentDate14()) |
| | |
| | | satis.setScore(scoreNum).insertOrUpdate(); |
| | | fileService.uploadFile(request, satis.getId(),null,null); |
| | | baseDao.execute("DELETE FROM SATIS_INFO_DETAIL WHERE BUSINESS_ID = :BUSINESS_ID ", new SqlParameter("BUSINESS_ID",satis.getId())); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | List<SqlParameter> paramList = new ArrayList<SqlParameter>(); |
| | | for(int j=0;j<item_ids.length;j++){ |
| | | String score[] = scores[j].split("&"); |
| | | SqlParameter param = new SqlParameter(); |
| | |
| | | } |
| | | String sqldetail = "INSERT INTO SATIS_INFO_DETAIL(ID,CONFIGID,CONFIGNAME,RESULTID,RESULTNAME,RESULTSCORE,BUSINESS_ID) VALUES(:ID,:CONFIGID,:CONFIGNAME,:RESULTID,:RESULTNAME,:RESULTSCORE,:BUSINESS_ID)"; |
| | | baseDao.executeBatch(sqldetail, paramList); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map getZcReportDetail(String busId) { |
| | | StringBuffer sql = new StringBuffer("SELECT * FROM AUDITING_SATIS_INFO WHERE ID = :busId "); |
| | |
| | | List<Map> itemYjList = baseDao.queryForList(sqlYj.toString(),param); |
| | | List<Map> itemList = baseDao.queryForList(sqlEj.toString(),param); |
| | | List<Map> evaList = baseDao.queryForList(sqlEva.toString(),param); |
| | | |
| | | |
| | | StringBuffer sqlitem = new StringBuffer("SELECT B.* FROM AUDITING_SATIS_INFO A,SATIS_INFO_DETAIL B"); |
| | | sqlitem.append(" WHERE B.BUSINESS_ID = A.ID AND A.ID = :business_id "); |
| | | Map paramitem = new HashMap(); |
| | |
| | | item.put("EVALUATION", evaluList); |
| | | } |
| | | for(Map items:itemList){ |
| | | |
| | | |
| | | List<Map> evaluation = (List)items.get("EVALUATION"); |
| | | for(Map it:itList){ |
| | | if(it.get("CONFIGID").equals(items.get("ID"))){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | if(itemYjList.size()>0){ |
| | | |
| | | |
| | | for(Map temp:itemYjList){ |
| | | List<Map> itemEjList = new ArrayList(); |
| | | for(Map item:itemList){ |
| | |
| | | cardMap.put("count",itemYjList.size()+itemList.size()); |
| | | return cardMap; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveZcSatisShenpi(HttpServletRequest request) { |
| | | Map userMap = WebUtil.getLoginUser(request).getLoginUser(); |
| | |
| | | } |
| | | info.update(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveZcSatisDiaocha(HttpServletRequest request) { |
| | | Map userMap = WebUtil.getLoginUser(request).getLoginUser(); |
| | |
| | | AUDITING_SATIS_INFO info = new AUDITING_SATIS_INFO(id); |
| | | info.setInvest_user_id(ConvertUtil.obj2StrBlank(userMap.get("ID"))).setInvest_user_name(ConvertUtil.obj2StrBlank(userMap.get("ZSXM"))) |
| | | .setInvest_time(ConvertUtil.obj2Long(invest_time)).setSatis_note(satis_note).setState(Constants.AUDITING_SATIS_INFO_STATE_YDC).update(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map getMonthSatisReport(Map<String,String> params) { |
| | | String cusId = params.get("customer_id"); |
| | | if(!StringUtil.notEmpty(cusId)) { |
| | | return new HashMap(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | String beginMonth = params.get("begin_month"); |
| | | String endMonth = params.get("end_month"); |
| | | if(!StringUtil.notEmpty(beginMonth)) { |
| | | beginMonth = DateUtil.getCurrentDate6().toString(); |
| | | } |
| | | |
| | | |
| | | if(!StringUtil.notEmpty(endMonth)) { |
| | | endMonth = DateUtil.getCurrentDate6().toString(); |
| | | } |
| | |
| | | if(!StringUtil.isEmpty(ConvertUtil.obj2StrBlank(map.get("ALL_SCORE")))){ |
| | | map.put("ALL_SCORE", NumberUtil.toDecimal2(ConvertUtil.obj2Double(map.get("ALL_SCORE")))); |
| | | } |
| | | |
| | | |
| | | StringBuffer detailsql = new StringBuffer("SELECT A.CUSTOMER_ID,B.SATIS_TYPE,SUM(B.ALL_COUNT) AS ALL_COUNT,SUM(SATIS_COUNT) AS SATIS_COUNT,AVG(FG_RATE) AS FG_RATE,AVG(REQUEST_FG_RATE) AS REQUEST_FG_RATE,AVG(SATIS_SCORE) AS SATIS_SCORE,AVG(REQUEST_SATIS_SCORE) AS REQUEST_SATIS_SCORE,AVG(SATIS_QZ) AS SATIS_QZ FROM TOTLE_SATIS_INFO A,TOTLE_SATIS_DETAIL B WHERE A.ID = B.BUS_ID AND A.CUSTOMER_ID = :cusId AND A.MONTH BETWEEN :beginMonth AND :endMonth "); |
| | | detailsql.append(" GROUP BY A.CUSTOMER_ID,B.SATIS_TYPE ORDER BY B.SATIS_TYPE "); |
| | | List<Map> list = baseDao.queryForList(detailsql.toString(), param); |
| | |
| | | } |
| | | } |
| | | map.put("detail", list); |
| | | return map; |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getTotalMonthSatisReport(Map<String,String> params) { |
| | | String beginMonth = params.get("begin_month"); |
| | |
| | | if(!StringUtil.notEmpty(beginMonth)) { |
| | | beginMonth = DateUtil.getCurrentDate6().toString(); |
| | | } |
| | | |
| | | |
| | | if(!StringUtil.notEmpty(endMonth)) { |
| | | endMonth = DateUtil.getCurrentDate6().toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | StringBuffer sql = new StringBuffer("SELECT A.CUSTOMER_ID,AVG(A.ALL_SCORE) AS ALL_SCORE,C.CUSTOMER_NAME FROM TOTLE_SATIS_INFO A,SC_PARTNER_CUSTOMER_INFO C WHERE A.CUSTOMER_ID = C.ID AND A.MONTH BETWEEN :beginMonth AND :endMonth "); |
| | | StringBuffer detailsql = new StringBuffer("SELECT A.CUSTOMER_ID,B.SATIS_TYPE,AVG(B.ALL_COUNT) AS DCZS,AVG(B.SATIS_COUNT) AS SJDCZS,AVG(B.FG_RATE) AS FGL,AVG(B.REQUEST_FG_RATE) YQFGL,AVG(SATIS_SCORE) AS DF,AVG(REQUEST_SATIS_SCORE) AS YQDF FROM TOTLE_SATIS_INFO A,TOTLE_SATIS_DETAIL B WHERE A.ID = B.BUS_ID AND A.MONTH BETWEEN :beginMonth AND :endMonth "); |
| | | |
| | | |
| | | Map paramMap = new HashMap(); |
| | | |
| | | |
| | | |
| | | |
| | | String customerid = params.get("customerId"); |
| | | if(StringUtil.notEmpty(customerid)) { |
| | | sql.append(" AND A.CUSTOMER_ID = :customerId "); |
| | |
| | | } |
| | | paramMap.put("beginMonth", beginMonth); |
| | | paramMap.put("endMonth", endMonth); |
| | | |
| | | |
| | | sql.append(" GROUP BY A.CUSTOMER_ID ,C.CUSTOMER_NAME "); |
| | | |
| | | |
| | | List<Map> proList = baseDao.queryForList(sql.toString(),paramMap); |
| | | |
| | | |
| | | |
| | | |
| | | detailsql.append(" GROUP BY A.CUSTOMER_ID,B.SATIS_TYPE ORDER BY B.SATIS_TYPE "); |
| | | List<Map> detaillist = baseDao.queryForList(detailsql.toString(), paramMap); |
| | | |
| | | |
| | | |
| | | |
| | | if(null!=proList && proList.size()>0) { |
| | | |
| | | |
| | | Map cacheMap = new HashMap(); |
| | | if(null != detaillist && detaillist.size()>0) { |
| | | for(Map m : detaillist) { |
| | |
| | | cacheMap.put(unitKey, m); |
| | | } |
| | | } |
| | | |
| | | |
| | | for(Map totalMap : proList) { |
| | | String cusId = ConvertUtil.obj2StrBlank(totalMap.get("CUSTOMER_ID")); |
| | | totalMap.put("ALL_SCORE", NumberUtil.toDecimal2(ConvertUtil.obj2Double(totalMap.get("ALL_SCORE")))); |
| | |
| | | Map xym = (Map)cacheMap.get(xyKey); |
| | | double xydf = ConvertUtil.obj2Double(xym.get("DF")); |
| | | totalMap.put("XYSCORE", NumberUtil.toDecimal2(xydf)); |
| | | |
| | | |
| | | //求出项目响应支持类得分 |
| | | String xyzcKey = cusId+Constants.CUSTOMER_SATIS_TEMPLATE_TEMPLATE_TYPE_SIX; |
| | | Map xyzcm = (Map)cacheMap.get(xyzcKey); |
| | |
| | | zcfwdf=ConvertUtil.obj2Double(zcfwm.get("DF")); |
| | | } |
| | | totalMap.put("ZCSCORE", NumberUtil.toDecimal2(zcfwdf)); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | return proList; |
| | | } |
| | | |
| | | @Override |
| | | public Map getCurMonthSatisSurvey(Map<String, String> params) { |
| | | Map resMap = new HashMap(); |
| | | Map resMap = new HashMap(); |
| | | String cusId = params.get("cusId"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | params.put("month", DateUtil.getCurrentDate6().toString()); |
| | | |
| | | |
| | | builder.append(" SELECT D.SATIS_TYPE,D.ALL_COUNT,D.SATIS_COUNT,D.FG_RATE,D.SATIS_SCORE "); |
| | | builder.append(" FROM TOTLE_SATIS_INFO I,TOTLE_SATIS_DETAIL D "); |
| | | builder.append(" where I.ID = D.BUS_ID and I.MONTH = :month and I.CUSTOMER_ID = :cusId " + |
| | |
| | | public Map getLastYearSatisfactionMix(Map<String, String> params) { |
| | | Long endMonth = DateUtil.getCurrentDate6(); |
| | | Long startMonth = DateUtil.getDateAdd6FromMonth(endMonth, -12); |
| | | |
| | | |
| | | Map chartMap = new HashMap(); |
| | | String cusId = params.get("cusId"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" SELECT I.ALL_SCORE,D.SATIS_SCORE,D.SATIS_TYPE,I.MONTH FROM TOTLE_SATIS_DETAIL D ,TOTLE_SATIS_INFO I "); |
| | | builder.append(" WHERE D.BUS_ID = I.ID AND I.CUSTOMER_ID = :cusId GROUP BY D.SATIS_TYPE,I.MONTH,I.ALL_SCORE,D.SATIS_SCORE ORDER BY SATIS_TYPE,MONTH"); |
| | | List<Map> queryList = baseDao.queryForList(builder.toString(), params); |
| | | builder.setLength(0); |
| | | builder.setLength(0); |
| | | Map<String,Object> queryMap = new HashMap<String,Object>(); |
| | | |
| | | |
| | | if(queryList!=null&&queryList.size()>0){ |
| | | for(Map map:queryList){ |
| | | String key = map.get("SATIS_TYPE").toString()+"_"+map.get("MONTH").toString(); |
| | |
| | | typeList.add("1"); |
| | | typeList.add("3"); |
| | | typeList.add("6"); |
| | | |
| | | |
| | | Map tempWholeMap = new HashMap(); |
| | | List tempWholeList = new ArrayList(); |
| | | tempWholeMap.put("name", "整体得分"); |
| | |
| | | if(type.equals("1")){ |
| | | categories_format.add(DateUtil.format("yyyy-MM", cate)); |
| | | } |
| | | |
| | | |
| | | String key = type + "_" + cate; |
| | | if(queryMap.get(key)!=null){ |
| | | tempList.add(((Map)queryMap.get(key)).get("SATIS_SCORE")); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | tempMap.put("data", tempList); |
| | | tempMap.put("type", "column"); |
| | | series.add(tempMap); |
| | |
| | | public Map getLastYearSatisfactionCoverage(Map<String, String> params) { |
| | | Long endMonth = DateUtil.getCurrentDate6(); |
| | | Long startMonth = DateUtil.getDateAdd6FromMonth(endMonth, -12); |
| | | |
| | | |
| | | Map chartMap = new HashMap(); |
| | | String cusId = params.get("cusId"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" SELECT D.FG_RATE,D.SATIS_TYPE,I.MONTH FROM TOTLE_SATIS_DETAIL D ,TOTLE_SATIS_INFO I "); |
| | | builder.append(" WHERE D.BUS_ID = I.ID AND I.CUSTOMER_ID = :cusId GROUP BY D.SATIS_TYPE,I.MONTH,D.FG_RATE,D.SATIS_TYPE ORDER BY SATIS_TYPE,MONTH"); |
| | | List<Map> queryList = baseDao.queryForList(builder.toString(), params); |
| | | builder.setLength(0); |
| | | builder.setLength(0); |
| | | Map<String,Object> queryMap = new HashMap<String,Object>(); |
| | | |
| | | |
| | | if(queryList!=null&&queryList.size()>0){ |
| | | for(Map map:queryList){ |
| | | String key = map.get("SATIS_TYPE").toString()+"_"+map.get("MONTH").toString(); |
| | |
| | | typeList.add("1"); |
| | | typeList.add("3"); |
| | | typeList.add("6"); |
| | | |
| | | |
| | | //组装数据 |
| | | for(String type:typeList){ |
| | | Map tempMap = new HashMap(); |
| | |
| | | tempList.add(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | tempMap.put("data", tempList); |
| | | series.add(tempMap); |
| | | chartMap.put("series", series); |