Commit b63037ef authored by wuzhilong's avatar wuzhilong

公安网反馈下载中文乱码;

个人邮寄退回;
parent ea999ccc
...@@ -31,6 +31,7 @@ public class CartogramApi { ...@@ -31,6 +31,7 @@ public class CartogramApi {
List<Integer> list_jr = new ArrayList<>(); List<Integer> list_jr = new ArrayList<>();
List<Integer> list_yj = new ArrayList<>(); List<Integer> list_yj = new ArrayList<>();
List<Integer> list_fz = new ArrayList<>(); List<Integer> list_fz = new ArrayList<>();
List<Integer> list_gr = new ArrayList<>();
Map map; Map map;
List<Map<String,Integer>> str; List<Map<String,Integer>> str;
Map strMap = new HashMap <String, Object>(); Map strMap = new HashMap <String, Object>();
...@@ -39,6 +40,7 @@ public class CartogramApi { ...@@ -39,6 +40,7 @@ public class CartogramApi {
list_jr.add(0); list_jr.add(0);
list_yj.add(0); list_yj.add(0);
list_fz.add(0); list_fz.add(0);
list_gr.add(0);
} }
String date=json.toString(); String date=json.toString();
str=cartogramService.findNanufacturingQuantity(date); str=cartogramService.findNanufacturingQuantity(date);
...@@ -53,6 +55,9 @@ public class CartogramApi { ...@@ -53,6 +55,9 @@ public class CartogramApi {
if(map.get("CODE").toString().equals("7")){ if(map.get("CODE").toString().equals("7")){
list_yj.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString())); list_yj.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
} }
if(map.get("CODE").toString().equals("9")){
list_gr.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
}
if(map.get("CODE").toString().equals("99")){ if(map.get("CODE").toString().equals("99")){
list_fz.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString())); list_fz.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
} }
...@@ -61,6 +66,7 @@ public class CartogramApi { ...@@ -61,6 +66,7 @@ public class CartogramApi {
strMap.put("ga", list_jr); strMap.put("ga", list_jr);
strMap.put("tw", list_yj); strMap.put("tw", list_yj);
strMap.put("fz", list_fz); strMap.put("fz", list_fz);
strMap.put("gr", list_gr);
strMap.put("date",date); strMap.put("date",date);
return strMap; return strMap;
} }
......
...@@ -35,6 +35,7 @@ import java.io.FileNotFoundException; ...@@ -35,6 +35,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import static com.yxproject.start.utils.YXStringUtils.*;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/4/17 9:44 * 2019/4/17 9:44
...@@ -172,36 +173,45 @@ public class DeliveredApi { ...@@ -172,36 +173,45 @@ public class DeliveredApi {
* 登记投递失败信息 * 登记投递失败信息
*/ */
@RequestMapping("saveDeliveredFailedInfo") @RequestMapping("saveDeliveredFailedInfo")
// @RequiresPermissions("userInfo.add")//权限管理; public boolean saveDeliveredFailedInfo(@RequestBody String jsonStr) {
@Transactional(rollbackFor = Exception.class)
public boolean saveDeliveredFailedInfo(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonarray = new JSONArray(); JSONArray jsonarray = new JSONArray();
try { jsonarray = JSONArray.fromObject(jsonStr);
jsonarray = JSONArray.fromObject(jsonStr); List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities = new ArrayList<>();
List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities = new ArrayList<>(); boolean t=false;
for (int i = 0; i < jsonarray.size(); i++) { for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i); JSONObject jsonObject = (JSONObject) jsonarray.get(i);
String note = jsonObject.getString("note") + ""; String note = jsonObject.getString("note")+"";
String backReason = jsonObject.getString("backReason"); String backReason = jsonObject.getString("backReason");
String waybillNumber = jsonObject.getString("waybillNumber"); String backWaybillNumber = jsonObject.getString("waybillNumber");
String cardId = jsonObject.getString("cardId"); String cardId = jsonObject.getString("cardId");
String registerName = jsonObject.getString("registerName"); String registerName = jsonObject.getString("registerName");
DeliveredFailedInfoEntity deliveredFailedInfoEntity = new DeliveredFailedInfoEntity(); // String jmsfzslh = deliveredService.selectJMSFZSLHByWaybillNumber(backWaybillNumber);
deliveredFailedInfoEntity.setBackReason(Long.valueOf(backReason)); PersonPostEntity personPos = deliveredService.selectIdByWaybillNumber(backWaybillNumber);
deliveredFailedInfoEntity.setNote(note); Map<String, Object> resultMap=deliveredService.selectReturnInfo(personPos.getFirstWhite() + "");
deliveredFailedInfoEntity.setWaybillNumber(waybillNumber); DeliveredFailedInfoEntity deliveredFailedInfoEntity = new DeliveredFailedInfoEntity();
deliveredFailedInfoEntity.setCardId(cardId); deliveredFailedInfoEntity.setBackReason(Long.valueOf(backReason));
deliveredFailedInfoEntity.setRegisterName(registerName); deliveredFailedInfoEntity.setNote(note);
deliveredFailedInfoEntities.add(deliveredFailedInfoEntity); deliveredFailedInfoEntity.setWaybillNumber(backWaybillNumber);
deliveredFailedInfoEntity.setCardId(cardId);
deliveredFailedInfoEntity.setRegisterName(registerName);
deliveredFailedInfoEntity.setJmsfzslh(personPos.getFirstWhite() + "");
deliveredFailedInfoEntity.setId(Long.parseLong(personPos.getId()+""));
deliveredFailedInfoEntity.setPolice_code(resultMap.get("POLICECODE").toString());
deliveredFailedInfoEntity.setPolice_name(resultMap.get("POLICENAME").toString());
deliveredFailedInfoEntity.setName(resultMap.get("NAME").toString());
deliveredFailedInfoEntities.add(deliveredFailedInfoEntity);
try {
long personPostId = deliveredFailedInfoEntities.get(i).getId();
t = deliveredService.saveDeliveredFailedInfoList(deliveredFailedInfoEntities);
if(deliveredFailedInfoEntities.get(i).getBackReason() == 4){
deliveredService.updatePrintState(personPostId);
}
}catch (Exception e){
logger.error("登记投递失败信息:" + jsonarray);
logger.error("Exception 登记投递失败信息异常", e);
} }
deliveredService.saveDeliveredFailedInfoList(deliveredFailedInfoEntities);
} catch (Exception e) {
logger.error("异常参数:" + jsonarray);
logger.error("Exception 登记投递失败信息异常", e);
} }
return true; return t;
} }
/** /**
...@@ -256,22 +266,10 @@ public class DeliveredApi { ...@@ -256,22 +266,10 @@ public class DeliveredApi {
* @param startDate 登记时间 * @param startDate 登记时间
* @return 返回值 * @return 返回值
*/ */
// @RequiresPermissions("userInfo.add")//权限管理;
@RequestMapping("queryDeliveredFailedByRegisterDate") @RequestMapping("queryDeliveredFailedByRegisterDate")
@Transactional(rollbackFor = Exception.class) public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,@RequestParam("phone") String phone) {
public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,@RequestParam("cardId") String cardId, HttpServletRequest requ) { return deliveredService.selectDeliveredFailedByRegisterDate(stripNonDigits(startDate), stripNonDigits(endDate),phone);
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList<>();
try {
mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(startDate),replaceDate(endDate),cardId);
} catch (Exception e) {
logger.error("登记妥投失败信息时间:" + startDate+"---------"+endDate);
logger.error("Exception 查询登记妥投失败信息异常", e);
}
return mapList;
} }
/** /**
* 库房确认接收妥投失败证件 * 库房确认接收妥投失败证件
* *
...@@ -492,7 +490,40 @@ public class DeliveredApi { ...@@ -492,7 +490,40 @@ public class DeliveredApi {
} }
return mapList; return mapList;
} }
/**
* 库房确认接收妥投失败证件,更新拆分交接单
* @param data 妥投失败证件号
* @return
*/
@RequestMapping("saveconfirmNotDelivere")
public boolean saveconfirmNotDelivere(@RequestParam("data") String data) {
JSONObject jsonObject = JSONObject.fromObject(data);
String jmsfzslh = jsonObject.getString("JMSFZSLH")+"";;
String name = jsonObject.getString("name")+"";
boolean str=deliveredService.updateDeliveredFailedInfo(jmsfzslh,name);
return str;
}
/**
* 登记投递失败重复检测
* 判断输入的信息是否和已登记邮寄信息重复了
*/
@RequestMapping("detectDuplicateDeliveredFailedInfo")
public boolean detectDuplicateDeliveredFailedInfo (@RequestBody String jsonStr){
JSONArray jsonarray = new JSONArray();
jsonarray = JSONArray.fromObject(jsonStr);
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject=(JSONObject) jsonarray.get(i);
String waybillNumber=jsonObject.getString("waybillNumber");
String cardId=jsonObject.getString("cardId");
List<Map<String, Object>> list = deliveredService.selectWaybillNumber(waybillNumber,cardId);
if (list.size()>=1){
return false;
}else {
return true;
}
}
return true;
}
/** /**
* 去除字符串中中线 * 去除字符串中中线
......
...@@ -24,8 +24,7 @@ import java.util.Date; ...@@ -24,8 +24,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.yxproject.start.utils.YXStringUtils.getCurrentDate2String; import static com.yxproject.start.utils.YXStringUtils.*;
import static com.yxproject.start.utils.YXStringUtils.inputStream2byte;
@RestController @RestController
@RequestMapping("exportExcel") @RequestMapping("exportExcel")
...@@ -41,21 +40,16 @@ public class ExportExcelApi { ...@@ -41,21 +40,16 @@ public class ExportExcelApi {
* 导出公安网数据 * 导出公安网数据
*/ */
@RequestMapping("printExcelData") @RequestMapping("printExcelData")
public byte[] printExcelData(@RequestBody String list, HttpServletResponse response, HttpServletRequest requ) { public byte[] printExcelData(@RequestParam("list") List<Integer> list, @RequestParam("name")String name, @RequestParam("isHistory")String isHistory, HttpServletResponse response, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr(); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr); MDC.put("ip", remoteAddr);
JSONObject jsonObject = JSONObject.fromObject(list); List<Map<String, Object>> list1 = detailReceiptListService.selectPoliceDataById(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list")); List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(list, name,isHistory);
String isHistory = jsonObject.get("isHistory").toString();
String name = jsonObject.get("name").toString();
List<Map<String, Object>> list1 = detailReceiptListService.selectPoliceDataById(jsonArray);
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(jsonArray, name,isHistory);
response.setContentType("application/x-download"); response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件 //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = ExportExcel.exportExcelDate(mapList,list1); String fout = ExportExcel.exportExcelDate(mapList,list1,response,requ);
try { try {
response.addHeader("Content-Disposition", "attachment;filename=" + getCurrentDate2String("yyyy-MM-dd") + "公安网信息表" + ".xls");
return inputStream2byte(fout); return inputStream2byte(fout);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -217,6 +217,9 @@ public class LogApi { ...@@ -217,6 +217,9 @@ public class LogApi {
public boolean analysisByPrintDate(@RequestParam("printDate")String printDate, HttpServletRequest requ) { public boolean analysisByPrintDate(@RequestParam("printDate")String printDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr(); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr); MDC.put("ip", remoteAddr);
//通过上传受理号更新制证数据类型
//通过上传受理号和出生日期更新邮寄订单
try { try {
//更新xml数据中的证件类型和格口文件解析状态 //更新xml数据中的证件类型和格口文件解析状态
logService.changeCardTypeByPrintDate(getCurrentDate2String("yyyyMMddhhmmss"),printDate); logService.changeCardTypeByPrintDate(getCurrentDate2String("yyyyMMddhhmmss"),printDate);
......
...@@ -20,6 +20,42 @@ public class DeliveredFailedInfoEntity { ...@@ -20,6 +20,42 @@ public class DeliveredFailedInfoEntity {
private String cardId; private String cardId;
private Date receiveDate; private Date receiveDate;
private String receiveName; private String receiveName;
private String jmsfzslh;
private String name;
private String police_code;
private String police_name;
public String getJmsfzslh() {
return jmsfzslh;
}
public void setJmsfzslh(String jmsfzslh) {
this.jmsfzslh = jmsfzslh;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPolice_code() {
return police_code;
}
public void setPolice_code(String police_code) {
this.police_code = police_code;
}
public String getPolice_name() {
return police_name;
}
public void setPolice_name(String police_name) {
this.police_name = police_name;
}
@Id @Id
@Column(name = "ID") @Column(name = "ID")
......
...@@ -3,6 +3,7 @@ package com.yxproject.start.mapper; ...@@ -3,6 +3,7 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.DeliveredFailedInfoEntity; import com.yxproject.start.entity.DeliveredFailedInfoEntity;
import com.yxproject.start.entity.DeliveredFailedReasonEntity; import com.yxproject.start.entity.DeliveredFailedReasonEntity;
import com.yxproject.start.entity.DeliveredInfoEntity; import com.yxproject.start.entity.DeliveredInfoEntity;
import com.yxproject.start.entity.PersonPostEntity;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import java.util.List; import java.util.List;
...@@ -14,16 +15,16 @@ import java.util.Map; ...@@ -14,16 +15,16 @@ import java.util.Map;
*/ */
@Mapper @Mapper
public interface DeliveredFailedInfoMapper { public interface DeliveredFailedInfoMapper {
@Insert("insert into DELIVERED_FAILED_INFO (WAYBILL_NUMBER,BACK_DATE,BACK_REASON,note,REGISTER_NAME,CARD_ID) \n" + @Insert("insert into DELIVERED_FAILED_INFO (WAYBILL_NUMBER,BACK_DATE,BACK_REASON,note,REGISTER_NAME,CARD_ID,JMSFZSLH,police_code,police_name,name) \n" +
"VALUES (#{waybillNumber},sysdate,#{backReason},#{note},#{registerName},#{cardId})") "VALUES (#{waybillNumber},sysdate,#{backReason},#{note},#{registerName},#{cardId},#{jmsfzslh},#{police_code},#{police_name},#{name})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID") @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDeliveredFailedInfo(DeliveredFailedInfoEntity deliveredFailedInfoEntity); public boolean saveDeliveredFailedInfo(DeliveredFailedInfoEntity deliveredFailedInfoEntity);
@Update("update DELIVERED_INFO set DEAL_DATE =sysdate ,DEAL_STATE =#{dealState} \n" + @Update("update DELIVERED_INFO set DEAL_DATE =sysdate ,DEAL_STATE =#{dealState} \n" +
" where WAYBILL_NUMBER = #{waybillNumber}") " where WAYBILL_NUMBER = #{waybillNumber}")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID") @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean updateDeliveredInfo(DeliveredInfoEntity deliveredInfoEntity); public boolean updateDeliveredInfo(DeliveredInfoEntity deliveredInfoEntity);
@Select("select * from DELIVERED_INFO where WAYBILL_NUMBER = #{waybillNumber}") @Select("select * from DELIVERED_INFO where WAYBILL_NUMBER = #{waybillNumber}")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID") @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public List<DeliveredInfoEntity> selectDeliveredInfoByWaybillNumber(String waybillNumber); public List<DeliveredInfoEntity> selectDeliveredInfoByWaybillNumber(String waybillNumber);
...@@ -79,4 +80,11 @@ public interface DeliveredFailedInfoMapper { ...@@ -79,4 +80,11 @@ public interface DeliveredFailedInfoMapper {
@Select("select * from PERSON_POST where WAYBILL_NUMBER = #{waybillNumber}") @Select("select * from PERSON_POST where WAYBILL_NUMBER = #{waybillNumber}")
public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber); public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber);
@Select("SELECT * FROM PERSON_POST WHERE WAYBILL_NUMBER = #{backWaybillNumber}")
public PersonPostEntity selectIdByWaybillNumber(String backWaybillNumber);
@Update("UPDATE PERSON_POST SET STATE1 = 1,note='取消个人邮寄' WHERE ID = #{id}")
public boolean updatePrintState(@Param("id") long id);
} }
...@@ -77,18 +77,22 @@ public interface DeliveredInfoMapper { ...@@ -77,18 +77,22 @@ public interface DeliveredInfoMapper {
public List<Map<String,Object>> selectDeliveredByImportDate(@Param("date") String date); public List<Map<String,Object>> selectDeliveredByImportDate(@Param("date") String date);
@Select("<script>" + @Select("<script>" +
"select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON " + "select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON,pp.APPLICANT_NAME,pp.RECIPIENT_NAME,pp.RECIPIENT_PHONE\n" +
"from DELIVERED_FAILED_INFO\n" + "from DELIVERED_FAILED_INFO \n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" + "left join DELIVERED_FAILED_REASON\n" +
"on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"left join PERSON_POST pp\n" +
"on DELIVERED_FAILED_INFO.waybill_number=pp.WAYBILL_NUMBER\n" +
"where 1=1 " + "where 1=1 " +
" <if test='startDate!=null'> "+ " <if test='startDate!=null'> "+
" AND to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}" + " AND to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}" +
" </if>"+ " </if>"+
" <if test='cardId!=null'> "+ " <if test='phone!=null'> "+
" AND DELIVERED_FAILED_INFO.CARD_ID = #{cardId} " + " AND pp.RECIPIENT_PHONE = #{phone} " +
" </if>"+ " </if> " +
"</script>") " order by DELIVERED_FAILED_INFO.BACK_DATE"+
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("cardId")String cardId); "</script>" )
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("phone")String phone);
@Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}") @Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}")
public boolean deleteDeliveredByFileId(@Param("fileId") long fileId); public boolean deleteDeliveredByFileId(@Param("fileId") long fileId);
...@@ -122,11 +126,23 @@ public interface DeliveredInfoMapper { ...@@ -122,11 +126,23 @@ public interface DeliveredInfoMapper {
"where RECEIVE_DATE is null") "where RECEIVE_DATE is null")
public List<Map<String,Object>> selectDeliveredFailedNotReceive(); public List<Map<String,Object>> selectDeliveredFailedNotReceive();
@Update("update DELIVERED_FAILED_INFO set RECEIVE_NAME =#{name},RECEIVE_DATE = sysdate where CARD_ID = #{cardID} and RECEIVE_DATE is null") @Update("update DELIVERED_FAILED_INFO set RECEIVE_NAME =#{name},RECEIVE_DATE = sysdate where JMSFZSLH = #{cardID} and RECEIVE_DATE is null")
public boolean updateDeliveredFailedInfo(@Param("cardID")String cardID, @Param("name")String name); public boolean updateDeliveredFailedInfo(@Param("cardID")String cardID, @Param("name")String name);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" + @Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" + "left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(RECEIVE_DATE,'yyyyMMdd') between #{startDate} and #{endDate}") "where to_char(RECEIVE_DATE,'yyyyMMdd') between #{startDate} and #{endDate}")
public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(@Param("startDate")String startDate,@Param("endDate")String endDate); public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(@Param("startDate")String startDate,@Param("endDate")String endDate);
@Select("select DISTINCT pp.xm name,FILES.DWDM policecode,FILES.DWMC policename from PREPRO_PERSON pp\n" +
"left join FILES \n" +
"on pp.FILE_ID=FILES.ID\n" +
"where JMSFZSLH=#{jmsfzslh}")
public List<Map<String, Object>> selectReturnInfo(@Param("jmsfzslh")String jmsfzslh);
@Select("select * from DELIVERED_FAILED_INFO " +
"where WAYBILL_NUMBER = #{waybillNumber} and card_id= #{cardId} ")
public List<Map<String, Object>> selectWaybillNumber(@Param("waybillNumber")String waybillNumber,@Param("cardId")String cardId);
} }
...@@ -41,7 +41,7 @@ public interface ReceiptMapper { ...@@ -41,7 +41,7 @@ public interface ReceiptMapper {
public List<Map<String,Object>> selectReceiptListDate2(String groupNo); public List<Map<String,Object>> selectReceiptListDate2(String groupNo);
//查询这个组号是否已经生成交接单 //查询这个组号是否已经生成交接单
@Select("select id ,check_name ,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC from receipt_list left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO= receipt_list.POLICE_CODE where QR_CODE=#{groupNo}") @Select("select id ,check_name ,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO GAJG_DM from receipt_list left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = receipt_list.POLICE_CODE where QR_CODE=#{groupNo}")
public List<Map<String,Object>> selectByGroupNo(String groupNo); public List<Map<String,Object>> selectByGroupNo(String groupNo);
//生成交接单 //生成交接单
......
package com.yxproject.start.service; package com.yxproject.start.service;
import com.yxproject.start.entity.DeliveredFailedInfoEntity; import com.yxproject.start.entity.*;
import com.yxproject.start.entity.DeliveredFailedReasonEntity;
import com.yxproject.start.entity.DeliveredImportDicEntity;
import com.yxproject.start.entity.DeliveredInfoEntity;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -16,6 +13,14 @@ public interface DeliveredService { ...@@ -16,6 +13,14 @@ public interface DeliveredService {
public boolean saveDeliveredImportDic(DeliveredImportDicEntity deliveredImportDicEntity); public boolean saveDeliveredImportDic(DeliveredImportDicEntity deliveredImportDicEntity);
public boolean saveDeliveredInfoList(List<DeliveredInfoEntity> deliveredInfoEntityList); public boolean saveDeliveredInfoList(List<DeliveredInfoEntity> deliveredInfoEntityList);
public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities); public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities);
public PersonPostEntity selectIdByWaybillNumber(String backWaybillNumber);
/**
* 通过受理号查询退证信息
* @param jmsfzslh
* @return 姓名、受理派出所代码、派出所名称
*/
Map<String, Object> selectReturnInfo(String jmsfzslh);
public boolean updatePrintState(long id);
public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate, int reportType); public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate, int reportType);
public List<Map<String,Object>> selectDeliveredByImportDate(String date); public List<Map<String,Object>> selectDeliveredByImportDate(String date);
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate,String cardId); public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate,String cardId);
...@@ -24,6 +29,7 @@ public interface DeliveredService { ...@@ -24,6 +29,7 @@ public interface DeliveredService {
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType(); public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
public List<Map<String,Object>> selectDeliverData(String stringList); public List<Map<String,Object>> selectDeliverData(String stringList);
public List<Map<String,Object>> selectDeliverDataByWaybillNumber(String waybillNumber,String cardID); public List<Map<String,Object>> selectDeliverDataByWaybillNumber(String waybillNumber,String cardID);
public List<Map<String,Object>> selectWaybillNumber(String waybillNumber,String cardId);
public List<Map<String,Object>> selectDeliveredFailedNotReceive(); public List<Map<String,Object>> selectDeliveredFailedNotReceive();
public boolean updateDeliveredFailedInfo(String cardID,String name); public boolean updateDeliveredFailedInfo(String cardID,String name);
public List<Map<String,Object>> selectDeliveredFailedByReceiveDate(String startDate,String endDate); public List<Map<String,Object>> selectDeliveredFailedByReceiveDate(String startDate,String endDate);
......
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.DeliveredFailedInfoEntity; import com.yxproject.start.entity.*;
import com.yxproject.start.entity.DeliveredFailedReasonEntity;
import com.yxproject.start.entity.DeliveredImportDicEntity;
import com.yxproject.start.entity.DeliveredInfoEntity;
import com.yxproject.start.mapper.DeliveredFailedInfoMapper; import com.yxproject.start.mapper.DeliveredFailedInfoMapper;
import com.yxproject.start.mapper.DeliveredFailedReasonMapper; import com.yxproject.start.mapper.DeliveredFailedReasonMapper;
import com.yxproject.start.mapper.DeliveredImportDicMapper; import com.yxproject.start.mapper.DeliveredImportDicMapper;
...@@ -54,9 +51,14 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -54,9 +51,14 @@ public class DeliveredServiceImpl implements DeliveredService {
for (DeliveredFailedInfoEntity deliveredFailedInfoEntity :deliveredFailedInfoEntities){ for (DeliveredFailedInfoEntity deliveredFailedInfoEntity :deliveredFailedInfoEntities){
deliveredFailedInfoMapper.saveDeliveredFailedInfo(deliveredFailedInfoEntity); deliveredFailedInfoMapper.saveDeliveredFailedInfo(deliveredFailedInfoEntity);
} }
return false; return true;
}
@Override
public PersonPostEntity selectIdByWaybillNumber(String backWaybillNumber) {
PersonPostEntity personPostEntity = deliveredFailedInfoMapper.selectIdByWaybillNumber(backWaybillNumber);
// String id = personPostEntity.getId() + "";
return personPostEntity;
} }
@Override @Override
public List<Map<String, Object>> selectDeliveredReport(String startDate, String endDate, int reportType) { public List<Map<String, Object>> selectDeliveredReport(String startDate, String endDate, int reportType) {
List<Map<String, Object>> mapList = deliveredInfoMapper.selectReport(startDate, endDate, reportType); List<Map<String, Object>> mapList = deliveredInfoMapper.selectReport(startDate, endDate, reportType);
...@@ -139,7 +141,22 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -139,7 +141,22 @@ public class DeliveredServiceImpl implements DeliveredService {
public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(String startDate, String endDate) { public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(String startDate, String endDate) {
return deliveredInfoMapper.selectDeliveredFailedByReceiveDate(startDate, endDate); return deliveredInfoMapper.selectDeliveredFailedByReceiveDate(startDate, endDate);
} }
@Override
public Map<String, Object> selectReturnInfo(String jmsfzslh){
List<Map<String, Object>> list=deliveredInfoMapper.selectReturnInfo(jmsfzslh);
Map<String, Object> map=list.get(0);
return map;
};
@Override
public boolean updatePrintState(long id) {
return deliveredFailedInfoMapper.updatePrintState(id);
}
@Override
public List<Map<String, Object>> selectWaybillNumber(String waybillNumber,String cardId) {
List<Map<String, Object>> list = deliveredInfoMapper.selectWaybillNumber(waybillNumber,cardId);
return list;
}
private String replace(String str) { private String replace(String str) {
if("".equals(str)){ if("".equals(str)){
return null; return null;
......
...@@ -3,13 +3,20 @@ package com.yxproject.start.utils; ...@@ -3,13 +3,20 @@ package com.yxproject.start.utils;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.yxproject.start.utils.YXStringUtils.getCurrentDate2String;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/2/12 15:44 * 2019/2/12 15:44
...@@ -21,7 +28,7 @@ public class ExportExcel { ...@@ -21,7 +28,7 @@ public class ExportExcel {
* @param mapList 公安网信息 * @param mapList 公安网信息
* @return * @return
*/ */
public static String exportExcelDate(List<Map<String,Object>> mapList,List<Map<String,Object>> list){ public static String exportExcelDate(List<Map<String,Object>> mapList, List<Map<String,Object>> list, HttpServletResponse response, HttpServletRequest request){
//第一步创建workbook //第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
...@@ -165,13 +172,43 @@ public class ExportExcel { ...@@ -165,13 +172,43 @@ public class ExportExcel {
cell1 = row1.createCell(5); //设定值 cell1 = row1.createCell(5); //设定值
cell1.setCellValue("null".equals(list.get(i).get("RECEIPT_DATE") + "") ? "" : list.get(i).get("RECEIPT_DATE") + ""); cell1.setCellValue("null".equals(list.get(i).get("RECEIPT_DATE") + "") ? "" : list.get(i).get("RECEIPT_DATE") + "");
} }
//第六步将生成excel文件保存到指定路径下 //第六步将生成excel文件保存到指定路径下
FileOutputStream fout = null; FileOutputStream fout = null;
try { try {
String fileName = "公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size() + ".xls";
String rtn = "";
fileName = URLEncoder.encode(fileName, "UTF8");
String userAgent = request.getHeader("User-Agent");
/*针对IE或者以IE为内核的浏览器:*/
if (userAgent != null) {
userAgent = userAgent.toLowerCase();
/*IE浏览器,只能采用URLEncoder编码*/
if (userAgent.contains("msie")) {
rtn = "filename=\"" + fileName + "\"";
}
/*Opera浏览器只能采用filename**/
else if (userAgent.contains("opera")) {
rtn = "filename*=UTF-8''" + fileName;
}
/*Safari浏览器,只能采用ISO编码的中文输出*/
else if (userAgent.contains("safari")) {
rtn = "filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1") + "\"";
}
/*Chrome浏览器,只能采用MimeUtility编码或ISO编码的中文输出*/
// else if (userAgent.indexOf("applewebkit") != -1) {
// fileName = MimeUtility.encodeText(fileName, "UTF8", "B");
// rtn = "filename=\"" + fileName + "\"";
// }
/* FireFox浏览器,可以使用MimeUtility或filename*或ISO编码的中文输出*/
else if (userAgent.contains("mozilla")) {
rtn = "filename*=UTF-8''" + fileName;
}
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;" + rtn);
response.setCharacterEncoding("UTF-8");
// fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls"); // fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls");
fout = new FileOutputStream("D:\\Excel\\" + simpleDateFormat.format(new Date())+ "公安网信息表" + ".xls"); fout = new FileOutputStream("D:\\Excel\\" +"公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size()+".xls");
wb.write(fout); wb.write(fout);
fout.close(); fout.close();
} catch (IOException e) { } catch (IOException e) {
...@@ -180,7 +217,7 @@ public class ExportExcel { ...@@ -180,7 +217,7 @@ public class ExportExcel {
System.out.println("Excel文件生成成功..." + new Date()); System.out.println("Excel文件生成成功..." + new Date());
// return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls"; // return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls";
return "D:\\Excel\\" + simpleDateFormat.format(new Date()) + "公安网信息表" + ".xls"; return "D:\\Excel\\" +"公安网签收"+getCurrentDate2String("yyyy-MM-dd")+"_"+mapList.size()+".xls";
} }
......
...@@ -6,10 +6,18 @@ import org.dom4j.io.XMLWriter; ...@@ -6,10 +6,18 @@ import org.dom4j.io.XMLWriter;
import sun.misc.BASE64Decoder; import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder; import sun.misc.BASE64Encoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.net.URLEncoder;
import java.io.*; import java.io.*;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
/** /**
* Created by zhangdahui on 2017/8/23. * Created by zhangdahui on 2017/8/23.
*/ */
...@@ -42,6 +50,34 @@ public class YXStringUtils { ...@@ -42,6 +50,34 @@ public class YXStringUtils {
SimpleDateFormat dt = new SimpleDateFormat(pattern); SimpleDateFormat dt = new SimpleDateFormat(pattern);
return dt.format(new Date()); return dt.format(new Date());
} }
public static byte[] inputStream2byte(InputStream inStream) throws IOException {
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc;
while ((rc = inStream.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
return swapStream.toByteArray();
}
public static String formatFileName(String userAgent,String fileName){
String rtn = null;
if (userAgent != null) {
userAgent = userAgent.toLowerCase();
/*IE浏览器,只能采用URLEncoder编码*/
if (userAgent.contains("msie")) {
rtn = "filename=\"" + fileName + "\"";
}
/*Opera浏览器只能采用filename**/
else if (userAgent.contains("opera")) {
rtn = "filename*=UTF-8''" + fileName;
}
/* FireFox浏览器,可以使用MimeUtility或filename*或ISO编码的中文输出*/
else if (userAgent.contains("mozilla")) {
rtn = "filename*=UTF-8''" + fileName;
}
}
return rtn;
}
public static String stripNonDigits(String str) { public static String stripNonDigits(String str) {
return str.replaceAll("\\D+",""); return str.replaceAll("\\D+","");
} }
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
</div> </div>
<div class="ui-dialog-textLeft"> <div class="ui-dialog-textLeft">
<div ng-repeat="msg in updatemsg"> <div ng-repeat="msg in updatemsg">
<p ng-if="msg.STATIC==200" style="color: green;">{{msg.TEST}}</p> <p ng-if="msg.STATIC==true" style="color: green;">{{msg.TEST}}</p>
<p ng-if="msg.STATIC==500" style="color: red;">{{msg.TEST}}</p> <p ng-if="msg.STATIC==false" style="color: red;">{{msg.TEST}}</p>
</div> </div>
</div> </div>
<div class="ui-dialog-confirm"> <div class="ui-dialog-confirm">
......
...@@ -1088,6 +1088,17 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -1088,6 +1088,17 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
detectDuplicateDeliveredFailedInfo:function(data,success){
var body = JSON.stringify(data);
$http({
method: 'POST',
url: "../DeliveredApi/detectDuplicateDeliveredFailedInfo" + urlTimeStamp(),
data: body,
headers: {'Content-Type': 'application/json'}
}).then(function successCallback(response) {
success(response.data)
})
},
checkThisWaybillNumber:function(data,success){ checkThisWaybillNumber:function(data,success){
var body = JSON.stringify(data); var body = JSON.stringify(data);
$http({ $http({
...@@ -1388,6 +1399,17 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -1388,6 +1399,17 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
}) })
}, saveconfirmNotDelivere:function (data,success) {
var body = JSON.stringify(data);
$http({
method: 'GET',
url: "../DeliveredApi/saveconfirmNotDelivere" + urlTimeStamp(),
params:{
data:data
}
}).then(function successCallback(response) {
success(response.data)
})
}, },
getReport:function(date1,date2,success) { getReport:function(date1,date2,success) {
$http({ $http({
...@@ -1571,14 +1593,14 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -1571,14 +1593,14 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
queryDeliveredFailedByRegisterDate:function (date,date1,idCard,success) { queryDeliveredFailedByRegisterDate:function (date,date1,phone,success) {
$http({ $http({
method: 'GET', method: 'GET',
url: "../DeliveredApi/queryDeliveredFailedByRegisterDate" + urlTimeStamp(), url: "../DeliveredApi/queryDeliveredFailedByRegisterDate" + urlTimeStamp(),
params:{ params:{
startDate:date, startDate:date,
endDate:date1, endDate:date1,
cardId:idCard phone:phone
} }
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
......
...@@ -41,35 +41,40 @@ ...@@ -41,35 +41,40 @@
<table class="table table-bordered table-hover postTable" ng-if="deliveredFailedInfo.length>0"> <table class="table table-bordered table-hover postTable" ng-if="deliveredFailedInfo.length>0">
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" ng-model="checkAll"></th> <!--<th><input type="checkbox" ng-model="checkAll"></th>-->
<th>No.</th> <th>ID.</th>
<th>正向运单号</th> <th>正向运单号</th>
<th>姓名</th>
<th>身份证号码</th> <th>身份证号码</th>
<th>身份证受理号</th> <th>受理派出所</th>
<th>退回原因</th> <th>退回原因</th>
<th>登记日期</th> <th>登记日期</th>
<th>登记人</th> <th>登记人</th>
<th>备注</th> <th>备注</th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="item in deliveredFailedInfo"> <tr ng-repeat="item in deliveredFailedInfo">
<td><input type="checkbox" class="checks" ng-checked="checkAll" value="{{item.CARD_ID}}"></td> <!--<td><input type="checkbox" class="checks" ng-checked="checkAll" value="{{item.JMSFZSLH}}"></td>-->
<td>{{$index+1}}</td> <td>{{item.ID}}</td>
<td>{{item.WAYBILL_NUMBER}}</td> <td>{{item.WAYBILL_NUMBER}}</td>
<td>{{item.NAME}}</td>
<td>{{item.CARD_ID}}</td> <td>{{item.CARD_ID}}</td>
<td>{{item.JMSFZSLH}}</td> <td>{{item.POLICE_NAME}}</td>
<td>{{item.REASON}}</td> <td>{{item.REASON}}</td>
<td>{{item.BACK_DATE|date:'yyyy-MM-dd'}}</td> <td>{{item.BACK_DATE|date:'yyyy-MM-dd'}}</td>
<td>{{item.REGISTER_NAME}}</td> <td>{{item.REGISTER_NAME}}</td>
<td>{{item.NOTE}}</td> <td>{{item.NOTE}}</td>
<td><button class="btn btn-primary" ng-click="savePrintTag($index)">接收&打印封签</button></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="box-footer" style="text-align: right;" ng-if="deliveredFailedInfo.length>0"> <!--<div class="box-footer" style="text-align: right;" ng-if="deliveredFailedInfo.length>0">-->
<button class="btn btn-primary" ng-click="confirmNotDelivered()">确认接收</button> <!--&lt;!&ndash;接收并修改交接单,把接收的数据单独生成交接单&ndash;&gt;-->
</div> <!--<button class="btn btn-primary" ng-click="confirmNotDelivered()">确认接收</button>-->
<!--</div>-->
</div> </div>
</div> </div>
<div class="box"> <div class="box">
...@@ -82,26 +87,26 @@ ...@@ -82,26 +87,26 @@
<td>起始日期:</td> <td>起始日期:</td>
<td> <td>
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" <input type="text"
class="form-control pull-right" class="form-control pull-right"
ng-model="choseDate" ng-model="choseDate"
id="datepicker1" readonly/> id="datepicker1" readonly/>
</div> </div>
</td> </td>
<td>截止日期:</td> <td>截止日期:</td>
<td> <td>
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" <input type="text"
class="form-control pull-right" class="form-control pull-right"
ng-model="choseDate1" ng-model="choseDate1"
id="datepicker2" readonly/> id="datepicker2" readonly/>
</div> </div>
</td> </td>
<td> <td>
<div style="text-align: left;"> <div style="text-align: left;">
...@@ -117,22 +122,26 @@ ...@@ -117,22 +122,26 @@
<table class="table table-bordered table-hover postTable" ng-if="hasConfirmedInfo.length>0"> <table class="table table-bordered table-hover postTable" ng-if="hasConfirmedInfo.length>0">
<thead> <thead>
<tr> <tr>
<th>No.</th> <th>ID.</th>
<th>正向运单号</th> <th>正向运单号</th>
<th>姓名</th>
<th>身份证号码</th> <th>身份证号码</th>
<th>派出所名称</th>
<th>退回原因</th> <th>退回原因</th>
<th>登记人姓名</th>
<th>备注</th> <th>备注</th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="item in hasConfirmedInfo"> <tr ng-repeat="item in hasConfirmedInfo">
<td>{{$index+1}}</td> <td>{{item.ID}}</td>
<td>{{item.WAYBILL_NUMBER}}</td> <td>{{item.WAYBILL_NUMBER}}</td>
<td>{{item.NAME}}</td>
<td>{{item.CARD_ID}}</td> <td>{{item.CARD_ID}}</td>
<td>{{item.POLICE_NAME}}</td>
<td>{{item.REASON}}</td> <td>{{item.REASON}}</td>
<td>{{item.REGISTER_NAME}}</td>
<td>{{item.NOTE}}</td> <td>{{item.NOTE}}</td>
<td><button class="btn btn-primary" ng-click="pringTag($index)">打印封签</button></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
...@@ -29,14 +29,14 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht ...@@ -29,14 +29,14 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht
$scope.choseDate1 = $filter("date")(new Date(), "yyyy-MM-dd"); $scope.choseDate1 = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.deliveredFailedInfo;
//查询未接收的投递失败的信息 //查询未接收的投递失败的信息
$scope.queryDeliveredFailedInfo=function () { $scope.queryDeliveredFailedInfo=function () {
HttpService.queryDeliveredFailedInfoDate(function(data){ HttpService.queryDeliveredFailedInfoDate(function(data){
$scope.deliveredFailedInfo = data; $scope.deliveredFailedInfo = data;
console.log($scope.deliveredFailedInfo)
}) })
}; };
$scope.hasConfirmedInfo;
//查询已接收的信息 //查询已接收的信息
$scope.searchHasConfirmedInfo = function () { $scope.searchHasConfirmedInfo = function () {
var date1 = $("#datepicker1").val(); var date1 = $("#datepicker1").val();
...@@ -49,7 +49,6 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht ...@@ -49,7 +49,6 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht
} }
HttpService.getHasConfirmedInfo(date1,date2,function(data){ HttpService.getHasConfirmedInfo(date1,date2,function(data){
$scope.hasConfirmedInfo = data; $scope.hasConfirmedInfo = data;
console.log($scope.hasConfirmedInfo);
}) })
} }
if($rootScope.loginData.login==true){ if($rootScope.loginData.login==true){
...@@ -64,20 +63,109 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht ...@@ -64,20 +63,109 @@ angular.module("AvatarCheck.confirmNotDeliveredInfo",['ngRoute', 'AvatarCheck.ht
MessageService.showAlert("请选择确认接收的证件"); MessageService.showAlert("请选择确认接收的证件");
}else{ }else{
var json = { var json = {
cardIdList:[], JMSFZSLHList:[],
name:$rootScope.loginData.name name:$rootScope.loginData.name
}; };
for(var i=0;i<checkboxes.length;i++){ for(var i=0;i<checkboxes.length;i++){
json.cardIdList.push(checkboxes[i].value); json.JMSFZSLHList.push(checkboxes[i].value);
} }
console.log(json);
HttpService.confirmNotDelivereData(json,function(data) { HttpService.confirmNotDelivereData(json,function(data) {
console.log(data)
$scope.checkAll = false; $scope.checkAll = false;
$scope.queryDeliveredFailedInfo(); $scope.queryDeliveredFailedInfo();
}) });
$scope.searchHasConfirmedInfo(); $scope.searchHasConfirmedInfo();
} }
}; };
$scope.json={
titel:"个人邮寄退回",
policeName:"",
policeData:"",
name:"",
id:""
};
//打印标签函数
$scope.pring=function (json) {
var LODOP = getLodop();
LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
if (!LODOP) { alert("请先安装控件!"); return; }
LODOP.SET_LICENSES("", "15F0BE661E7F32F37491843CB2510905", "C94CEE276DB2187AE6B65D56B3FC2848", "");
//初始化
LODOP.PRINT_INIT("打印封口签");
//设置纸张大小
// LODOP.SET_PRINT_PAGESIZE(1, "80mm", "50mm", "CreateCustomPage");
LODOP.SET_PRINT_PAGESIZE(1, "79mm", "49mm", "");
// LODOP.SET_PRINT_STYLE("FontName", "黑体");
//ADD_PRINT_TEXT(Top,Left,Width,Height,strContent)
LODOP.ADD_PRINT_TEXT(24,0, "78mm", "20mm", json.titel);
LODOP.SET_PRINT_STYLEA(1, "Bold", 1);
LODOP.SET_PRINT_STYLEA(1, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(1, "FontSize", 20);
//设定该打印项在纸张内的位置和区域大小【Top,Left,Width,Height,strHtmlContent】
// LODOP.ADD_PRINT_HTM("24mm", "0", "80mm", "24mm", document.getElementById("tagDiv").innerHTML);
LODOP.ADD_PRINT_TEXT(67, 0, "100%", 20, json.policeData);
LODOP.SET_PRINT_STYLEA(2, "Bold", 1);
LODOP.SET_PRINT_STYLEA(2, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(2, "FontSize", 15);
LODOP.ADD_PRINT_TEXT(97, 0, "100%", 20, json.policeName);
LODOP.SET_PRINT_STYLEA(3, "Bold", 1);
LODOP.SET_PRINT_STYLEA(3, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(3, "VOrient", 0);
LODOP.SET_PRINT_STYLEA(3, "FontSize", 13);
LODOP.ADD_PRINT_TEXT(127, 0, "100%", 20, json.name);
LODOP.SET_PRINT_STYLEA(4, "Bold", 1);
LODOP.SET_PRINT_STYLEA(4, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(4, "FontSize", 15);
LODOP.ADD_PRINT_TEXT(160,"90%", "100%", 20, json.id);
LODOP.SET_PRINT_STYLEA(4, "Bold", 1);
LODOP.SET_PRINT_STYLEA(4, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(4, "FontSize", 12);
LODOP.PREVIEW();
// LODOP.PRINT();
}
//接收并打印标签
$scope.savePrintTag=function (index) {
var json = {
JMSFZSLH:$scope.deliveredFailedInfo[index].JMSFZSLH,
name:$rootScope.loginData.name
};
HttpService.getPoliceName($scope.deliveredFailedInfo[index].POLICE_CODE,function(data) {
console.log("getPoliceName:",data);
if(data==null){
MessageService.showAlert("获取分局名称失败");
}else{
$scope.json.policeData=data[0].POLICE_NAME;
HttpService.saveconfirmNotDelivere(json,function (data) {
if(data){
$scope.json.policeName=$scope.deliveredFailedInfo[index].POLICE_NAME;
$scope.json.name=$scope.deliveredFailedInfo[index].NAME;
$scope.json.id=$scope.deliveredFailedInfo[index].ID;
$scope.pring($scope.json);
//刷新已签收数据
$scope.searchHasConfirmedInfo();
//刷新未签收数据
$scope.queryDeliveredFailedInfo();
}else {
MessageService.showAlert("接收证件数据失败");
}
})
}
});
};
//打印标签
$scope.pringTag=function (index) {
$scope.hasConfirmedInfo[index];
$scope.json.policeName=$scope.hasConfirmedInfo[index].POLICE_NAME;
$scope.json.name=$scope.hasConfirmedInfo[index].NAME;
$scope.json.id=$scope.hasConfirmedInfo[index].ID;
HttpService.getPoliceName($scope.hasConfirmedInfo[index].POLICE_CODE,function(data) {
$scope.json.policeData=data[0].POLICE_NAME;
$scope.pring($scope.json);
})
}
}); });
\ No newline at end of file
...@@ -42,18 +42,24 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http']) ...@@ -42,18 +42,24 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
for (var i=0;i<checks.length;i++){ for (var i=0;i<checks.length;i++){
json.list.push(checks[i].value) json.list.push(checks[i].value)
} }
console.log(json);
if(json.list.length==0){ if(json.list.length==0){
MessageService.showAlert("请选择要下载的分局或派出所") MessageService.showAlert("请选择要下载的分局或派出所")
}else{ }else{
HttpService.printExcelData(json,function (data) { var listStr = "";
$scope.doSearchGongan(); for (var i=0;i<json.list.length;i++){
var blob = new Blob([data], {type: "application/vnd.ms-excel"}); if(i!=json.list.length-1){
var a = document.createElement("a"); listStr += json.list[i]+","
document.body.appendChild(a); }else{
a.href = URL.createObjectURL(blob); listStr += json.list[i]
a.click(); }
}) }
console.log($rootScope.loginData.name)
var url = '../exportExcel/printExcelData?name='+$rootScope.loginData.name+"&isHistory="+$scope.isHistory+"&list="+listStr;
var a = document.createElement("a");
document.body.appendChild(a);
a.href = encodeURI(url);
a.click();
$scope.doSearchGongan();
} }
}; };
......
...@@ -66,30 +66,32 @@ ...@@ -66,30 +66,32 @@
<div class="box box-primary"> <div class="box box-primary">
<table class="table table-bordered" style="margin-bottom: 0;"> <table class="table table-bordered" style="margin-bottom: 0;">
<tr> <tr>
<td width="10%">起始日期:</td> <td width="10%;">起始日期:</td>
<td width="20%"> <td width="20%">
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" class="form-control pull-right" ng-model="choseDate" id="datepicker" readonly/> <input type="text" class="form-control pull-right" value="{{choseDate}}" id="datepicker" readonly/>
</div> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td> </td>
<td width="10%">截止日期:</td> <td width="10%;">截止日期:</td>
<td width="20%"> <td width="20%">
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-calendar"></i> <i class="fa fa-calendar"></i>
</div> </div>
<input type="text" class="form-control pull-right" ng-model="choseDate" id="datepicker1" readonly/> <input type="text" class="form-control pull-right" value="{{choseDate}}" id="datepicker1" readonly/>
</div> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td> </td>
<td width="10%;">身份证号:</td> <td width="10%;">手机号:</td>
<td width="20%"> <td width="20%">
<input type="text" class="form-control pull-right" ng-model="idCard" placeholder="请输入身份证号"/> <input type="text" class="form-control pull-right" ng-model="phone" placeholder="请输入手收件人手机号"/>
</td> </td>
<td style="text-align: left;"> <td style="text-align: left;">
<button class="btn btn-primary" ng-click="queryDeliveredFailedByRegisterDate()">查询</button> <button class="btn btn-primary" ng-click="queryDeliveredFailedByRegisterDate()">查询</button>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -98,32 +100,38 @@ ...@@ -98,32 +100,38 @@
<h4>暂无数据</h4> <h4>暂无数据</h4>
</div> </div>
<table class="table table-bordered table-hover postTable" ng-if="deliveredFailedByRegisterDate.length>0"> <table class="table table-bordered table-hover postTable" ng-if="deliveredFailedByRegisterDate.length>0">
<thead> <thead>
<tr> <tr>
<th>No.</th> <th>No.</th>
<th>正向运单号</th> <th>正向运单号</th>
<th>身份证号码</th> <th>收件人姓名</th>
<th>退回原因</th> <th>收件人电话</th>
<th>登记日期</th> <th>姓名</th>
<th>登记人</th> <th>身份证号码</th>
<th>备注</th> <th>退回原因</th>
<th></th> <th>登记日期</th>
</tr> <th>登记人</th>
</thead> <th>备注</th>
<tbody> <th></th>
<tr ng-repeat="item in deliveredFailedByRegisterDate"> </tr>
<td>{{$index+1}}</td> </thead>
<td>{{item.WAYBILL_NUMBER}}</td> <tbody>
<td>{{item.CARD_ID}}</td> <tr ng-repeat="item in deliveredFailedByRegisterDate">
<td>{{item.REASON}}</td> <td>{{$index+1}}</td>
<td>{{item.BACK_DATE|date:'yyyy-MM-dd'}}</td> <td>{{item.WAYBILL_NUMBER}}</td>
<td>{{item.REGISTER_NAME}}</td> <td>{{item.RECIPIENT_NAME}}</td>
<td>{{item.NOTE}}</td> <td>{{item.RECIPIENT_PHONE}}</td>
<td ng-if="item.RECEIVE_DATE==null"><button class="btn btn-primary" ng-click="deleteDeliveredFailedById(item.ID)">删除</button></td> <td>{{item.NAME}}</td>
<td ng-if="item.RECEIVE_DATE!=null"><button class="btn btn-primary" disabled>删除</button></td> <td>{{item.CARD_ID|limitTo:6:0}}*****{{item.CARD_ID|limitTo:4:14}}</td>
</tr> <td>{{item.REASON}}</td>
</tbody> <td>{{item.BACK_DATE|date:'yyyy-MM-dd'}}</td>
</table> <td>{{item.REGISTER_NAME}}</td>
<td>{{item.NOTE}}</td>
<td ng-if="item.RECEIVE_DATE==null"><button class="btn btn-primary" ng-click="deleteDeliveredFailedById(item.ID)">删除</button></td>
<td ng-if="item.RECEIVE_DATE!=null"><button class="btn btn-primary" disabled>删除</button></td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -11,7 +11,6 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht ...@@ -11,7 +11,6 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht
HttpService.queryDeliveredFailedType(function(data) { HttpService.queryDeliveredFailedType(function(data) {
console.log(data)
$scope.backReasonList = data; $scope.backReasonList = data;
}); });
...@@ -31,6 +30,10 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht ...@@ -31,6 +30,10 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht
todayBtn: 1, todayBtn: 1,
autoclose: 1 autoclose: 1
}); });
//清除的代码
$(".glyphicon-remove").click(function(){
$($($(this).parent()).prev()).val("");
})
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd"); $scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.saveDeliveredFailedInfo=function () { $scope.saveDeliveredFailedInfo=function () {
...@@ -55,47 +58,49 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht ...@@ -55,47 +58,49 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht
cardId = ""; cardId = "";
} }
var arr = [{"waybillNumber":waybillNumber,"registerName":registerName,"cardId":cardId,"backReason":backReason,"note":note}]; var arr = [{"waybillNumber":waybillNumber,"registerName":registerName,"cardId":cardId,"backReason":backReason,"note":note}];
console.log(arr,"==========");
var waybillNumberArr = []; var waybillNumberArr = [];
var json = { var json = {
waybillNumber:waybillNumber, waybillNumber:waybillNumber,
cardId:cardId cardId:cardId
}; };
waybillNumberArr.push(json); waybillNumberArr.push(json);
HttpService.checkThisWaybillNumber(waybillNumberArr,function(data) { HttpService.detectDuplicateDeliveredFailedInfo(waybillNumberArr,function(data) {
console.log(data);
if(data){ if(data){
HttpService.saveDeliveredFailedInfo(arr,function (data) { HttpService.checkThisWaybillNumber(waybillNumberArr,function(data) {
$scope.queryDeliveredFailedByRegisterDate(); if(data){
if(data==true){ HttpService.saveDeliveredFailedInfo(arr,function (data) {
MessageService.showAlert("提交成功"); $scope.queryDeliveredFailedByRegisterDate();
if(data==true){
MessageService.showAlert("提交成功");
}else{
MessageService.showAlert("提交失败")
}
})
}else{ }else{
MessageService.showAlert("提交失败") MessageService.showAlert("该邮件号/身份证号不存在")
} }
}) })
}else{ }else{
MessageService.showAlert("该邮件号/身份证号不存在") MessageService.showAlert("邮政信息存在重复数据或退证已添加,请删除后再操作。")
} }
})
});
} }
} };
$scope.queryDeliveredFailedByRegisterDate=function () { $scope.queryDeliveredFailedByRegisterDate=function () {
var date = $("#datepicker").val(); var date = $("#datepicker").val();
var date1 = $("#datepicker1").val(); var date1 = $("#datepicker1").val();
if(angular.isUndefined($scope.idCard)){ if(angular.isUndefined($scope.phone)){
$scope.idCard = ''; $scope.phone = '';
} }
if(date ==''){ if(date=='{{choseDate}}'){
date = $scope.choseDate; date=$scope.choseDate;
} }
if(date1 ==''){ if(date1=='{{choseDate}}'){
date1 = $scope.choseDate; date1=$scope.choseDate;
} }
console.log(date,date1,$scope.idCard); HttpService.queryDeliveredFailedByRegisterDate(date,date1,$scope.phone,function(data){
HttpService.queryDeliveredFailedByRegisterDate(date,date1,$scope.idCard,function(data){
$scope.deliveredFailedByRegisterDate = data; $scope.deliveredFailedByRegisterDate = data;
console.log($scope.deliveredFailedByRegisterDate)
}) })
}; };
if($rootScope.loginData.login==true){ if($rootScope.loginData.login==true){
...@@ -103,7 +108,6 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht ...@@ -103,7 +108,6 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht
} }
$scope.deleteDeliveredFailedById=function (id) { $scope.deleteDeliveredFailedById=function (id) {
console.log(id);
HttpService.deleteDeliveredFailedById(id,function(data){ HttpService.deleteDeliveredFailedById(id,function(data){
if(data==true){ if(data==true){
MessageService.showAlert("删除成功") MessageService.showAlert("删除成功")
...@@ -113,4 +117,4 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht ...@@ -113,4 +117,4 @@ angular.module("AvatarCheck.saveDeliveredFailedInfo",['ngRoute', 'AvatarCheck.ht
$scope.queryDeliveredFailedByRegisterDate(); $scope.queryDeliveredFailedByRegisterDate();
}) })
} }
}) });
\ No newline at end of file \ No newline at end of file
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