Commit 48fb5e64 by YANGYANG

Merge remote-tracking branch 'origin/master'

parents 903c3dce ea5eb692
package com.cc.controller;
import com.cc.model.Record;
import com.cc.service.IRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
public class RecordController {
@Autowired
IRecordService recordService;
private static final Logger logger = LoggerFactory.getLogger(RecordController.class);
@RequestMapping(value = "/queryRybhRecord", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public Record queryRybhRecord(HttpServletRequest request) {
Record record = recordService.queryRybhRecord();
return record;
}
}
......@@ -4,10 +4,10 @@ import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import com.cc.model.AsjRyRelateVO;
import com.cc.model.Record;
import com.cc.model.User;
import com.cc.service.IAsjxxService;
import com.cc.service.LoginService;
import com.cc.service.SolrService;
import com.cc.service.IRecordService;
import com.cc.utils.CodeUtils;
import com.cc.utils.CommonFunc;
import com.cc.utils.EasyUIPage;
......@@ -44,6 +44,8 @@ public class SolrController {
@Autowired
SolrService solrService;
@Autowired
IRecordService recordService;
/**
* solrList查询
*
......@@ -5190,7 +5192,7 @@ public class SolrController {
*/
@RequestMapping("/listTbStBhr")
@ResponseBody
public EasyUIPage listTbStBhr(HttpServletRequest request, AsjRyRelateVO asjRyRelateVO, String unitcode, String groupids,String sort,String order,String sorlInstance,String daohan,String groupidvalue){
public EasyUIPage listTbStBhr(HttpServletRequest request, AsjRyRelateVO asjRyRelateVO, String unitcode, String groupids,String sort,String order,String sorlInstance,String daohan,String selectedCols,String groupidvalue){
Properties properties=propertiesUtil("solr.properties");
String sorlAddress =properties.getProperty("sorlAddress");
Properties configProperties=propertiesUtil("config.properties");
......@@ -5201,6 +5203,18 @@ public class SolrController {
Map<String,Object> map = getBhrFqList(asjRyRelateVO);
List<String> fqList = (List<String>)map.get("fqList");
//Sorl查询
Record record = new Record();
record.setRybh_record(selectedCols);
String [] cols = selectedCols.split(",");
Object [] head = new String[cols.length];
String [] names = new String[cols.length];
for(int i=0;i<cols.length;i++){
String col = cols[i];
String [] arr = col.split(":");
head[i] = arr[0];
names[i] = arr[1];
}
recordService.updateRecord(record);
String page = request.getParameter("page");
String rows = request.getParameter("rows");
System.out.println(page+"----------"+rows);
......
package com.cc.dao;
import com.cc.model.Record;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
@Mapper
public interface RecordDao {
public Record queryRybhRecord();
public Boolean updateRecord(Record record);
}
/*File: Role.java
* date 2013-10-9
*/
package com.cc.model;
import java.util.List;
public class Record {
private String rybh_record;
private String xyr_record;
private String aj_record;
private String gxsj;
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getGxsj() {
return gxsj;
}
public void setGxsj(String gxsj) {
this.gxsj = gxsj;
}
public String getRybh_record() {
return rybh_record;
}
public void setRybh_record(String rybh_record) {
this.rybh_record = rybh_record;
}
public String getXyr_record() {
return xyr_record;
}
public void setXyr_record(String xyr_record) {
this.xyr_record = xyr_record;
}
public String getAj_record() {
return aj_record;
}
public void setAj_record(String aj_record) {
this.aj_record = aj_record;
}
}
package com.cc.service;
import com.cc.model.Record;
import java.util.Map;
public interface IRecordService {
public Record queryRybhRecord();
public Boolean updateRecord(Record record);
}
package com.cc.service.impl;
import com.cc.service.IRecordService;
import com.cc.dao.RecordDao;
import com.cc.model.Record;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("recordService")
public class RecordServiceImpl implements IRecordService {
@Autowired
RecordDao recordDao;
@Override
public Record queryRybhRecord() {
Record record = null;
record = recordDao.queryRybhRecord();
String [] cols = record.getRybh_record().split(",");
Object [] head = new String[cols.length];
String [] names = new String[cols.length];
for(int i=0;i<cols.length;i++){
String col = cols[i];
String [] arr = col.split(":");
head[i] = arr[0];
names[i] = arr[1];
}
return record;
}
@Override
public Boolean updateRecord(Record record) {
boolean bool = false;
try{
recordDao.updateRecord(record);
bool = true;
}catch(Exception e){
bool = false;
e.printStackTrace();
}
return bool;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cc.dao.RecordDao">
<resultMap id="record" type="com.cc.model.Record">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="rybh_record" jdbcType="VARCHAR" property="rybh_record" />
<result column="xyr_record" jdbcType="VARCHAR" property="xyr_record" />
<result column="aj_record" jdbcType="VARCHAR" property="aj_record" />
<result column="gxsj" jdbcType="VARCHAR" property="gxsj" />
</resultMap>
<!--查询被害人的记录-->
<select id="queryRybhRecord" resultMap="record">
SELECT * FROM TB_RECORD WHERE ROWNUM=1 ORDER BY GXSJ DESC
</select>
<update id="updateRecord" parameterType="com.cc.model.Record">
update TB_RECORD
<set>
<if test="rybh_record != null">
rybh_record = #{rybh_record,jdbcType=INTEGER},
</if>
<if test="xyr_record != null">
xyr_record = #{xyr_record,jdbcType=VARCHAR},
</if>
<if test="aj_record != null">
aj_record = #{aj_record,jdbcType=CHAR},
</if>
GXSJ =SYSDATE
</set>
WHERE ROWNUM=1
</update>
</mapper>
\ No newline at end of file
......@@ -1884,12 +1884,38 @@
list_config=ajwaitingConfig['checkList'][0];
}
$('#selected_ul,#waiting_ul').empty();
$.ajax({
url: 'queryRybhRecord',
async:false,
type: 'post',
dataType: 'json',
success: function (data) {
var cols = [];
cols = data.rybh_record.split(",");
console.log(cols);
for(var i=0;i<cols.length;i++){
var col = cols[i];
var arr = [];
arr = col.split(":");
var head = [];
var names = [];
head[i] = arr[0];
names[i] = arr[1];
console.log(head[i])
console.log(names[i])
var html_li = '<li><div rel="'+names[i]+'" name="'+head[i]+'">'+head[i]+'</div></li>';
$('#selected_ul').append(html_li);
}
}
});
//加载显示的表头数据
for(var i in table_header_info){
/* for(var i in table_header_info){
var rel_val = table_header_info[i];
console.log(rel_val)
var html_li = '<li><div rel="'+rel_val[0]+'" name="'+rel_val[1]+'">'+rel_val[1]+'</div></li>';
$('#selected_ul').append(html_li);
}
}*/
//加载未显示的表格数据
for(var k in list_config){
var is_exist = $.inArray(k, table_header_info);
......@@ -2162,15 +2188,11 @@
var selected_ul = $('#selected_ul li').find('div');
if(selected_ul.length>0){
selected_ul.each(function(index){
alert(index);
if(index==selected_ul.length-1){
selectedCols +=$(this).attr('name')+":"+$(this).attr('rel');
alert("1"+selectedCols);
}else{
selectedCols +=$(this).attr('name')+":"+$(this).attr('rel')+",";
alert("2"+selectedCols);
}
//alert(selectedCols);
});
var index = layer.load(1, {
shade: [0.1,'#fff'] //0.1透明度的白色背景
......
......@@ -229,6 +229,15 @@ var navCategory = {
getTableSetDom();
}
var selected_ul = $('#selected_ul li').find('div');
var selectedCols="";
selected_ul.each(function(index){
if(index==selected_ul.length-1){
selectedCols +=$(this).attr('name')+":"+$(this).attr('rel');
}else{
selectedCols +=$(this).attr('name')+":"+$(this).attr('rel')+",";
}
});
searchTerm.selectedCols = selectedCols;
if(selected_ul.length>0) {
var s = "[[{title:'操作',field:'cz',align:'center',width:50,checkbox: true},"
selected_ul.each(function (index){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment