Commit 3a5f3781 by wangling

20190325---wangling---解决分页显示All时整体处理的bug

parent e462c136
package com.cc.bean; package com.cc.bean;
import java.util.List;
public class Sjsb { public class Sjsb {
private String tblname; private String tblname;
private String keyname; private String keyname;
private List<String> xxzjbhs; private String xxzjbhs;
public String getTblname() { public String getTblname() {
return tblname; return tblname;
...@@ -20,10 +19,10 @@ public class Sjsb { ...@@ -20,10 +19,10 @@ public class Sjsb {
public void setKeyname(String keyname) { public void setKeyname(String keyname) {
this.keyname = keyname; this.keyname = keyname;
} }
public List<String> getXxzjbhs() { public String getXxzjbhs() {
return xxzjbhs; return xxzjbhs;
} }
public void setXxzjbhs(List<String> xxzjbhs) { public void setXxzjbhs(String xxzjbhs) {
this.xxzjbhs = xxzjbhs; this.xxzjbhs = xxzjbhs;
} }
......
...@@ -2,13 +2,10 @@ package com.cc.controller; ...@@ -2,13 +2,10 @@ package com.cc.controller;
import com.cc.bean.Sjsb; import com.cc.bean.Sjsb;
import com.cc.bean.Sjsblog; import com.cc.bean.Sjsblog;
import com.cc.common.ResultMap;
import com.cc.service.SjjhService; import com.cc.service.SjjhService;
import com.cc.service.UserXzxtDmeoService; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -77,7 +74,7 @@ public class SjjhtjController { ...@@ -77,7 +74,7 @@ public class SjjhtjController {
sjlog.setXxzjbh(xxzjbh); sjlog.setXxzjbh(xxzjbh);
Sjsblog sjsblog = sjjhService.getSjsbxq(sjlog); Sjsblog sjsblog = sjjhService.getSjsbxq(sjlog);
if (map.containsKey(sjsblog.getTblname())) { if (map.containsKey(sjsblog.getTblname())) {
zjList.add(sjsblog.getKeyvalue()); map.get(sjsblog.getTblname()).add(sjsblog.getKeyvalue());
} else { } else {
zjList = new ArrayList<String>(); zjList = new ArrayList<String>();
zjList.add(sjsblog.getKeyvalue()); zjList.add(sjsblog.getKeyvalue());
...@@ -89,11 +86,37 @@ public class SjjhtjController { ...@@ -89,11 +86,37 @@ public class SjjhtjController {
while (entries.hasNext()) { while (entries.hasNext()) {
Map.Entry<String, List<String>> entry = entries.next(); Map.Entry<String, List<String>> entry = entries.next();
String keyName = sjjhService.getKeyname(entry.getKey().trim()); String keyName = sjjhService.getKeyname(entry.getKey().trim());
String xxzjbhsString = "";
if (!"".equals(keyName)) { if (!"".equals(keyName)) {
sjsb = new Sjsb(); sjsb = new Sjsb();
sjsb.setTblname(entry.getKey()); sjsb.setTblname(entry.getKey());
sjsb.setKeyname(keyName); sjsb.setKeyname(keyName);
sjsb.setXxzjbhs(entry.getValue());
//根据传入的List,拼接in条件,防止in超过999条
List<String> setList = new ArrayList<String>(0);
Set set = new HashSet();
StringBuffer stringBuffer = new StringBuffer();
for (int i = 1; i <= entry.getValue().size(); i++) {
set.add("'" + entry.getValue().get(i - 1) + "'");
if (i % 900 == 0) {//900为阈值
setList.add(StringUtils.join(set.iterator(), ","));
set.clear();
}
}
if (!set.isEmpty()) {
setList.add(StringUtils.join(set.iterator(), ","));
}
stringBuffer.append(setList.get(0));
for (int j = 1; j < setList.size(); j++) {
stringBuffer.append(") or ");
stringBuffer.append(keyName);
stringBuffer.append(" in (");
stringBuffer.append(setList.get(j));
}
xxzjbhsString = stringBuffer.toString();
sjsb.setXxzjbhs(xxzjbhsString);
sjsbs.add(sjsb); sjsbs.add(sjsb);
bool = sjjhService.updateSbsj(sjsb); bool = sjjhService.updateSbsj(sjsb);
if(bool) succNum ++; if(bool) succNum ++;
......
package com.cc.controller; package com.cc.controller;
import com.cc.bean.Sjsbyzlog; import com.cc.bean.Sjsbyzlog;
import com.cc.service.SjjhService; import com.cc.service.SjjhService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -40,11 +41,31 @@ public class SjjhyzController { ...@@ -40,11 +41,31 @@ public class SjjhyzController {
boolean bool = false; boolean bool = false;
String updateflag = ""; String updateflag = "";
String[] sjbbhArr = sjbbhList.split(","); String[] sjbbhArr = sjbbhList.split(",");
String sjjbhString = "'"; String sjjbhString = "";
for (String sjbbh : sjbbhArr) {
sjjbhString += sjbbh + "','"; List<String> sjjbhList = Arrays.asList(sjbbhArr);
//根据传入的List,拼接in条件,防止in超过999条
List<String> setList = new ArrayList<String>(0);
Set set = new HashSet();
StringBuffer stringBuffer = new StringBuffer();
for (int i = 1; i <= sjjbhList.size(); i++) {
set.add("'" + sjjbhList.get(i - 1) + "'");
if (i % 900 == 0) {//900为阈值
setList.add(StringUtils.join(set.iterator(), ","));
set.clear();
}
}
if (!set.isEmpty()) {
setList.add(StringUtils.join(set.iterator(), ","));
}
stringBuffer.append(setList.get(0));
for (int j = 1; j < setList.size(); j++) {
stringBuffer.append(") or sjbbh in (");
stringBuffer.append(setList.get(j));
} }
sjjbhString = sjjbhString.substring(0, sjjbhString.length()-2);
sjjbhString = stringBuffer.toString();
Sjsbyzlog sjsbyzlog = new Sjsbyzlog(); Sjsbyzlog sjsbyzlog = new Sjsbyzlog();
sjsbyzlog.setSjbbh(sjjbhString); sjsbyzlog.setSjbbh(sjjbhString);
bool = sjjhService.deleteFailsj(sjsbyzlog); bool = sjjhService.deleteFailsj(sjsbyzlog);
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</update> </update>
<!-- 根据信息主键编号查询数据上报详情 --> <!-- 根据信息主键编号查询数据上报详情 -->
<select id="querySjsbxq" parameterType="com.cc.bean.Sjsblog" resultType="com.cc.bean.Sjsblog"> <select id="querySjsbxq" parameterType="com.cc.bean.Sjsblog" resultType="com.cc.bean.Sjsblog">
select (CASE WHEN fwzt=0 THEN '正在上报' WHEN fwzt=1 THEN '验证不通过' WHEN fwzt=19999 THEN '上报失败' WHEN fwzt=10101 THEN '上报成功' END )as fwzt, select (CASE WHEN fwzt=0 THEN '正在上报' WHEN fwzt=1 THEN '验证不通过' WHEN fwzt=2 THEN '未上报' WHEN fwzt=19999 THEN '上报失败' WHEN fwzt=10201 THEN '文档不合法' WHEN fwzt=10101 THEN '上报成功' END )as fwzt,
(CASE WHEN scbz=0 THEN '未删除' WHEN scbz=1 THEN '已删除' END )as scbz, (CASE WHEN scbz=0 THEN '未删除' WHEN scbz=1 THEN '已删除' END )as scbz,
(CASE WHEN bdzt=0 THEN '通过' WHEN bdzt=1 THEN '不通过' END )as bdzt, (CASE WHEN bdzt=0 THEN '通过' WHEN bdzt=1 THEN '不通过' END )as bdzt,
xxzjbh,ywxxdm,tblname,keyvalue,sbztdesc,lrsj,gxsj,fhsj xxzjbh,ywxxdm,tblname,keyvalue,sbztdesc,lrsj,gxsj,fhsj
...@@ -82,10 +82,7 @@ ...@@ -82,10 +82,7 @@
<update id="updateSbsj" parameterType="com.cc.bean.Sjsb"> <update id="updateSbsj" parameterType="com.cc.bean.Sjsb">
update ${tblname} set gxsj = sysdate where 1=1 update ${tblname} set gxsj = sysdate where 1=1
<if test="keyname!=null and keyname!=''"> <!-- ids是map的一个key --> <if test="keyname!=null and keyname!=''"> <!-- ids是map的一个key -->
and ${keyname} in and ${keyname} in ($xxzjbhs)
<foreach item="xxzjbhs" index="index" collection="xxzjbhs" open="(" separator="," close=")">
#{xxzjbhs}
</foreach>
</if> </if>
</update> </update>
<!-- 新增 --> <!-- 新增 -->
......
...@@ -76,10 +76,14 @@ ...@@ -76,10 +76,14 @@
<td>${sjsblog.fwzt}</td> <td>${sjsblog.fwzt}</td>
</tr> </tr>
<tr> <tr>
<td class="ar">更新时间:</td> <td class="ar">上报时间:</td>
<td> <td>${sjsblog.lrsj}</td>
<fmt:formatDate value="${sjsblog.gxsj}" pattern="yyyy-MM-dd HH:mm:ss"/> <td class="ar">再次上报时间:</td>
</td> <td>${sjsblog.gxsj}</td>
</tr>
<tr>
<td class="ar">回执时间:</td>
<td>${sjsblog.fhsj}</td>
<td class="ar">比对状态:</td> <td class="ar">比对状态:</td>
<td >${sjsblog.bdzt}</td> <td >${sjsblog.bdzt}</td>
</tr> </tr>
......
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
"processing": true, "processing": true,
"bAutoWidth":true, "bAutoWidth":true,
"columns": columns, "columns": columns,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "aLengthMenu": [[10, 25, 50, 100, 5000, 10000, -1], [10, 25, 50, 100, 5000, 10000, "All"]],
"bLengthChange":true, "bLengthChange":true,
"oLanguage": {//国际语言转化 "oLanguage": {//国际语言转化
"oAria": { "oAria": {
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
function openDialog1(data){ function openDialog1(data){
var keyvalue = data; var keyvalue = data;
tipsWindown("详情","iframe:getSjsbxq.action?xxzjbh="+keyvalue,"1000","450","true","","true","leotheme"); tipsWindown("详情","iframe:getSjsbxq?xxzjbh="+keyvalue,"1000","450","true","","true","leotheme");
} }
......
...@@ -174,8 +174,8 @@ ...@@ -174,8 +174,8 @@
} }
], ],
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], "aLengthMenu": [[10, 25, 50, 100, 5000, 10000, -1], [10, 25, 50, 100, 5000, 10000, "All"]],
"bLengthChange":true, "bLengthChange":true,
"oLanguage": {//国际语言转化 "oLanguage": {//国际语言转化
"oAria": { "oAria": {
"sSortAscending": " - click/return to sort ascending", "sSortAscending": " - click/return to sort ascending",
......
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