Commit 29f5aadc authored by wuzhilong's avatar wuzhilong

邮寄信息查询:添加打印时间,修改数据状态条件

parent b021ff25
......@@ -29,6 +29,8 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.yxproject.start.utils.YXStringUtils.stripNonDigits;
/**
* 自主选择删除个人邮寄信息
*/
......@@ -119,7 +121,8 @@ public class PersonPostApi {
String endDate = replaceDate(jsonObject.getString("endDate"));
String emailNo = jsonObject.getString("emailNo");
String notNull = jsonObject.getString("notNull");
count = personPostService.findPersonalDataCount(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, startDate,endDate, emailNo, notNull);
String printDate = stripNonDigits(jsonObject.getString("printDate"));
count = personPostService.findPersonalDataCount(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, startDate,endDate, emailNo, notNull,printDate);
} catch (Exception e) {
logger.error("个人邮寄信息:" + jsonObject);
logger.error("Exception 按条件查询个人邮寄信息异常", e);
......@@ -153,7 +156,8 @@ public class PersonPostApi {
String pageSize = jsonObject.getString("pageSize");
String emailNo = jsonObject.getString("emailNo");
int notNull = Integer.parseInt((jsonObject.getString("notNull")));
list = personPostService.findPersonalData(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, startDate, endDate, firstIndex, pageSize, emailNo, notNull);
String printDate = stripNonDigits(jsonObject.getString("printDate"));
list = personPostService.findPersonalData(applicantName, orderNumber, state, latticeMouthInformation, jsonArray, startDate, endDate, firstIndex, pageSize, emailNo, notNull,printDate);
} catch (Exception e) {
logger.error("个人邮寄信息:" + jsonObject);
logger.error("Exception 按条件查询个人邮寄信息异常", e);
......@@ -230,14 +234,14 @@ public class PersonPostApi {
@RequestMapping("download")
public void exportExcel(HttpServletRequest request, HttpServletResponse response,
@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("hasPrinted") String hasPrinted,
@RequestParam("djx") List<String> djx, @RequestParam("gkxx") String gkxx, @RequestParam("ddh") String ddh,
@RequestParam("sequence") String sequence, @RequestParam("sqrxm") String sqrxm, @RequestParam("emailNo") String emailNo) throws Exception {
@RequestParam("djx") List<String> djx, @RequestParam("gkxx") String gkxx, @RequestParam("ddh") String ddh, @RequestParam("notNull") String notNull,
@RequestParam("sequence") String sequence, @RequestParam("sqrxm") String sqrxm, @RequestParam("emailNo") String emailNo,@RequestParam("printDate") String printDate) throws Exception {
String remoteAddr = request.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonArray = new JSONArray();
try {
jsonArray = JSONArray.fromObject(djx);
List<PersonPostEntity> list = personPostService.downLoadReportForm(request, response, sqrxm, ddh, hasPrinted, gkxx, jsonArray, replaceDate(startDate),replaceDate(endDate), emailNo);
List<PersonPostEntity> list = personPostService.downLoadReportForm(request, response, sqrxm, ddh, hasPrinted, gkxx, jsonArray, replaceDate(startDate),replaceDate(endDate), emailNo,stripNonDigits(printDate),notNull);
exportExcel(request, response, list);
} catch (Exception e) {
logger.error("上传时间:" + startDate + endDate + "类型普证-0,邮寄-9:" + hasPrinted + "格口信息:" + gkxx + "订单号:" + ddh + "申请人姓名:" + sqrxm + "运单号码:" + emailNo);
......
......@@ -44,17 +44,19 @@ public interface PersonPostMapper {
" <when test='orderNumber!=\"\"'> and PERSON_POST.ORDER_NUMBER=${orderNumber} </when>" +
" <if test='state== 0 '> and PERSON_POST.print_date is null </if>" +
" <if test='state== 1 '> and PERSON_POST.print_date is not null </if>" +
" <if test='notNull== 1 '> and PERSON_POST.ID_card is not null </if>" +
" <if test='notNull== 0 '> and PERSON_POST.ID_card is null </if>" +
" <if test='notNull== 1 '> and PERSON_POST.state1=1 </if>" +
" <if test='notNull== 0 '> and PERSON_POST.state1=0 </if>" +
" <if test='notNull== 3 '> and PERSON_POST.state1=3 </if>" +
" <when test='latticeMouthInformation!=\"\"'> and PERSON_POST.LATTICE_MOUTH_INFORMATION=${latticeMouthInformation} </when>" +
" <when test='getToCounty!=\"\"'> and PERSON_POST.GET_TO_COUNTY in ( ${getToCounty}) </when>" +
" <when test='startDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8) between ${startDate} and ${endDate} </when>" +
" <when test='printDate!=\"\"'> and to_char(PERSON_POST.print_Date,'yyyyMMdd') = ${printDate} </when>" +
"order by PERSON_POST.id ) " +
"A" +
")" +
"WHERE RN BETWEEN ${pageSize} AND ${firstIndex}" +
"</script>")
public List <PersonPostEntity> findAllPersonalData( @Param("applicantName") String applicantName, @Param("orderNumber") String orderNumber, @Param("state") String state, @Param("latticeMouthInformation") String latticeMouthInformation, @Param("getToCounty") String getToCounty, @Param("startDate") String startDate,@Param("endDate") String endDate, @Param("firstIndex") long firstIndex, @Param("pageSize") long pageSize, @Param("emailNo") String emailNo, @Param("notNull") int notNull );
public List <PersonPostEntity> findAllPersonalData( @Param("applicantName") String applicantName, @Param("orderNumber") String orderNumber, @Param("state") String state, @Param("latticeMouthInformation") String latticeMouthInformation, @Param("getToCounty") String getToCounty, @Param("startDate") String startDate,@Param("endDate") String endDate, @Param("firstIndex") long firstIndex, @Param("pageSize") long pageSize, @Param("emailNo") String emailNo, @Param("notNull") int notNull , @Param("printDate") String printDate);
@Select("select ID,FIRST_WHITE,APPLICANT_NAME,NOTE from person_post where ID=#{id}")
......@@ -74,13 +76,16 @@ public interface PersonPostMapper {
" <when test='orderNumber!=\"\"'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" +
" <when test='state== 0 '> and PERSON_POST.print_date is null </when>" +
" <when test='state== 1 '> and PERSON_POST.print_date is not null </when>" +
" <if test='notNull== 1 '> and PERSON_POST.ID_card is not null </if>" +
" <if test='notNull== 0 '> and PERSON_POST.ID_card is null </if>" +
" <if test='notNull== 1 '> and PERSON_POST.state1=1 </if>" +
" <if test='notNull== 0 '> and PERSON_POST.state1=0 </if>" +
" <if test='notNull== 3 '> and PERSON_POST.state1=3 </if>" +
" <when test='latticeMouthInformation!=\"\"'> and PERSON_POST.LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation} </when>" +
" <when test='getToCounty!=\"\"'> and PERSON_POST.GET_TO_COUNTY in ( ${getToCounty} ) </when>" +
" <when test='startDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8) between #{startDate} and #{endDate} </when>" +
" <when test='printDate!=\"\"'> and to_char(PERSON_POST.print_Date,'yyyyMMdd')=${printDate} </when>" +
" order by PERSON_POST.id " +
"</script>")
public int findPersonalDataCount( @Param("applicantName")String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") String getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate, @Param("emailNo")String emailNo,@Param("notNull")String notNull);
public int findPersonalDataCount( @Param("applicantName")String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") String getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate, @Param("emailNo")String emailNo,@Param("notNull")String notNull,@Param("printDate")String printDate);
......@@ -130,7 +135,10 @@ public interface PersonPostMapper {
" <when test='emailNo!=\"\"'> and PERSON_POST.WAYBILL_NUMBER=TO_NUMBER(#{emailNo}) </when>" +
" <when test='str!=\"\"'> and PERSON_POST.GET_TO_COUNTY in ( ${str} ) </when>" +
" <when test='startDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8) between #{startDate} and #{endDate} </when>" +
" <when test='printDate!=\"\"'> and to_char(PERSON_POST.print_Date,'yyyyMMdd')=${printDate} </when>" +
" <when test='notNull!=\"\"'> and PERSON_POST.state1=${notNull} </when>" +
" order by PERSON_POST.id " +
"</script>")
public List <PersonPostEntity> findAllPersonalDataNoPage( @Param("sqrxm") String sqrxm, @Param("ddh") String ddh, @Param("hasPrinted") String hasPrinted,
@Param("gkxx") String gkxx, @Param("str") String str, @Param("startDate") String startDate,@Param("endDate") String endDate, @Param("emailNo") String emailNo );
@Param("gkxx") String gkxx, @Param("str") String str, @Param("startDate") String startDate,@Param("endDate") String endDate, @Param("emailNo") String emailNo,@Param("printDate") String printDate,@Param("notNull") String notNull );
}
......@@ -28,7 +28,7 @@ public interface PersonPostService {
public boolean savePersonPost(List<PersonPostEntity> personPostEntities);
public List<PersonPostEntity> findPersonalData(@Param("applicantName") String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") List<String> getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("firstIndex") String firstIndex,@Param("pageSize") String pageSize, String emailNo,int notNull);
public List<PersonPostEntity> findPersonalData(@Param("applicantName") String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") List<String> getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("firstIndex") String firstIndex,@Param("pageSize") String pageSize, String emailNo,int notNull,String printDate);
public boolean deletePersonalData(String applicantName,String orderNumber,String state,String latticeMouthInformation,List<String> getToCounty,String starDate,String endDate);
......@@ -38,11 +38,11 @@ public interface PersonPostService {
public boolean printPostList(int id, Date printDateTime);
public int findPersonalDataCount(String applicantName, String orderNumber, String state, String latticeMouthInformation, List<String> getToCounty, String startDate,String endDate, String emailNo,String notNull);
public int findPersonalDataCount(String applicantName, String orderNumber, String state, String latticeMouthInformation, List<String> getToCounty, String startDate,String endDate, String emailNo,String notNull,String printDate);
public int findPersonalDataCountByImportDate(String starDate,String endDate);
public List<PersonPostEntity> downLoadReportForm(HttpServletRequest request,HttpServletResponse response,String sqrxm, String ddh, String hasPrinted, String gkxx, JSONArray jsonArray,String starDate,String endDate,String emailNo);
public List<PersonPostEntity> downLoadReportForm(HttpServletRequest request,HttpServletResponse response,String sqrxm, String ddh, String hasPrinted, String gkxx, JSONArray jsonArray,String starDate,String endDate,String emailNo,String printDate,String notNull);
public Map<String,Object> selectNote(@Param("id")int id);
......
......@@ -55,7 +55,7 @@ public class PersonPostServiceImpl implements PersonPostService {
return true;
}
@Override
public List<PersonPostEntity> findPersonalData(String applicantName,String orderNumber,String state,String latticeMouthInformation,List<String> getToCounty,String startDate,String endDate,String firstIndex,String pageSize,String emailNo,int notNull){
public List<PersonPostEntity> findPersonalData(String applicantName,String orderNumber,String state,String latticeMouthInformation,List<String> getToCounty,String startDate,String endDate,String firstIndex,String pageSize,String emailNo,int notNull,String printDate){
String str = "";
long firstIndexLong= Long.valueOf(firstIndex);
long pageSizeLong = Long.valueOf(pageSize);
......@@ -66,7 +66,7 @@ public class PersonPostServiceImpl implements PersonPostService {
str+="'"+getToCounty.get(i)+"',";
}
}
List<PersonPostEntity> list = personPostMapper.findAllPersonalData(applicantName,orderNumber,state,latticeMouthInformation,str,startDate,endDate,firstIndexLong * pageSizeLong,(firstIndexLong - 1) * pageSizeLong + 1,emailNo,notNull);
List<PersonPostEntity> list = personPostMapper.findAllPersonalData(applicantName,orderNumber,state,latticeMouthInformation,str,startDate,endDate,firstIndexLong * pageSizeLong,(firstIndexLong - 1) * pageSizeLong + 1,emailNo,notNull,printDate);
return list;
}
......@@ -99,7 +99,7 @@ public class PersonPostServiceImpl implements PersonPostService {
}
@Override
public int findPersonalDataCount(@Param("applicantName") String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") List<String> getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate,String emailNo,String notNull) {
public int findPersonalDataCount(@Param("applicantName") String applicantName,@Param("orderNumber") String orderNumber,@Param("state") String state,@Param("latticeMouthInformation") String latticeMouthInformation,@Param("getToCounty") List<String> getToCounty,@Param("startDate") String startDate,@Param("endDate") String endDate,String emailNo,String notNull,String printDate) {
String str = "";
for (int i = 0;i<getToCounty.size();i++){
if (i==getToCounty.size()-1){
......@@ -108,7 +108,7 @@ public class PersonPostServiceImpl implements PersonPostService {
str+="'"+getToCounty.get(i)+"',";
}
}
int count=personPostMapper.findPersonalDataCount(applicantName,orderNumber,state,latticeMouthInformation,str,startDate,endDate,emailNo,notNull);
int count=personPostMapper.findPersonalDataCount(applicantName,orderNumber,state,latticeMouthInformation,str,startDate,endDate,emailNo,notNull,printDate);
return count;
}
......@@ -119,7 +119,7 @@ public class PersonPostServiceImpl implements PersonPostService {
}
@Override
public List<PersonPostEntity> downLoadReportForm(HttpServletRequest request,HttpServletResponse response,String sqrxm, String ddh, String hasPrinted, String gkxx, JSONArray jsonArray, String starDate,String endDate,String emailNo) {
public List<PersonPostEntity> downLoadReportForm(HttpServletRequest request,HttpServletResponse response,String sqrxm, String ddh, String hasPrinted, String gkxx, JSONArray jsonArray, String starDate,String endDate,String emailNo,String printDate,String notNull) {
String str = "";
for (int i = 0;i<jsonArray.size();i++){
if (i==jsonArray.size()-1){
......@@ -128,7 +128,7 @@ public class PersonPostServiceImpl implements PersonPostService {
str+="'"+jsonArray.get(i)+"',";
}
}
List<PersonPostEntity> list = personPostMapper.findAllPersonalDataNoPage(sqrxm,ddh,hasPrinted,gkxx,str,starDate,endDate,emailNo);
List<PersonPostEntity> list = personPostMapper.findAllPersonalDataNoPage(sqrxm,ddh,hasPrinted,gkxx,str,starDate,endDate,emailNo,printDate,notNull);
return list;
}
......
......@@ -42,7 +42,9 @@ public class YXStringUtils {
SimpleDateFormat dt = new SimpleDateFormat(pattern);
return dt.format(new Date());
}
public static String stripNonDigits(String str) {
return str.replaceAll("\\D+","");
}
public static String inputStream2String(InputStream is) {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
......
......@@ -46,8 +46,9 @@
<td style="text-align: left;">
<select class="form-control select2" id="notNull" ng-model="isValid">
<option value="">--请选择数据状态--</option>
<option value="1">有效记录</option>
<option value="0">无效记录</option>
<option value="1">取消邮寄</option>
<option value="0">有效订单</option>
<option value="3">待定订单</option>
</select>
</td>
<td >格口:</td>
......@@ -112,8 +113,16 @@
</td>
</tr>
<tr>
<td></td>
<td></td>
<td>打印时间:</td>
<td>
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right" value="" id="printDate" readonly/>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td>
<td></td>
<td></td>
<td colspan="2">
......
......@@ -28,6 +28,14 @@ angular.module('AvatarCheck.uploadExcelAndSearch', ['ngRoute', 'AvatarCheck.http
todayBtn: 1,
autoclose: 1
});
//Date picker
$('#printDate').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-mm-dd',
todayBtn: 1,
autoclose: 1
});
//清除的代码
$(".glyphicon-remove").click(function(){
$($($(this).parent()).prev()).val("");
......@@ -60,6 +68,7 @@ angular.module('AvatarCheck.uploadExcelAndSearch', ['ngRoute', 'AvatarCheck.http
var getCountJson = function(){
var date=$('#datepicker').val();
var date1=$('#datepicker1').val();
var printDate=$('#printDate').val();
var notNull = $("#notNull").val();
var json={};
if (angular.isDefined($scope.applicantName)) {
......@@ -108,11 +117,17 @@ angular.module('AvatarCheck.uploadExcelAndSearch', ['ngRoute', 'AvatarCheck.http
}else {
json.endDate = $("#datepicker1").val();
}
if(printDate==''){
json.printDate='';
}else {
json.printDate = $("#printDate").val();
}
return json;
}
var getJson = function () {
var date=$('#datepicker').val();
var date1=$('#datepicker1').val();
var printDate=$('#printDate').val();
var notNull = $("#notNull").val();
var json={};
if (angular.isDefined($scope.applicantName)) {
......@@ -161,6 +176,11 @@ angular.module('AvatarCheck.uploadExcelAndSearch', ['ngRoute', 'AvatarCheck.http
}else{
json.notNull=notNull
}
if(printDate==''){
json.printDate='';
}else {
json.printDate = $("#printDate").val();
}
// if($scope.paginationConf.currentPage==0){
// $scope.paginationConf.currentPage=1
// }
......@@ -230,6 +250,16 @@ angular.module('AvatarCheck.uploadExcelAndSearch', ['ngRoute', 'AvatarCheck.http
}else {
url = url + 'endDate='+$("#datepicker1").val()+'&';
}
if(printDate==''){
url = url + 'printDate='+''+'&';
}else {
url = url + 'printDate='+$("#printDate").val()+'&';
}
if(notNull==''){
url = url + 'notNull='+''+'&';
}else{
url = url + 'notNull='+$("#notNull").val()+'&';
}
return url + 't=' + Math.floor(Date.now());
}
var getCount = function () {
......
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