Commit 4b04af2e authored by liboyang's avatar liboyang

Merge remote-tracking branch 'origin/dev' into dev

parents f5d9d0cc f3583d35
......@@ -134,9 +134,8 @@ public class ExportExcelApi {
fis.read(b);
fis.close();
response.setCharacterEncoding("utf-8");
response.setContentType("APPLICATION/OCTET-STREAM");
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment;" + new String(outFile.getBytes(),"iso-8859-1") +".xls");
//
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
......
......@@ -114,7 +114,15 @@ public class LogApi {
List<Map<String,Object>> resultList = logService.selectFileIdByUploadDate(printDate);
//查询Excel文件信息
Map<String, Object> resultMap = logService.selectFileNameDic(fileId);
//更改解析状态
logService.changeFileState(fileId);
//查询身份数据
List<Map<String, Object>> dataList = logService.selectIdData(fileId);
System.out.println("0000000000000000000000000000000000"+dataList);
//将身份数据插入到邮寄表中
for (int i=0;i<dataList.size();i++){
logService.insertIdData((String) dataList.get(i).get("GMSFHM"),(String) dataList.get(i).get("SSXQDM"),(String) dataList.get(i).get("YXQQSRQ"),(String) dataList.get(i).get("YXQJZRQ"), (String) dataList.get(i).get("JMSFZSLH"));
}
List<Map<String,Object>> result = new ArrayList<>();
for (int i=0; i<resultList.size();i++){
String fileName=(BigDecimal)(resultList.get(i).get("ID"))+"";
......@@ -124,6 +132,7 @@ public class LogApi {
resultMap.put("commonCount",countMap.get("PUSUM"));
resultMap.put("postCount",countMap.get("YOUSUM"));
result.add(resultMap);
//生成解析表
logService.insertIntoAnalysis(fileId,fileName,String.valueOf(countMap.get("PUSUM")),String.valueOf(countMap.get("YOUSUM")));
}
return true;
......
......@@ -65,12 +65,12 @@ public class ReceiptApi {
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String sex = (String) detailedData.get("SEX");
String cardId = (String) detailedData.get("CARD_ID");
String sex = (String) detailedData.get("SEX_NO");
String signGovt = (String) detailedData.get("SIGN_GOVT");
String gajg_dm = (String) detailedData.get("GAJG_DM");
Long receiptId = receiptListEntity.getId();
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId, sex);
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId, sex,signGovt);
} else {
//已经生成特证交接单,不做操作。
}
......@@ -92,6 +92,7 @@ public class ReceiptApi {
}
receiptListEntity.setFinishCount((long) receiptListDate.size());
receiptListEntity.setQrCode(receiptListDate.get(i).get("GROUP_NO").toString());
// 状态0未复核
receiptListEntity.setState((long) 0);
//查询这个组号是否生成了交接单
int countGroup = receiptService.selectByGroupNo(receiptListDate.get(i).get("GROUP_NO").toString());
......@@ -112,10 +113,11 @@ public class ReceiptApi {
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String sex = (String) detailedData.get("SEX_NO");
String signGovt = (String) detailedData.get("SIGN_GOVT");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex);
receiptService.createDetailedList(uploadNo, acceptNo2, name, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex,signGovt);
} else {
//不做操作
}
......@@ -180,7 +182,6 @@ public class ReceiptApi {
*/
@RequestMapping("selectDetailList")
public List<Map<String, Object>> selectDetailList(@RequestParam("receiptId") String receiptId) {
List<Map<String, Object>> resultList = receiptService.selectDetailList(receiptId);
for (int i = 0; i < resultList.size(); i++) {
String acceptNo = (String) resultList.get(i).get("ACCEPT_NO");
......@@ -190,7 +191,6 @@ public class ReceiptApi {
resultList.get(i).put("electricDate", map.get("ELECTRICDATE"));
}
return resultList;
}
/**
......@@ -215,7 +215,6 @@ public class ReceiptApi {
/**
* 根据受理号查询详单信息
*
* @param jsonStr
* @return
*/
......@@ -226,20 +225,17 @@ public class ReceiptApi {
for (int i = 0; i < jsonarray.size(); i++) {
DetailReceiptListEntity detailReceiptListEntity = receiptService.selectDetailByAcceptNo((String) jsonarray.get(i));
resultList.add(detailReceiptListEntity);
}
return resultList;
}
/**
* 更改备注信息
*
* @param jsonStr
* @return
*/
@RequestMapping("updateDetailNote")
public boolean updateDetailNote(@RequestBody String jsonStr) {
JSONArray jsonArray = JSONArray.fromObject(jsonStr);
for (int i = 0; i < jsonArray.size(); i++) {
Map<String, Object> resultMap = (Map<String, Object>) jsonArray.get(i);
......
......@@ -20,6 +20,16 @@ public class DetailReceiptListEntity {
private String signGovt;
private Long receiptId;
private Long sex;
private String gajg_mc;
public String getGajg_mc() {
return gajg_mc;
}
public void setGajg_mc(String gajg_mc) {
this.gajg_mc = gajg_mc;
}
@Id
@Column(name = "ID")
......
......@@ -2,6 +2,7 @@ package com.yxproject.start.mapper;
import com.yxproject.start.entity.CountyDicEntity;
import org.apache.ibatis.annotations.*;
import org.omg.CORBA.PUBLIC_MEMBER;
import java.util.List;
import java.util.Map;
......@@ -32,9 +33,19 @@ public interface LogMapper {
public boolean changeCardType(@Param("printDate")String printDate,@Param("fileId")String fileId);
@Update(" update FILE_NAME_DIC set FILE_NAME_DIC.ANALYSIS_DATE = #{printDate} where file_id=#{fileId} ")
public boolean insertAnalysisDate(@Param("printDate")String printDate,@Param("fileId")String fileId);
/**
* 生成解析表
* @param fileDic
* @param fileId
* @param commonCardCount
* @param postCardCount
* @return
*/
@Insert("INSERT INTO ANALYSIS (FILE_DIC_ID,FILE_ID,COMMON_CARD_COUNT,POST_CARD_COUNT) VALUES (#{fileDic},#{fileId},#{commonCardCount},#{postCardCount})")
public boolean insertIntoAnalysis(@Param("fileDic")String fileDic,@Param("fileId")String fileId,@Param("commonCardCount")String commonCardCount,@Param("postCardCount")String postCardCount);
......@@ -156,6 +167,19 @@ public interface LogMapper {
public Map<String,Object> selectCountByCardType(@Param("fileId")String fileId);
//查询身份数据
@Select("select PREPRO_PERSON.JMSFZSLH, PREPRO_PERSON.GMSFHM,PREPRO_PERSON.YXQQSRQ,PREPRO_PERSON.YXQJZRQ,PREPRO_PERSON.SSXQDM FROM PREPRO_PERSON " +
"LEFT JOIN ANALYSIS ON ANALYSIS.FILE_ID = PREPRO_PERSON.FILE_ID " +
"LEFT JOIN PERSON_POST ON ANALYSIS.FILE_DIC_ID =PERSON_POST.FILE_ID " +
"WHERE PERSON_POST.FILE_ID=#{fileId}")
public List<Map<String,Object>> selectIdData(@Param("fileId")String fileId);
//身份数据插入person_post
@Update("UPDATE PERSON_POST SET ID_CARD=#{cardId},ACCEPT_THE_MATTER=#{issuing},BEGIN_USEFUL_LIFE=#{beginDate},VALID_PERIOD_END=#{endDate} where PERSON_POST.FIRST_WHITE=#{firstWhite}")
public boolean insertIdData(@Param("cardId")String cardId,@Param("issuing") String issuing,@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("firstWhite")String firstWhite );
/**
* 解析时更改Excel文件状态
* @param fileId
......
......@@ -29,7 +29,6 @@ public interface PersonPostMapper {
public List<PersonPostEntity> findAllByIdCardAndStartDateAndEndDate(@Param("idCard") String idCard, @Param("startDate")String startDate, @Param("endDate")String endDate);
//TODO getToCounty是List
@Select("<script> " +
"SELECT * FROM " +
......@@ -44,8 +43,8 @@ public interface PersonPostMapper {
" <when test='orderNumber!=\"\"'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" +
" <if test='state== 0 '> and PERSON_POST.print_date is null </if>" +
" <if test='state== 1 '> and PERSON_POST.print_date is not null </if>" +
" <if test='notNull== 1 '> and (PERSON_POST.ID_CARD is not null and PERSON_POST.ID_CARD > '') or (PERSON_POST.ACCEPT_THE_MATTER is not null and PERSON_POST.ACCEPT_THE_MATTER > '') or (PERSON_POST.BEGIN_USEFUL_LIFE is not null and PERSON_POST.BEGIN_USEFUL_LIFE > '') or (PERSON_POST.VALID_PERIOD_END is not null and PERSON_POST.VALID_PERIOD_END > '') </if>" +
" <if test='notNull== 0 '> and (PERSON_POST.ID_CARD in null) or (PERSON_POST.ACCEPT_THE_MATTER in null) or (PERSON_POST.BEGIN_USEFUL_LIFE in null) or (PERSON_POST.VALID_PERIOD_END in null) </if>" +
" <if test='notNull== 1 '> and (PERSON_POST.ID_CARD is not null ) or (PERSON_POST.ACCEPT_THE_MATTER is not null ) or (PERSON_POST.BEGIN_USEFUL_LIFE is not null ) or (PERSON_POST.VALID_PERIOD_END is not null ) </if>" +
" <if test='notNull== 0 '> and (PERSON_POST.ID_CARD is null) or (PERSON_POST.ACCEPT_THE_MATTER is null) or (PERSON_POST.BEGIN_USEFUL_LIFE is null) or (PERSON_POST.VALID_PERIOD_END is null) </if>" +
" <when test='latticeMouthInformation!=\"\"'> and PERSON_POST.LATTICE_MOUTH_INFORMATION=#{latticeMouthInformation} </when>" +
" <when test='getToCounty!=null'> and PERSON_POST.GET_TO_COUNTY in ( #{getToCounty} ) </when>" +
" <when test='uploadDate!=\"\"'> and subStr(FILE_NAME_DIC.UPLOAD_DATE,0,8)=#{uploadDate} </when>" +
......
......@@ -41,8 +41,6 @@ public interface ReceiptMapper {
"task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no ")
public List<Map<String,Object>> selectReceiptListDate2(String id);
//查询这个组号是否已经生成交接单
@Select("select count(*) from receipt_list where QR_CODE=#{groupNo}")
public int selectByGroupNo(String groupNo);
......@@ -68,10 +66,13 @@ public interface ReceiptMapper {
"prod_card_t.name," +
"prod_card_t.SEX_NO,"+
"prod_card_t.id_no," +
"GAJG_DM.GAJG_MC,"+
"PROD_CARD_T.SIGN_GOVT,"+
"subStr(prod_card_t.UPLOAD_NO,0,9) AS GAJG_DM," +
"receipt_list.ID\n" +
"from prod_card_t@PROD_LINK\n" +
"left join receipt_list on receipt_list.QR_CODE = subStr(prod_card_t.accept_no,0,8)\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = subStr(prod_card_t.UPLOAD_NO,0,9) "+
"left join receipt_list on receipt_list.QR_CODE = subStr(prod_card_t.accept_no,0,8) \n" +
"where prod_card_t.id_no=#{id}")
public Map<String,Object>selectDetailedData(String id);
......@@ -81,19 +82,22 @@ public interface ReceiptMapper {
"prod_card_t.name," +
"prod_card_t.SEX_NO,"+
"prod_card_t.id_no," +
"GAJG_DM.GAJG_MC,"+
"PROD_CARD_T.SIGN_GOVT,"+
"subStr(prod_card_t.UPLOAD_NO,0,9) AS GAJG_DM," +
"receipt_list.ID\n" +
"from prod_card_t@PROD_LINK\n" +
"left join receipt_list on receipt_list.QR_CODE =prod_card_t.accept_no\n" +
"from prod_card_t@PROD_LINK \n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = subStr(prod_card_t.UPLOAD_NO,0,9) "+
"left join receipt_list on receipt_list.QR_CODE =prod_card_t.accept_no \n" +
"where prod_card_t.id_no=#{id}")
public Map<String,Object>selectDetailedData2(String id);
//生成交接单详单
@Insert("INSERT INTO DETAIL_RECEIPT_LIST (UPLOAD_NO,accept_no,name,card_id,POLICE_CODE,RECEIPT_ID)" +
"VALUES(#{UPLOAD_NO},#{ACCEPT_NO},#{NAME},#{CARD_ID},#{GAJG_DM},#{RECEIPT_ID})")
public boolean createDetailedList(@Param("UPLOAD_NO")String UPLOAD_NO,@Param("ACCEPT_NO")String ACCEPT_NO,@Param("NAME")String NAME,@Param("CARD_ID")String CARD_ID,@Param("GAJG_DM")String GAJG_DM,@Param("RECEIPT_ID")long RECEIPT_ID,@Param("SEX")String SEX);
@Insert("INSERT INTO DETAIL_RECEIPT_LIST (UPLOAD_NO,accept_no,name,card_id,POLICE_CODE,RECEIPT_ID,SEX,SIGN_GOVT)" +
"VALUES(#{UPLOAD_NO},#{ACCEPT_NO},#{NAME},#{CARD_ID},#{GAJG_DM},#{RECEIPT_ID},#{SEX},#{signGovt})")
public boolean createDetailedList(@Param("UPLOAD_NO")String UPLOAD_NO,@Param("ACCEPT_NO")String ACCEPT_NO,@Param("NAME")String NAME,@Param("CARD_ID")String CARD_ID,@Param("GAJG_DM")String GAJG_DM,@Param("RECEIPT_ID")long RECEIPT_ID,@Param("SEX")String SEX,@Param("signGovt")String signGovt);
......@@ -186,7 +190,7 @@ public interface ReceiptMapper {
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) CARD_TYPE_ID,\n" +
"RECEIPT_LIST.FINISH_COUNT,GAJG_DM.GAJG_DM,GAJG_DM.GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",CARD_TYPE_DIC.CARD_TYPE,COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME from RECEIPT_LIST \n" +
",CARD_TYPE_DIC.CARD_TYPE,COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME,RECEIPT_LIST.state,RECEIPT_LIST.IS_PRINT from RECEIPT_LIST \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID)\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
......@@ -203,13 +207,24 @@ public interface ReceiptMapper {
public List<Map<String,Object>> selectReceiptDate(@Param("date") String date,@Param("string") String string,@Param("type") long type);
@Select("select * from DETAIL_RECEIPT_LIST where ACCEPT_NO=#{acceptNo} or card_id=#{acceptNo}")
@Select("select DETAIL_RECEIPT_LIST.* , GAJG_DM.GAJG_MC from DETAIL_RECEIPT_LIST LEFT JOIN GAJG_DM ON GAJG_DM.GAJG_DM =DETAIL_RECEIPT_LIST.POLICE_CODE where ACCEPT_NO=#{acceptNo} or card_id=#{acceptNo}")
@Options(useGeneratedKeys=true, keyProperty="gajg_mc", keyColumn="GAJG_MC")
public DetailReceiptListEntity selectDetailByAcceptNo(@Param("acceptNo") String acceptNo);
@Update("update DETAIL_RECEIPT_LIST set NOTE = #{note} WHERE ACCEPT_NO=#{acceptNo}")
public boolean updateDetail(@Param("acceptNo")String accept,@Param("note")String note);
/**
* 更新交接单是否已打印
* @param date 查询时间
* @param string 派出所代码
* @param type 制证类型
* @return
*/
@Update("update RECEIPT_LIST set IS_PRINT = 1 where to_char(CHECK_DATE,'yyyyMMdd') = ${date} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_ID=${type}")
public boolean updateReceiptDate(@Param("date") String date,@Param("string") String string,@Param("type") long type);
......
......@@ -42,4 +42,9 @@ public interface LogService {
public String selectByFileName(@Param("fileName")String fileName);
public boolean changeFileState(@Param("fileId") String fileId);
public List<Map<String,Object>> selectIdData(@Param("fileId")String fileId);
public boolean insertIdData(String cardId, String issuing,String beginDate,String endDate,String firstWhite );
}
......@@ -16,7 +16,7 @@ public interface ReceiptService {
public Map<String,Object>selectDetailedData(String id);
public boolean createDetailedList(String UPLOAD_NO,String ACCEPT_NO,String NAME,String CARD_ID,String GAJG_DM,long RECEIPT_ID,String SEX);
public boolean createDetailedList(String UPLOAD_NO,String ACCEPT_NO,String NAME,String CARD_ID,String GAJG_DM,long RECEIPT_ID,String SEX,String signGovt);
public int selectSpecialCard(String GROUP_NO);
......
......@@ -119,4 +119,16 @@ public class LogServiceImpl implements LogService {
logMapper.changeFileState(fileId);
return false;
}
@Override
public List<Map<String, Object>> selectIdData(String fileId) {
List<Map<String, Object>> resultList = logMapper.selectIdData(fileId);
return resultList;
}
@Override
public boolean insertIdData(String cardId, String issuing, String beginDate, String endDate,String firstWhite) {
logMapper.insertIdData(cardId,issuing,beginDate,endDate,firstWhite);
return true;
}
}
......@@ -33,8 +33,8 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public boolean createDetailedList(String UPLOAD_NO, String ACCEPT_NO, String NAME, String CARD_ID, String GAJG_DM, long RECEIPT_ID,String SEX) {
receiptMapper.createDetailedList(UPLOAD_NO,ACCEPT_NO,NAME,CARD_ID,GAJG_DM,RECEIPT_ID,SEX);
public boolean createDetailedList(String UPLOAD_NO, String ACCEPT_NO, String NAME, String CARD_ID, String GAJG_DM, long RECEIPT_ID,String SEX,String signGovt) {
receiptMapper.createDetailedList(UPLOAD_NO,ACCEPT_NO,NAME,CARD_ID,GAJG_DM,RECEIPT_ID,SEX,signGovt);
return true;
}
......@@ -164,6 +164,8 @@ public class ReceiptServiceImpl implements ReceiptService {
str+="'"+stringList.get(i)+"',";
}
}
//更改交接单已打印状态
boolean b = receiptMapper.updateReceiptDate(date, str, typeCode);
return receiptMapper.selectReceiptDate(date,str,typeCode);
}
......
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