Commit b89458c2 authored by wuzhilong's avatar wuzhilong

GAT跟踪信息

parent 2a19af74
......@@ -57,6 +57,27 @@ public class ExportExcelApi {
logger.error("IOException 导出公安网数据IO异常", e);
}
}
/**
* 导出公安网数据
*/
@RequestMapping("printExcelDataGAT")
public void printExcelDataGAT(@RequestParam("list") List<Integer> list,HttpServletResponse response, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetailsGAT(list);
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件
ExportExcel.exportExcelDateGAT(mapList,response,requ);
} catch (Exception e) {
e.printStackTrace();
logger.error("导出GAT数据异常");
logger.error("IOException 导出GAT数据IO异常", e);
}
}
/**
* 导出交接单
......
package com.yxproject.start.api;
import com.yxproject.start.entity.FileNameDicEntity;
import com.yxproject.start.entity.GreenPackageInformationEntity;
import com.yxproject.start.entity.GreenPackageInformationFileEntity;
import com.yxproject.start.entity.PersonPostEntity;
import com.yxproject.start.entity.*;
import com.yxproject.start.service.FileNameDicService;
import com.yxproject.start.service.GreenPackageInformationService;
import com.yxproject.start.service.PersonPostService;
......@@ -376,6 +373,172 @@ public class ReadExcelApi {
}
return map;
}
/**
* 导入个人邮寄信息表
*/
@RequestMapping("ReadGATTrack")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public Map<String, String> ReadGATTrack(@RequestParam("formStartTime") String startDate, @RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
String filename = "";
DiskFileItemFactory factory = new DiskFileItemFactory();
// 设置缓冲区的大小为100KB,如果不指定,那么缓冲区的大小默认是10KB
factory.setSizeThreshold(1024 * 100);
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setHeaderEncoding("UTF-8");
// 设置上传单个文件的大小的最大值,目前是设置为1024*1024*10字节,也就是10MB
upload.setFileSizeMax(1024 * 1024 * 10);
// 设置上传文件总量的最大值,最大值=同时上传的多个文件的大小的最大值的和,目前设置为4000MB
upload.setSizeMax(1024 * 1024 * 4000);
// 将普通属性存入map中,之后调用
Map<String, String> map = new HashMap<String, String>();
List<FileItem> list = null;
try {
//将当前上下文初始化给 CommonsMutipartResolver (多部分解析器)
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
requ.getServletContext());
// 判断是否是多数据段提交格式
if (multipartResolver.isMultipart(requ)) {
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) requ;
Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) {
List<MultipartFile> fileRows = multiRequest.getFiles(iter.next().toString());
for (MultipartFile item : fileRows) {
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
// 得到上传的文件名称
filename = item.getOriginalFilename();
int rows=0;
try {
// 如果fileitem中封装的是普通输入项的数据
// 如果fileitem中封装的是上传文件
// 得到上传的文件名称
filename = item.getOriginalFilename();
File file = null;
try {
file = File.createTempFile("prefix", "_" + item.getOriginalFilename());
item.transferTo(file);
} catch (IOException e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
}
ReadExcel readExcel = new ReadExcel();
List list1 = readExcel.readExcelGAT(file);
//保存EXCEL文件信息
GATTrackFileEntity gat_file = new GATTrackFileEntity();
gat_file.setFile_name(filename);
gat_file.setUpload_time(simpleDateFormat.format(new Date()));
gat_file.setTime_ex(replaceDate(startDate));
gat_file.setTime_en(replaceDate(endDate));
fileNameDicService.saveGatFile(gat_file);
//保存个人邮寄信息
List<GATTrackEntity> entityList = new ArrayList<>();
for (int i = 0; i < list1.size(); i++) {
GATTrackEntity gatTr = new GATTrackEntity();
List list2 = (List) list1.get(i);
rows=i;
//跳过空行和第一行
if (list2 == null || i < 3) {
continue;
}
gatTr.setNO((String) list2.get(0));
gatTr.setUPLOAD_NO((String) list2.get(1));
gatTr.setID_CARD((String) list2.get(2));
gatTr.setID_NO((String) list2.get(3));
gatTr.setNAME((String) list2.get(4));
gatTr.setUPLOAD_UNIT((String) list2.get(5));
gatTr.setDATA_HOME_UNIT((String) list2.get(6));
gatTr.setDATA_HOME_UNIT_NAME((String) list2.get(7));
gatTr.setAPPLY_REASON((String) list2.get(8));
gatTr.setSTATUS((String) list2.get(9));
gatTr.setERROR_TYPE((String) list2.get(10));
gatTr.setUPLOAD_TIME((String) list2.get(11));
gatTr.setCARD_ACCEPT_TIME((String) list2.get(12));
gatTr.setPHONE((String) list2.get(13));
gatTr.setFILE_ID(gat_file.getId());
entityList.add(gatTr);
}
personPostService.saveGATTrack(entityList);
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名:" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("Exception", "上传文件时发生错误,非法EXCEL文件:" + filename);
map.put("result","false");
map.put("msg","数据格式异常,请检查第 "+rows+" 行数据。");
return map;
}
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名:" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("FileUploadException", "文件上载发生异常:" + e.getMessage());
map.put("result","false");
map.put("msg","文件上载发生异常");
return map;
}
}
}
}
} catch (Exception e) {
logger.error("上传文件名:" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("Exception 导入港澳台跟踪表异常", e);
map.put("result","false");
map.put("msg","导入港澳台信息异常");
return map;
}
map.put("result","true");
map.put("msg","上传成功!");
return map;
}
/**
* 查询港澳台跟踪文件信息
*
* @param date_ex 开始时间
* @param date_en 截至日期
* @return
*/
@RequestMapping("queryGATTrack")
public String queryGATTrack(@RequestParam("date_ex") String date_ex,@RequestParam("date_en") String date_en, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
try {
List<Map<String,Object>> list = fileNameDicService.queryGATTRFile(replaceDate(date_ex), replaceDate(date_en));
yxjsonResponse.outPutSuccess(list);
} catch (Exception e) {
logger.error("查询港澳台跟踪文件记录:"+date_ex+"--"+date_en);
logger.error("Exception 查询港澳台跟踪文件记录异常", e);
}
return yxjsonResponse.toJSONString();
}
@RequestMapping("deleteByGATTrFileId")
public Map<String, String> deleteByGATTrFileId(@RequestParam("fileId") String fileId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
Map<String, String> map = null;
try {
map = new HashMap<>();
fileNameDicService.deleteByGATTrFileId(fileId);
map.put("msg", "删除成功");
} catch (Exception e) {
logger.error("文件名:" + fileId);
logger.error("Exception 通过file_ID删除港澳台跟踪信息异常", e);
}
return map;
}
private String replaceDate(String str) {
return str.replace("-", "");
......
package com.yxproject.start.entity;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;
@Entity
@Table(name = "GAT_TRACK", schema = "YX", catalog = "")
public class GATTrackEntity {
private String NO;//序号
private String UPLOAD_NO;//证件受理号
private String ID_CARD;//通行证号码
private String ID_NO;//公民身份号码
private String NAME;//姓名
private String UPLOAD_UNIT;//受理单位
private String DATA_HOME_UNIT;//数据归属单位代码
private String DATA_HOME_UNIT_NAME;//数据归属单位名称
private String APPLY_REASON;//申领原因
private String STATUS;//证件状态
private String ERROR_TYPE;//审核错误类型
private String UPLOAD_TIME;//受理时间
private String CARD_ACCEPT_TIME;//证件接收时间
private String PHONE;//联系电话
private String FILE_ID;//上传文件id
@Basic
@Column(name = "NO")
public String getNO() {
return NO;
}
public void setNO(String NO) {
this.NO = NO;
}
@Basic
@Column(name = "UPLOAD_NO")
public String getUPLOAD_NO() {
return UPLOAD_NO;
}
public void setUPLOAD_NO(String UPLOAD_NO) {
this.UPLOAD_NO = UPLOAD_NO;
}
@Basic
@Column(name = "ID_CARD")
public String getID_CARD() {
return ID_CARD;
}
public void setID_CARD(String ID_CARD) {
this.ID_CARD = ID_CARD;
}
@Basic
@Column(name = "ID_NO")
public String getID_NO() {
return ID_NO;
}
public void setID_NO(String ID_NO) {
this.ID_NO = ID_NO;
}
@Basic
@Column(name = "NAME")
public String getNAME() {
return NAME;
}
public void setNAME(String NAME) {
this.NAME = NAME;
}
@Basic
@Column(name = "UPLOAD_UNIT")
public String getUPLOAD_UNIT() {
return UPLOAD_UNIT;
}
public void setUPLOAD_UNIT(String UPLOAD_UNIT) {
this.UPLOAD_UNIT = UPLOAD_UNIT;
}
@Basic
@Column(name = "DATA_HOME_UNIT")
public String getDATA_HOME_UNIT() {
return DATA_HOME_UNIT;
}
public void setDATA_HOME_UNIT(String DATA_HOME_UNIT) {
this.DATA_HOME_UNIT = DATA_HOME_UNIT;
}
@Basic
@Column(name = "DATA_HOME_UNIT_NAME")
public String getDATA_HOME_UNIT_NAME() {
return DATA_HOME_UNIT_NAME;
}
public void setDATA_HOME_UNIT_NAME(String DATA_HOME_UNIT_NAME) {
this.DATA_HOME_UNIT_NAME = DATA_HOME_UNIT_NAME;
}
@Basic
@Column(name = "APPLY_REASON")
public String getAPPLY_REASON() {
return APPLY_REASON;
}
public void setAPPLY_REASON(String APPLY_REASON) {
this.APPLY_REASON = APPLY_REASON;
}
@Basic
@Column(name = "STATUS")
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String STATUS) {
this.STATUS = STATUS;
}
@Basic
@Column(name = "ERROR_TYPE")
public String getERROR_TYPE() {
return ERROR_TYPE;
}
public void setERROR_TYPE(String ERROR_TYPE) {
this.ERROR_TYPE = ERROR_TYPE;
}
@Basic
@Column(name = "UPLOAD_TIME")
public String getUPLOAD_TIME() {
return UPLOAD_TIME;
}
public void setUPLOAD_TIME(String UPLOAD_TIME) {
this.UPLOAD_TIME = UPLOAD_TIME;
}
@Basic
@Column(name = "CARD_ACCEPT_TIME")
public String getCARD_ACCEPT_TIME() {
return CARD_ACCEPT_TIME;
}
public void setCARD_ACCEPT_TIME(String CARD_ACCEPT_TIME) {
this.CARD_ACCEPT_TIME = CARD_ACCEPT_TIME;
}
@Basic
@Column(name = "PHONE")
public String getPHONE() {
return PHONE;
}
public void setPHONE(String PHONE) {
this.PHONE = PHONE;
}
@Id
@Column(name = "FILE_ID")
public String getFILE_ID() {
return FILE_ID;
}
public void setFILE_ID(String FILE_ID) {
this.FILE_ID = FILE_ID;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GATTrackEntity that = (GATTrackEntity) o;
return Objects.equals(NO, that.NO) && Objects.equals(UPLOAD_NO, that.UPLOAD_NO) && Objects.equals(ID_CARD, that.ID_CARD) && Objects.equals(ID_NO, that.ID_NO) && Objects.equals(NAME, that.NAME) && Objects.equals(UPLOAD_UNIT, that.UPLOAD_UNIT) && Objects.equals(DATA_HOME_UNIT, that.DATA_HOME_UNIT) && Objects.equals(DATA_HOME_UNIT_NAME, that.DATA_HOME_UNIT_NAME) && Objects.equals(APPLY_REASON, that.APPLY_REASON) && Objects.equals(STATUS, that.STATUS) && Objects.equals(ERROR_TYPE, that.ERROR_TYPE) && Objects.equals(UPLOAD_TIME, that.UPLOAD_TIME) && Objects.equals(CARD_ACCEPT_TIME, that.CARD_ACCEPT_TIME) && Objects.equals(PHONE, that.PHONE) && Objects.equals(FILE_ID, that.FILE_ID);
}
@Override
public int hashCode() {
return Objects.hash(NO, UPLOAD_NO, ID_CARD, ID_NO, NAME, UPLOAD_UNIT, DATA_HOME_UNIT, DATA_HOME_UNIT_NAME, APPLY_REASON, STATUS, ERROR_TYPE, UPLOAD_TIME, CARD_ACCEPT_TIME, PHONE, FILE_ID);
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/3/1 10:39
*/
@Entity
@Table(name = "FILE_NAME_DIC", schema = "YINGXIN", catalog = "")
public class GATTrackFileEntity {
private String id;
private String upload_time;
private String time_ex;
private String time_en;
private String file_name;
@Id
@Column(name = "ID")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Basic
@Column(name = "UPLOAD_TIME")
public String getUpload_time() {
return upload_time;
}
public void setUpload_time(String upload_time) {
this.upload_time = upload_time;
}
@Basic
@Column(name = "TIME_EX")
public String getTime_ex() {
return time_ex;
}
public void setTime_ex(String time_ex) {
this.time_ex = time_ex;
}
@Basic
@Column(name = "TIME_EN")
public String getTime_en() {
return time_en;
}
public void setTime_en(String time_en) {
this.time_en = time_en;
}
@Basic
@Column(name = "FILE_NAME")
public String getFile_name() {
return file_name;
}
public void setFile_name(String file_name) {
this.file_name = file_name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GATTrackFileEntity that = (GATTrackFileEntity) o;
return Objects.equals(id, that.id) && Objects.equals(upload_time, that.upload_time) && Objects.equals(time_ex, that.time_ex) && Objects.equals(time_en, that.time_en) && Objects.equals(file_name, that.file_name);
}
@Override
public int hashCode() {
return Objects.hash(id, upload_time, time_ex, time_en, file_name);
}
}
......@@ -22,8 +22,7 @@ public interface DetailReceiptListMapper {
*/
@Select("select DETAIL_RECEIPT_LIST.id,DETAIL_RECEIPT_LIST.ACCEPT_NO,DETAIL_RECEIPT_LIST.SIGN_GOVT,DETAIL_RECEIPT_LIST.NAME,DETAIL_RECEIPT_LIST.UPLOAD_NO,\n" +
"DETAIL_RECEIPT_LIST.sex,DETAIL_RECEIPT_LIST.CARD_ID,DETAIL_RECEIPT_LIST.POLICE_CODE,DIC_UPLOAD_UNIT_T.UNIT_NAME POLICE_NAME,to_char(RECEIPT_LIST.CHECK_DATE,'yyyyMMdd') CHECK_DATE,\n" +
"RECEIPT_LIST.CHECK_NAME,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.OLD_CARD_TYPE_ID,PERSON_POST.WAYBILL_NUMBER,DETAIL_RECEIPT_LIST.note,RECEIPT_LIST.QR_CODE,DETAIL_RECEIPT_LIST.APPLY_PHONE," +
"DETAIL_RECEIPT_LIST.ADDRESS,DETAIL_RECEIPT_LIST.GAT_ID \n" +
"RECEIPT_LIST.CHECK_NAME,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.OLD_CARD_TYPE_ID,PERSON_POST.WAYBILL_NUMBER,DETAIL_RECEIPT_LIST.note,RECEIPT_LIST.QR_CODE,DETAIL_RECEIPT_LIST.APPLY_PHONE " +
"from DETAIL_RECEIPT_LIST \n" +
"left join RECEIPT_LIST on DETAIL_RECEIPT_LIST.RECEIPT_ID = RECEIPT_LIST.ID\n" +
"left join PERSON_POST on PERSON_POST.FIRST_WHITE = DETAIL_RECEIPT_LIST.UPLOAD_NO\n" +
......@@ -86,4 +85,18 @@ public interface DetailReceiptListMapper {
@Update("UPDATE DETAIL_RECEIPT_LIST set RECEIPT_ID = #{reciptId},POLICE_CODE= #{policeCode} where id =#{id}")
public boolean updateDetailReceiptList(@Param("id") long id, @Param("reciptId") long reciptId,@Param("policeCode")String policeCode);
/**
* 查询导出GAT制证数据
*
* @return
*/
@Select("select dr.name,dr.sex,dr.CARD_ID,dr.ADDRESS,dr.SIGN_GOVT,dr.BEGIN_DATE,dr.EXPIRE_DATE,dr.GAT_ID,dic.CARD_TYPE,tr.PHONE\n" +
"From RECEIPT_LIST rl\n" +
"left join DETAIL_RECEIPT_LIST dr on dr.RECEIPT_ID=rl.ID\n" +
"left join GAT_TRACK tr on dr.UPLOAD_NO=tr.UPLOAD_NO\n" +
"left join CARD_TYPE_DIC dic on rl.CARD_TYPE_ID=dic.CARD_TYPE_ID\n" +
"where rl.ID in (${str}) order by dr.UPLOAD_NO ")
public List<Map<String, Object>> selectPostDetailsGAT(@Param("str") String str);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.FileNameDicEntity;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.GATTrackFileEntity;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
/**
* @auther zhangyusheng
......@@ -77,4 +80,30 @@ public interface FileNameDicMapper {
@Delete("DELETE FROM FILE_NAME_DIC WHERE FILE_ID = #{fileId}")
public void deleteFileAndPostData(@Param("fileId") String fileId);
/**
* 保存GAT跟踪表文件名
*
* @param gatFile
* @return
*/
@Insert("INSERT INTO GAT_TRACK_FILE (ID,UPLOAD_TIME,TIME_EX,TIME_EN,FILE_NAME) " +
"VALUES (GATTR_FILE_ID_SEQ.nextval,#{upload_time},#{time_ex},#{time_en},#{file_name})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public void saveGatFileName(GATTrackFileEntity gatFile);
/**
* 按条件查询港澳台跟踪文件导入信息
* @return
*/
@Select("select fi.FILE_NAME,fi.ID,fi.TIME_EN,fi.TIME_EX,fi.UPLOAD_TIME,count(*) NUMSTR \n" +
"from GAT_TRACK tr left join GAT_TRACK_FILE fi on fi.ID=tr.FILE_ID \n" +
"where substr(fi.UPLOAD_TIME,0,8) BETWEEN #{date_ex} and #{date_en}\n" +
"GROUP by fi.FILE_NAME,fi.ID,fi.TIME_EN,fi.TIME_EX,fi.UPLOAD_TIME")
public List<Map<String,Object>> queryGATTRFile(@Param("date_ex") String date_ex,@Param("date_en") String date_en);
@Delete("delete from GAT_TRACK\n" +
"where FILE_ID=#{fileId} ")
public void deleteByGATTrFileId(@Param("fileId") String fileId);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.PersonPostEntity;
import org.apache.ibatis.annotations.*;
......@@ -228,5 +229,10 @@ public interface PersonPostMapper {
public List<Map<String,Object>> findAllPoarInvalidOrder( @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("printDate") String printDate,@Param("notNull") String notNull );
@Insert("insert into GAT_TRACK " +
"(NO,UPLOAD_NO,ID_CARD,ID_NO,NAME,UPLOAD_UNIT,DATA_HOME_UNIT,DATA_HOME_UNIT_NAME,APPLY_REASON,STATUS,ERROR_TYPE,UPLOAD_TIME,CARD_ACCEPT_TIME,PHONE,FILE_ID) " +
"values " +
"(#{NO},#{UPLOAD_NO},#{ID_CARD},#{ID_NO},#{NAME},#{UPLOAD_UNIT},#{DATA_HOME_UNIT},#{DATA_HOME_UNIT_NAME},#{APPLY_REASON},#{STATUS},#{ERROR_TYPE},#{UPLOAD_TIME},#{CARD_ACCEPT_TIME},#{PHONE},#{FILE_ID})")
public boolean saveGATtr(GATTrackEntity gatTr);
}
......@@ -406,9 +406,9 @@ public interface ReceiptMapper {
public boolean createDetailReceiptList(@Param("receiptId")String receiptId,@Param("groupNo")String groupNo,@Param("policeCode")String policeCode);
//生成交接单详单——港澳台
@Insert("INSERT INTO DETAIL_RECEIPT_LIST(UPLOAD_NO,accept_no,name,POLICE_CODE,card_id,SIGN_GOVT,RECEIPT_ID,SEX,APPLY_PHONE,GAT_ID,ADDRESS)\n" +
@Insert("INSERT INTO DETAIL_RECEIPT_LIST(UPLOAD_NO,accept_no,name,POLICE_CODE,card_id,SIGN_GOVT,RECEIPT_ID,SEX,APPLY_PHONE,GAT_ID,ADDRESS,EXPIRE_DATE,BEGIN_DATE)\n" +
"select cardT.UPLOAD_NO,cardT.ACCEPT_NO,cardT.NAME,#{policeCode},cardT.ID_NO,cardT.SIGN_GOVT,#{receiptId},cardT.SEX_NO,applyInfo.APPLY_PHONE," +
"cardT.CARD_NO,cardT.ADDR1||cardT.ADDR2||cardT.ADDR3\n" +
"cardT.CARD_NO,cardT.ADDR1||cardT.ADDR2||cardT.ADDR3,CARDT.EXPIRE_DATE,CARDT.BEGIN_DATE \n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK cardT " +
"LEFT JOIN PRODYD_DBA.PROD_APPLY_INFO_T@PRODYD_LINK applyInfo \n" +
"ON applyInfo.ACCEPT_NO = cardT.ACCEPT_NO\n" +
......
......@@ -17,4 +17,7 @@ public interface DetailReceiptListService {
public List<DetailReceiptListEntity> selectDetailReceiptListEntityByCardId(String cardID);
public boolean updateDetailReceiptList(DetailReceiptListEntity detailReceiptListEntity,long reciptId);
public List<Map<String,Object>> selectPostDetailsGAT(List<Integer> list);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.FileNameDicEntity;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.GATTrackFileEntity;
import java.util.List;
import java.util.Map;
/**
* @auther zhangyusheng
......@@ -38,4 +41,27 @@ public interface FileNameDicService {
* @param fileId
*/
public void deleteFileByFileId(String fileId);
/**
* 保存个人邮寄信息字典表
* @param gatFile
* @return
*/
public void saveGatFile(GATTrackFileEntity gatFile);
/**
* 查询个人邮寄信息字典表
* @param date_ex 开始时间
* @param date_en 截至时间
* @return
*/
public List<Map<String,Object>> queryGATTRFile(String date_ex, String date_en);
/**
* 根据文件id删除GAT excel文件信息
* @param fileId
*/
public void deleteByGATTrFileId(String fileId);
}
package com.yxproject.start.service;
import com.yxproject.start.dto.ReadCardDto;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.PersonPostEntity;
import net.sf.json.JSONArray;
import org.apache.ibatis.annotations.Param;
......@@ -63,4 +64,5 @@ public interface PersonPostService {
public List<Map<String,Object>> downLoadInvalidOrder(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 boolean saveGATTrack(List<GATTrackEntity> gatTR);
}
......@@ -73,4 +73,17 @@ public class DetailReceiptListServiceImpl implements DetailReceiptListService {
public boolean updateDetailReceiptList(DetailReceiptListEntity detailReceiptListEntity, long reciptId) {
return detailReceiptListMapper.updateDetailReceiptList(detailReceiptListEntity.getId(), reciptId,detailReceiptListEntity.getPoliceCode());
}
@Override
public List<Map<String, Object>> selectPostDetailsGAT(List<Integer> stringList) {
String str = "";
for (int i = 0; i < stringList.size(); i++) {
if (i == stringList.size() - 1) {
str += stringList.get(i);
} else {
str += stringList.get(i) + ",";
}
}
return detailReceiptListMapper.selectPostDetailsGAT(str);
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.FileNameDicEntity;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.GATTrackFileEntity;
import com.yxproject.start.mapper.FileNameDicMapper;
import com.yxproject.start.mapper.PersonPostMapper;
import com.yxproject.start.service.FileNameDicService;
......@@ -9,6 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* @auther zhangyusheng
......@@ -42,5 +45,22 @@ public class FileNameDicServiceImpl implements FileNameDicService {
personPostMapper.deletePersonPostByFileId(fileId);
fileNameDicMapper.deleteFileAndPostData(fileId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveGatFile(GATTrackFileEntity gatFile) {
fileNameDicMapper.saveGatFileName(gatFile);
}
@Override
public List<Map<String,Object>> queryGATTRFile(String date_ex, String date_en) {
return fileNameDicMapper.queryGATTRFile(date_ex,date_en );
}
@Override
@Transactional
public void deleteByGATTrFileId(String fileId) {
fileNameDicMapper.deleteByGATTrFileId(fileId);
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.dto.ReadCardDto;
import com.yxproject.start.entity.GATTrackEntity;
import com.yxproject.start.entity.PersonPostEntity;
import com.yxproject.start.mapper.FileNameDicMapper;
import com.yxproject.start.mapper.PersonPostMapper;
......@@ -205,4 +206,13 @@ public class PersonPostServiceImpl implements PersonPostService {
return list;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveGATTrack(List<GATTrackEntity> gatTR) {
for (GATTrackEntity gat : gatTR) {
personPostMapper.saveGATtr(gat);
}
return true;
}
}
......@@ -48,8 +48,6 @@ public class ExportExcel {
sheet.setColumnWidth(13, 30 * 110);
sheet.setColumnWidth(14, 30 * 110);
sheet.setColumnWidth(15, 30 * 110);
sheet.setColumnWidth(16, 40 * 110);
sheet.setColumnWidth(17, 80 * 110);
//第三步创建行row:添加表头0行
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = wb.createCellStyle();//样式
......@@ -91,10 +89,6 @@ public class ExportExcel {
cell.setCellValue("备注");
cell = row.createCell(15); //设定值
cell.setCellValue("联系方式");
cell = row.createCell(16); //设定值
cell.setCellValue("通行证号码");
cell = row.createCell(17); //设定值
cell.setCellValue("住址");
for (int i =0;i<mapList.size();i++){
row = sheet.createRow(i + 1);
......@@ -130,10 +124,6 @@ public class ExportExcel {
cell.setCellValue("null".equals(mapList.get(i).get("NOTE")+"")?"":mapList.get(i).get("NOTE")+"");
cell = row.createCell(15); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("APPLY_PHONE")+"")?"":mapList.get(i).get("APPLY_PHONE")+"");
cell = row.createCell(16); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("GAT_ID")+"")?"":mapList.get(i).get("GAT_ID")+"");
cell = row.createCell(17); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("ADDRESS")+"")?"":mapList.get(i).get("ADDRESS")+"");
}
HSSFSheet sheet1 = wb.createSheet("公安网信息交接表");
......@@ -391,6 +381,122 @@ public class ExportExcel {
}
/**
* 导出公安网信息GAT
* @param mapList 公安网信息
*/
public static void exportExcelDateGAT(List<Map<String,Object>> mapList, HttpServletResponse response, HttpServletRequest request){
//第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
HSSFSheet sheet = wb.createSheet("GAT_TRACK");
sheet.setColumnWidth(0, 30 * 110);
sheet.setColumnWidth(1, 30 * 110);
sheet.setColumnWidth(2, 40 * 110);
sheet.setColumnWidth(3, 50 * 110);
sheet.setColumnWidth(4, 80 * 110);
sheet.setColumnWidth(5, 40 * 110);
sheet.setColumnWidth(6, 30 * 110);
sheet.setColumnWidth(7, 30 * 110);
sheet.setColumnWidth(8, 30 * 110);
sheet.setColumnWidth(9, 30 * 110);
sheet.setColumnWidth(10, 30 * 110);
//第三步创建行row:添加表头0行
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = wb.createCellStyle();//样式
style.setWrapText(true);//设置自动换行
HSSFFont font = wb.createFont();
font.setFontHeightInPoints((short) 12);
style.setFont(font);
row = sheet.createRow(0); //创建下标为0的单元格
row.setHeightInPoints(Short.parseShort("20"));//设置行高
HSSFCell cell = row.createCell(0); //设定值
cell.setCellValue("姓名");
cell = row.createCell(1); //设定值
cell.setCellValue("性别");
cell = row.createCell(2); //设定值
cell.setCellValue("出生日期");
cell = row.createCell(3); //设定值
cell.setCellValue("证件号码");
cell = row.createCell(4); //设定值
cell.setCellValue("住址");
cell = row.createCell(5); //设定值
cell.setCellValue("签发机关");
cell = row.createCell(6); //设定值
cell.setCellValue("起始有效期");
cell = row.createCell(7); //设定值
cell.setCellValue("截至有效期");
cell = row.createCell(8); //设定值
cell.setCellValue("通行证号");
cell = row.createCell(9); //设定值
cell.setCellValue("证件类型");
cell = row.createCell(10); //设定值
cell.setCellValue("联系电话");
String sex="";
for (int i =0;i<mapList.size();i++){
row = sheet.createRow(i + 1);
cell = row.createCell(0); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("NAME")+"")?"":mapList.get(i).get("NAME")+"");
cell = row.createCell(1); //设定值
sex="null".equals(mapList.get(i).get("SEX")+"")?"":mapList.get(i).get("SEX")+"";
cell.setCellValue(sex.equals("2")?"女":"男");
cell = row.createCell(2); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("CARD_ID")+"")?"":mapList.get(i).get("CARD_ID").toString().substring(6,13));
cell = row.createCell(3); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("CARD_ID")+"")?"":mapList.get(i).get("CARD_ID")+"");
cell = row.createCell(4); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("ADDRESS")+"")?"":mapList.get(i).get("ADDRESS")+"");
cell = row.createCell(5); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("SIGN_GOVT")+"")?"":mapList.get(i).get("SIGN_GOVT")+"");
cell = row.createCell(6); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("BEGIN_DATE")+"")?"":mapList.get(i).get("BEGIN_DATE")+"");
cell = row.createCell(7); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("EXPIRE_DATE")+"")?"":mapList.get(i).get("EXPIRE_DATE")+"");
cell = row.createCell(8); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("GAT_ID")+"")?"":mapList.get(i).get("GAT_ID")+"");
cell = row.createCell(9); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("CARD_TYPE")+"")?"":mapList.get(i).get("CARD_TYPE")+"");
cell = row.createCell(10); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("PHONE")+"")?"":mapList.get(i).get("PHONE")+"");
}
//第六步将生成excel文件保存到指定路径下
try {
String fileName = "GAT_info_"+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") + "\"";
}
/* 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");
OutputStream fout = response.getOutputStream();
wb.write(fout);
fout.flush();
fout.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
......@@ -129,6 +129,64 @@ public class ReadExcel {
String cellinfo = sheet.getCell(j, i).getContents();
// if(cellinfo.isEmpty()){
// continue;
// }
innerList.add(cellinfo);
}
outerList.add(i, innerList);
}
return outerList;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
// 去读Excel的方法readExcel,该方法的入口参数为一个File对象
public List readExcelGAT(File file) {
try {
// // 创建输入流,读取Excel
// InputStream is = new FileInputStream(file.getAbsolutePath());
// jxl提供的Workbook类
Workbook wb = Workbook.getWorkbook(file);
// Excel的页签数量
int sheet_size = wb.getNumberOfSheets();
for (int index = 0; index < sheet_size; index++) {
List<List> outerList=new ArrayList<List>();
// 每个页签创建一个Sheet对象
Sheet sheet = wb.getSheet(index);
// sheet.getRows()返回该页的总行数
for (int i = 0; i < sheet.getRows(); i++) {
List innerList=new ArrayList();
String columns0 = sheet.getCell(0,i).getContents();
String columns1 = sheet.getCell(1,i).getContents();
String columns2 = sheet.getCell(2,i).getContents();
String columns3 = sheet.getCell(3,i).getContents();
String columns4 = sheet.getCell(4,i).getContents();
String columns5 = sheet.getCell(5,i).getContents();
String columns6 = sheet.getCell(6,i).getContents();
String columns7 = sheet.getCell(7,i).getContents();
String columns8 = sheet.getCell(8,i).getContents();
String columns9 = sheet.getCell(9,i).getContents();
String columns10 = sheet.getCell(10,i).getContents();
String columns11 = sheet.getCell(11,i).getContents();
String columns12 = sheet.getCell(12,i).getContents();
String columns13 = sheet.getCell(13,i).getContents();
if (columns0.equals("")&&columns1.equals("")&&columns2.equals("")&&columns3.equals("")&&
columns4.equals("")&&columns5.equals("")&&columns6.equals("")&&columns7.equals("")&&
columns8.equals("")&&columns9.equals("")&&columns10.equals("")&&columns11.equals("")&&columns12.equals("")&&
columns13.equals("")){
continue;
}
// sheet.getColumns()返回该页的总列数
for (int j = 0; j < sheet.getColumns(); j++) {
String cellinfo = sheet.getCell(j, i).getContents();
// if(cellinfo.isEmpty()){
// continue;
// }
innerList.add(cellinfo);
}
......
......@@ -213,7 +213,7 @@
<script src="views/insertCardBody/insertCardBody.js"></script>
<script src="views/filmManagement/filmManagement.js"></script>
<script src="views/cardReport/cardReport.js"></script>
<script src="views/filmReport/filmReport.js"></script>
<!--<script src="views/filmReport/filmReport.js"></script>-->
<script src="views/dataCheckReport/dataCheckReport.js"></script>
<script src="views/blank/blank.js"></script>
<script src="views/addBackCard/addBackCard.js"></script>
......@@ -225,6 +225,7 @@
<script src="views/machinePackageImport/machinePackageImport.js"></script>
<script src="views/addAuditFailure/addAuditFailure.js"></script>
<script src="views/historyTagPrint/historyTagPrint.js"></script>
<script src="views/gatTrack/gatTrack.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -37,7 +37,7 @@ angular.module('AvatarCheck', [
'AvatarCheck.insertFilm',
'AvatarCheck.insertCardBody',
'AvatarCheck.filmManagement',
'AvatarCheck.filmReport',
// 'AvatarCheck.filmReport',
"AvatarCheck.dataCheckReport",
'AvatarCheck.cardReport',
'AvatarCheck.addBackCard',
......@@ -49,7 +49,8 @@ angular.module('AvatarCheck', [
"AvatarCheck.machinePackageImport",
"AvatarCheck.historyTagPrint",
'AvatarCheck.blank',
'AvatarCheck.addAuditFailure'
'AvatarCheck.addAuditFailure',
'AvatarCheck.gatTrack'
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider',function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/blank'});
......@@ -214,9 +215,9 @@ angular.module('AvatarCheck', [
if($location.path()=="/cardReport"){
$rootScope.tab = '/cardReport';
}
if($location.path()=="/filmReport"){
$rootScope.tab = '/filmReport';
}
// if($location.path()=="/filmReport"){
// $rootScope.tab = '/filmReport';
// }
if($location.path()=="/dataCheckReport"){
$rootScope.tab = '/dataCheckReport';
}
......@@ -238,6 +239,9 @@ angular.module('AvatarCheck', [
if($location.path()=="/machinePackageImport"){
$rootScope.tab = '/machinePackageImport';
}
if($location.path()=="/gatTrack"){
$rootScope.tab = '/gatTrack';
}
......
......@@ -2028,5 +2028,40 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
uploadGATFile:function(date1,date2,fd,success){
$http({
method: 'POST',
url: "../ReadExcel/ReadGATTrack?formStartTime="+date1+"&formDeadLine="+date2,
data: fd,
headers: {'Content-Type': undefined},
transformRequest: angular.identity
}).then(function successCallback(response) {
success(response.data)
})
},
selectGATTrack:function(date_ex,date_en,success){
$http({
method: 'GET',
url: "../ReadExcel/queryGATTrack"+urlTimeStamp(),
params:{
date_ex:date_ex,
date_en:date_en
}
}).then(function successCallback(response) {
success(response.data)
})
},deleteByGATTrFileId:function(fileId,success){
console.log(fileId)
$http({
method: 'GET',
url: "../ReadExcel/deleteByGATTrFileId"+urlTimeStamp(),
params:{
fileId:fileId
}
}).then(function successCallback(response) {
console.log(response.data)
success(response.data)
})
},
}
});
\ No newline at end of file
<div class="content row">
<div class="col-md-12" style="margin-top:20px;">
<div class="row">
<!-- /.col -->
......@@ -14,7 +15,7 @@
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="searchHistory('')">查询历史</button>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="doSearchGongan()">查询</button>
<button type="button" class="btn btn-success pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="searchHistory('gat')">查询港澳台历史</button>
<button type="button" class="btn btn-success pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="searchHistory('gat')" ng-if="process==9">查询港澳台历史</button>
</div>
<!-- /.box-tools -->
......@@ -135,6 +136,9 @@
<div class="pull-right" style="margin-left: 10px;">
<button class="btn btn-primary" ng-click="downloadGongan()">下载公安网反馈信息</button>
</div>
<div class="pull-right" style="margin-left: 10px;" ng-if="process==9">
<button class="btn btn-success" ng-click="downloadGonganGAT()">下载港澳台信息</button>
</div>
</div>
<div ng-if="gonganHistoryData.length==0">
<h4>暂无数据</h4>
......
......@@ -61,7 +61,23 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
$scope.doSearchGongan();
}
};
$scope.downloadGonganGAT = function(){
var listStr ="";
var checks = $(".checkPoliceBox:checked");
for (var i=0;i<checks.length;i++){
listStr+=checks[i].value+","
}
if(checks.length==0){
MessageService.showAlert("请选择要下载的分局或派出所")
}else{
var url = '../exportExcel/printExcelDataGAT?list='+listStr;
var a = document.createElement("a");
document.body.appendChild(a);
a.href = encodeURI(url);
a.click();
$scope.doSearchGongan();
}
};
$scope.taskId=-1;
$scope.showPoliceList = function(index) {
if($scope.taskId==-1){
......@@ -116,6 +132,7 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
};
if($rootScope.loginData.login==true){
$scope.doSearchGongan();
$scope.process= $rootScope.loginData.roleList[0].process;
}
$scope.searchHistory = function (str) {
......
<div class="content row">
<div class="col-md-12" style="margin-top:20px;">
<div class="box">
<strong class="box-header">港澳台跟踪文件上传</strong>
<div class="box-primary">
<table class="table table-bordered text-center">
<tr>
<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"
ng-model="choseDate"
id="datepicker1" readonly/>
</div>
</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"
ng-model="choseDate" id="datepicker2" readonly/>
</div>
</td>
</tr>
<tr>
<td>选择Excel文件:</td>
<td colspan="2">
<input type="file"
id="id_file_photo_for_check"
class="file"
data-show-preview="false"
data-allowed-file-extensions='["XLS","xls","XLSX","xlsx"]'
multiple/>
</td>
<td>
<div style="float: left">
<button class="btn btn-primary" ng-click="uploadExcel()">上传</button>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="box ">
<strong class="box-header with-border">跟踪文件管理</strong>
<div class="box box-primary" style="margin-bottom: 0;">
<table class="table table-bordered text-center" style="margin-bottom: 0;">
<tr>
<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"
id="datepicker3" ng-model="choseDate" readonly/>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</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"
id="datepicker" ng-model="choseDate" readonly/>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td>
<td>
<button class="btn btn-primary" ng-click="getGATTrack()">查询</button>
</td>
</tr>
</table>
</div>
<div class="box-info" style="padding-top: 0;">
<table class="table table-bordered text-center">
<thead>
<tr>
<th>NO.</th>
<th>文件起始日期</th>
<th>文件截至日期</th>
<th>文件名</th>
<th>数量</th>
<th>上传时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in GATTrack|orderBy:'ID'">
<td>{{$index + 1}}</td>
<td>{{item.TIME_EX | myDateFilter}}</td>
<td>{{item.TIME_EN | myDateFilter}}</td>
<td>{{item.FILE_NAME}}</td>
<td class="text-blue">{{item.NUMSTR}}</td>
<td>{{item.UPLOAD_TIME | myDateFilter}}</td>
<td>
<button class="btn btn-danger" ng-disabled="(item.UPLOAD_TIME | limitTo:8:0)!=thisDate"
ng-click="deleteGATTrack(item.ID,item.UPLOAD_TIME,item.NUMSTR)">删除
</button>
</td>
</tr>
</tbody>
</table>
<div class="box-body" ng-if="GATTrack.length==0"><h4>暂无记录</h4></div>
</div>
</div>
</div>
</div>
'use strict';
angular.module('AvatarCheck.gatTrack', ['ngRoute', 'AvatarCheck.http', 'tm.pagination'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/gatTrack', {
templateUrl: 'views/gatTrack/gatTrack.html' + urlTimeStamp(),
controller: 'gatTrackCtrl',
cache: false
});
}])
.controller('gatTrackCtrl', function ($scope, $rootScope, $timeout, HttpService, $filter, $interval, MessageService, ngDialog) {
$("#id_file_photo_for_check").fileinput({
language: 'zh',
showUpload: false,
showCaption: true,
maxFileCount: 1024,
showPreview: true,
maxFileSize: 1024 * 30
});
$('#datepicker1').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-MM-dd',
todayBtn: 1,
autoclose: 1
});
$('#datepicker2').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-MM-dd',
todayBtn: 1,
autoclose: 1
});
$('#datepicker3').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-MM-dd',
todayBtn: 1,
autoclose: 1
});
$('#datepicker').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-MM-dd',
todayBtn: 1,
autoclose: 1
});
//清除的代码
$(".glyphicon-remove").click(function(){
$($($(this).parent()).prev()).val("");
})
$scope.choseDate = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.thisDate = $filter("date")(new Date(), "yyyyMMdd");
$scope.getGATTrack = function(){
var date1=$("#datepicker3").val()
var date2=$("#datepicker").val()
if (date1==""){
date1=$scope.choseDate;
}
if (date2==""){
date2=$scope.choseDate;
}
HttpService.selectGATTrack(date1,date2,function (data) {
$scope.GATTrack=data.respData;
console.log($scope.GATTrack)
})
}
$scope.getGATTrack();
var getGAT= $scope.getGATTrack;
$scope.uploadExcel = function () {
var fd = new FormData();
var files = document.querySelector('input#id_file_photo_for_check').files;
if(files.length==0){
MessageService.showAlert("请选择上传的文件...")
}else{
for(var i in files){
fd.append('file', files[i]);
}
ngDialog.openConfirm({
template: 'dialogs/alert.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument:false,
controller: ['$scope', function ($scope) {
$scope.wrongMsg =-1;
$scope.msgText = "上传中,请稍等..."
var date1=$("#datepicker1").val()
var date2=$("#datepicker2").val()
if (date1==""){
date1=$scope.choseDate;
}
if (date2==""){
date2=$scope.choseDate;
}
HttpService.uploadGATFile(date1,date2,fd,function (data) {
$scope.msgText =data.msg;
getGAT();
})
}]
});
}
}
$scope.deleteGATTrack = function(fileid,date,total){
ngDialog.open({
template: 'dialogs/confirm.html' + urlTimeStamp(),
width: 600,
cache: false,
closeByDocument:false,
controller: ['$scope', function ($scope) {
$scope.wrongMsg =-1;
$scope.total = total;
$scope.importDate = $filter('myDateFilter')(date, 'yyyy-MM-dd');
$scope.fileid=fileid;
$scope.confirmDelete = function () {
HttpService.deleteByGATTrFileId(fileid, function (data) {
// MessageService.showAlert(data.msg);
if(data.msg){
$scope.closeThisDialog();
getGAT();
}else{
$scope.wrongMsg ="删除失败";
}
})
};
}]
});
}
});
\ No newline at end of file
......@@ -54,9 +54,6 @@ angular.module('AvatarCheck.historyTagPrint', ['ngRoute', 'AvatarCheck.http', 't
$scope.tagPrintHistoryData[i].show = true;
//给当前封签加上选中样式
$scope.tagPrintHistoryData[i].styleClass="bg-info";
console.log($scope.tagPrintHistoryData[i].show);
console.log($scope.tagPrintHistoryData[i].styleClass);
console.log($scope.tagPrintHistoryData[i]);
//展示详单页面
$scope.showDetail($scope.tagPrintHistoryData[i]);
}
......
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