Commit 6aa5dbf5 authored by dahai's avatar dahai

修改下载XML

parent 31c8a440
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/3/4 18:45
*/
@Entity
@Table(name = "NEW_FILES", schema = "YINGXIN", catalog = "")
public class NewFilesEntity {
private String versionCode;
private String dwdm;
private String dwmc;
private Long recordNumber;
private String createDate;
private String newFileName;
private String newTime;
private long id;
@Basic
@Column(name = "VERSION_CODE")
public String getVersionCode() {
return versionCode;
}
public void setVersionCode(String versionCode) {
this.versionCode = versionCode;
}
@Basic
@Column(name = "DWDM")
public String getDwdm() {
return dwdm;
}
public void setDwdm(String dwdm) {
this.dwdm = dwdm;
}
@Basic
@Column(name = "DWMC")
public String getDwmc() {
return dwmc;
}
public void setDwmc(String dwmc) {
this.dwmc = dwmc;
}
@Basic
@Column(name = "RECORD_NUMBER")
public Long getRecordNumber() {
return recordNumber;
}
public void setRecordNumber(Long recordNumber) {
this.recordNumber = recordNumber;
}
@Basic
@Column(name = "CREATE_DATE")
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "NEW_FILE_NAME")
public String getNewFileName() {
return newFileName;
}
public void setNewFileName(String newFileName) {
this.newFileName = newFileName;
}
@Basic
@Column(name = "NEW_TIME")
public String getNewTime() {
return newTime;
}
public void setNewTime(String newTime) {
this.newTime = newTime;
}
@Id
@Column(name = "ID")
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NewFilesEntity that = (NewFilesEntity) o;
return id == that.id &&
Objects.equals(versionCode, that.versionCode) &&
Objects.equals(dwdm, that.dwdm) &&
Objects.equals(dwmc, that.dwmc) &&
Objects.equals(recordNumber, that.recordNumber) &&
Objects.equals(createDate, that.createDate) &&
Objects.equals(newFileName, that.newFileName) &&
Objects.equals(newTime, that.newTime);
}
@Override
public int hashCode() {
return Objects.hash(versionCode, dwdm, dwmc, recordNumber, createDate, newFileName, newTime, id);
}
}
......@@ -3,6 +3,10 @@ package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/3/4 20:09
*/
@Entity
@Table(name = "PREPRO_PERSON", schema = "YINGXIN", catalog = "")
public class PreproPersonEntity {
......@@ -30,9 +34,9 @@ public class PreproPersonEntity {
private String sjrYzbm;
private String sjrTxdz;
private String sid;
private String fileName;
private Long fileId;
private Long cardTypeId;
private String newFileName;
private Long newFileId;
private Long state;
@Id
......@@ -276,13 +280,13 @@ public class PreproPersonEntity {
}
@Basic
@Column(name = "FILE_NAME")
public String getFileName() {
return fileName;
@Column(name = "FILE_ID")
public Long getFileId() {
return fileId;
}
public void setFileName(String fileName) {
this.fileName = fileName;
public void setFileId(Long fileId) {
this.fileId = fileId;
}
@Basic
......@@ -296,13 +300,13 @@ public class PreproPersonEntity {
}
@Basic
@Column(name = "NEW_FILE_NAME")
public String getNewFileName() {
return newFileName;
@Column(name = "NEW_FILE_ID")
public Long getNewFileId() {
return newFileId;
}
public void setNewFileName(String newFileName) {
this.newFileName = newFileName;
public void setNewFileId(Long newFileId) {
this.newFileId = newFileId;
}
@Basic
......@@ -344,14 +348,14 @@ public class PreproPersonEntity {
Objects.equals(sjrYzbm, that.sjrYzbm) &&
Objects.equals(sjrTxdz, that.sjrTxdz) &&
Objects.equals(sid, that.sid) &&
Objects.equals(fileName, that.fileName) &&
Objects.equals(fileId, that.fileId) &&
Objects.equals(cardTypeId, that.cardTypeId) &&
Objects.equals(newFileName, that.newFileName) &&
Objects.equals(newFileId, that.newFileId) &&
Objects.equals(state, that.state);
}
@Override
public int hashCode() {
return Objects.hash(jmsfzslh, gmsfhm, xm, xbdm, mzdm, csrq, ssxqdm, dzmc, sdxp, zwyZwtxsj, zwyZwtzsj, zweZwtxsj, zweZwtzsj, qfjgGajgmc, yxqqsrq, yxqjzrq, jmsfzslyydm, jmsfzzzlxdm, jmsfzlzfsdm, sjrXm, sjrLxdh, sjrYzbm, sjrTxdz, sid, fileName, cardTypeId, newFileName, state);
return Objects.hash(jmsfzslh, gmsfhm, xm, xbdm, mzdm, csrq, ssxqdm, dzmc, sdxp, zwyZwtxsj, zwyZwtzsj, zweZwtxsj, zweZwtzsj, qfjgGajgmc, yxqqsrq, yxqjzrq, jmsfzslyydm, jmsfzzzlxdm, jmsfzlzfsdm, sjrXm, sjrLxdh, sjrYzbm, sjrTxdz, sid, fileId, cardTypeId, newFileId, state);
}
}
package com.yxproject.start.entity.TaskList;
import org.springframework.stereotype.Component;
@Component
public class CountCountyEntity {
private String countyName;
private Integer countyCount;
......
package com.yxproject.start.entity.TaskList;
import org.springframework.stereotype.Component;
@Component
public class CountGajgEntity {
private String gajgName;
private Integer gajgCount;
......
package com.yxproject.start.entity.TaskList;
import org.springframework.stereotype.Component;
@Component
public class TaskListEntity {
private String countyName;
private String gajgName;
......
package com.yxproject.start.mapper;
import com.yxproject.start.entity.NewFilesEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;
/**
* @auther zhangyusheng
* 2019/3/4 18:46
*/
@Mapper
public interface NewFilesMapper {
@Insert("INSERT INTO NEW_FILES (VERSION_CODE,DWDM,DWMC,RECORD_NUMBER,CREATE_DATE) VALUES (#{versionCode},#{dwdm},#{dwmc},#{recordNumber},#{createDate})")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
public long saveNewFiles(NewFilesEntity newFilesEntity);
@Update("UPDATE NEW_FILES SET NEW_FILE_NAME = #{newFileName} WHERE ID = #{id}")
public boolean updateNewFileName(NewFilesEntity newFilesEntity);
}
......@@ -31,56 +31,35 @@ public interface PreproPersonMapper {
"<if test='uploadNo != null '>"+
"and PREPRO_PERSON.JMSFZSLH = #{uploadNo}"+
"</if>"+
// "<if test='uploadNo != "''" '>"+
// "and PREPRO_PERSON.JMSFZSLH = #{uploadNo}"+
// "</if>"+
" <if test='IDCard != null '> ",
"and GMSFHM = #{IDCard} ",
"</if> " ,
// " <if test='IDCard != '' '> ",
// "and GMSFHM = #{IDCard} ",
// "</if> " ,
" <if test='oldFile != null '> ",
"and files.SOURCE_FILE_NAME =#{oldFile} ",
" </if> " ,
// " <if test='oldFile != '' '> ",
// "and files.SOURCE_FILE_NAME =#{oldFile} ",
// " </if> " ,
" <if test='newFile != null'> ",
"and NEW_FILES.NEW_FILE_NAME = #{newFile}",
" </if> " ,
// " <if test='newFile != '' '> ",
// "and NEW_FILES.NEW_FILE_NAME = #{newFile}",
// " </if> " ,
" <if test='SSXQDM != null '> ",
"and PREPRO_PERSON.SSXQDM =#{SSXQDM}",
" </if>" ,
// " <if test='SSXQDM != '' '> ",
// "and PREPRO_PERSON.SSXQDM =#{SSXQDM}",
// " </if> " ,
" <if test='cardType != null '>",
" and PREPRO_PERSON.CARD_TYPE_ID =#{cardType}",
" </if> " ,
// " <if test='cardType != '' '>",
// " and PREPRO_PERSON.CARD_TYPE_ID =#{cardType}",
// " </if> " ,
" <if test='state != null'>",
" and PREPRO_PERSON.state = #{state}",
" </if> " ,
// " <if test='state != '' '>",
// " and PREPRO_PERSON.state = #{state}",
// " </if> " ,
" <if test='uploadDate != null '>",
" and files.CREAT_TIME = #{uploadDate}",
" </if> ",
// " <if test='uploadDate != '' '>",
// " and files.CREAT_TIME = #{uploadDate}",
// " </if> ",
" <if test='IDCard != null '> ",
"and GMSFHM = #{IDCard} ",
"</if> " ,
" <if test='oldFile != null '> ",
"and files.SOURCE_FILE_NAME =#{oldFile} ",
" </if> " ,
" <if test='newFile != null'> ",
"and NEW_FILES.NEW_FILE_NAME = #{newFile}",
" </if> " ,
" <if test='SSXQDM != null '> ",
"and PREPRO_PERSON.SSXQDM =#{SSXQDM}",
" </if>" ,
" <if test='cardType != null '>",
" and PREPRO_PERSON.CARD_TYPE_ID =#{cardType}",
" </if> " ,
" <if test='state != null'>",
" and PREPRO_PERSON.state = #{state}",
" </if> " ,
" <if test='uploadDate != null '>",
" and files.CREAT_TIME = #{uploadDate}",
" </if> ",
"</where>"+
"</script>"})
public List<PreproPersonEntity> selectPreproPerson(@Param("uploadNo")String uploadNo, @Param("IDCard")String IDCard, @Param("oldFile")String oldFile, @Param("newFile")String newFile, @Param("SSXQDM")String SSXQDM, @Param("cardType")long cardType, @Param("state")String state, @Param("uploadDate")String uploadDate);
public List<PreproPersonEntity> selectPreproPerson(@Param("uploadNo")String uploadNo, @Param("IDCard")String IDCard, @Param("oldFile")String oldFile, @Param("newFile")String newFile, @Param("SSXQDM")String SSXQDM, @Param("cardType")String cardType, @Param("state")String state, @Param("uploadDate")String uploadDate);
/*修改标记制证数据状态*/
@Update("UPDATE PREPRO_PERSON SET STATE = #{state} WHERE JMSFZSLH=#{acceptNo}")
public boolean updateState (@Param("state")String state, @Param("acceptNo") String acceptNo);
@Update("UPDATE PREPRO_PERSON SET NEW_FILE_ID=#{newFileId} where JMSFZSLH=#{jmsfzslh}")
public boolean updateNewFileName(PreproPersonEntity personEntity);
}
\ No newline at end of file
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
......@@ -9,6 +10,6 @@ import org.apache.ibatis.annotations.Select;
*/
@Mapper
public interface QuerySequenceMapper {
@Select("select #{sequenceName} from dual")
public String selectSequenceNextValue(String sequenceName);
@Select("select #{sequenceName},#{sequenceName} as num2 from dual")
public Object[] selectSequenceNextValue(@Param("sequenceName") String sequenceName);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.NewFilesEntity;
/**
* @auther zhangyusheng
* 2019/3/4 18:47
*/
public interface NewFilesService {
public long saveNewFiles(NewFilesEntity newFilesEntity);
public boolean updateNewFileName(NewFilesEntity newFilesEntity);
}
......@@ -25,4 +25,5 @@ public interface PersonPostService {
public boolean deletePersonalData(String applicantName,String orderNumber,String state,String latticeMouthInformation,List<String> getToCounty,String uploadDate);
}
......@@ -14,4 +14,6 @@ public interface PreproPersonService {
public List<PreproPersonEntity> selectPreproPerson(String uploadNo, String IDCard, String oldFile, String newFile, String SSXQDM, String cardType, String state, String uploadDate);
public boolean updatePreproPerson_NewFileName(List<PreproPersonEntity> preproPersonEntities);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.NewFilesEntity;
import com.yxproject.start.mapper.NewFilesMapper;
import com.yxproject.start.service.NewFilesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @auther zhangyusheng
* 2019/3/4 18:52
*/
@Service
public class NewFilesServiceImpl implements NewFilesService {
@Autowired
private NewFilesMapper newFilesMapper;
@Override
public long saveNewFiles(NewFilesEntity newFilesEntity) {
return newFilesMapper.saveNewFiles(newFilesEntity);
}
@Override
public boolean updateNewFileName(NewFilesEntity newFilesEntity) {
return newFilesMapper.updateNewFileName(newFilesEntity);
}
}
......@@ -24,7 +24,29 @@ public class PreproPersonServiceImpl implements PreproPersonService {
}
@Override
public List<PreproPersonEntity> selectPreproPerson(String uploadNo, String IDCard, String oldFile, String newFile, String SSXQDM, String cardType, String state, String uploadDate) {
List<PreproPersonEntity> preproPersonEntities = preproPersonMapper.selectPreproPerson("", "", "", "", "", 0, "", "");
List<PreproPersonEntity> preproPersonEntities = preproPersonMapper.selectPreproPerson(replace(uploadNo), replace(IDCard), replace(oldFile), replace(newFile), replace(SSXQDM), replace(cardType), replace(state), replace(uploadDate));
return preproPersonEntities;
}
private String replace(String str){
if ("".equals(str)){
return null;
}else {
return str;
}
}
/**
* 更新制证信息表中新文件名
* @param preproPersonEntities
* @return
*/
@Override
public boolean updatePreproPerson_NewFileName(List<PreproPersonEntity> preproPersonEntities) {
for (PreproPersonEntity preproPersonEntity: preproPersonEntities) {
preproPersonMapper.updateNewFileName(preproPersonEntity);
}
return true;
}
}
package com.yxproject.start.utils;
import com.yxproject.start.entity.FilesEntity;
import com.yxproject.start.entity.PreproPersonEntity;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import java.io.IOException;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/2/13 16:05
*/
public class ExportXml {
/**
* 生成单个可制证数据XML
*
* @throws IOException 可能出现文件写入不成功
*/
public static void createToMakePackageXML(List<PreproPersonEntity> preproPersonEntities , FilesEntity filesEntity, String url) throws IOException {
//todo
Document document = DocumentHelper.createDocument();
Element PACKAGE = DocumentHelper.createElement("PACKAGE");
document.setRootElement(PACKAGE);
Element PACKAGEHEAD = PACKAGE.addElement("PACKAGEHEAD");
Element DATA = PACKAGE.addElement("DATA");
Element DWDM = PACKAGEHEAD.addElement("DWDM");
DWDM.setText(filesEntity.getDwdm());
Element DWMC = PACKAGEHEAD.addElement("DWMC");
DWMC.setText(filesEntity.getDwmc());
Element JLS = PACKAGEHEAD.addElement("JLS");
JLS.setText(preproPersonEntities.size()+"");
int NO=1;
for (PreproPersonEntity preproPersonEntity : preproPersonEntities) {
Element RECORD = DATA.addElement("RECORD");
RECORD.addAttribute("no", NO+"");
RECORD.addAttribute("sid", preproPersonEntity.getSid());
Element JMSFZSLH = RECORD.addElement("JMSFZSLH");
JMSFZSLH.setText(preproPersonEntity.getJmsfzslh());
Element GMSFHM = RECORD.addElement("GMSFHM");
GMSFHM.setText(preproPersonEntity.getGmsfhm());
Element XM = RECORD.addElement("XM");
XM.setText(replaceNullString(preproPersonEntity.getXm()));
Element XBDM = RECORD.addElement("XBDM");
XBDM.setText(replaceNullString(preproPersonEntity.getXbdm()));
Element MZDM = RECORD.addElement("MZDM");
MZDM.setText(replaceNullString(preproPersonEntity.getMzdm()));
Element CSRQ = RECORD.addElement("CSRQ");
CSRQ.setText(replaceNullString(preproPersonEntity.getCsrq()));
Element SSXQDM = RECORD.addElement("SSXQDM");
SSXQDM.setText(replaceNullString(preproPersonEntity.getSsxqdm()));
Element DZMC = RECORD.addElement("DZMC");
DZMC.setText(replaceNullString(preproPersonEntity.getDzmc()));
Element SDXP = RECORD.addElement("SDXP");
SDXP.setText(replaceNullString(preproPersonEntity.getSdxp()));
Element ZWY_ZWTXSJ = RECORD.addElement("ZWY_ZWTXSJ");
ZWY_ZWTXSJ.setText(replaceNullString(preproPersonEntity.getZwyZwtxsj()));
Element ZWY_ZWTZSJ = RECORD.addElement("ZWY_ZWTZSJ");
ZWY_ZWTZSJ.setText(replaceNullString(preproPersonEntity.getZwyZwtzsj()));
Element ZWE_ZWTXSJ = RECORD.addElement("ZWE_ZWTXSJ");
ZWE_ZWTXSJ.setText(replaceNullString(preproPersonEntity.getZweZwtxsj()));
Element ZWE_ZWTZSJ = RECORD.addElement("ZWE_ZWTZSJ");
ZWE_ZWTZSJ.setText(replaceNullString(preproPersonEntity.getZweZwtzsj()));
Element QFJG_GAJGMC = RECORD.addElement("QFJG_GAJGMC");
QFJG_GAJGMC.setText(replaceNullString(preproPersonEntity.getQfjgGajgmc()));
Element YXQQSRQ = RECORD.addElement("YXQQSRQ");
YXQQSRQ.setText(preproPersonEntity.getYxqqsrq());
Element YXQJZRQ = RECORD.addElement("YXQJZRQ");
YXQJZRQ.setText(preproPersonEntity.getYxqjzrq());
Element JMSFZSLYYDM = RECORD.addElement("JMSFZSLYYDM");
JMSFZSLYYDM.setText(preproPersonEntity.getJmsfzslyydm());
Element JMSFZZZLXDM = RECORD.addElement("JMSFZZZLXDM");
JMSFZZZLXDM.setText(preproPersonEntity.getJmsfzzzlxdm());
Element JMSFZLZFSDM = RECORD.addElement("JMSFZLZFSDM");
JMSFZLZFSDM.setText(preproPersonEntity.getJmsfzlzfsdm());
Element SJR_XM = RECORD.addElement("SJR_XM");
SJR_XM.setText(replaceNullString(preproPersonEntity.getSjrXm()));
Element SJR_LXDH = RECORD.addElement("SJR_LXDH");
SJR_LXDH.setText(replaceNullString(preproPersonEntity.getSjrLxdh()));
Element SJR_YZBM = RECORD.addElement("SJR_YZBM");
SJR_YZBM.setText(replaceNullString(preproPersonEntity.getSjrYzbm()));
Element SJR_TXDZ = RECORD.addElement("SJR_TXDZ");
SJR_TXDZ.setText(replaceNullString(preproPersonEntity.getSjrTxdz()));
NO++;
}
YXStringUtils.saveDom2File(document, url + "\\" + "ZAGL_ZZJH_" + ".xml");
}
/**
* 字符串去除空格
* @param str 原始字符串
* @return 返回新的字符串
*/
public static String replaceNullString(String str) {
if (str == null) return "";
else return str;
}
}
......@@ -13,8 +13,8 @@ public class QuerySequenceSercive {
@Autowired
private QuerySequenceMapper querySequenceMapper;
public String selectSequenceNextValue(String sequenceName){
String s = querySequenceMapper.selectSequenceNextValue(sequenceName + ".nextval()");
return s;
Object[] objects = querySequenceMapper.selectSequenceNextValue(sequenceName + ".nextval");
return "";
}
......
......@@ -5,5 +5,6 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<configuration>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
</configuration>
\ 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