Commit 220e4483 authored by suichenguang's avatar suichenguang

交接单修改3.0

parent 90c70513
......@@ -31,79 +31,107 @@ public class ReceiptApi {
*/
@RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> createReceiptList(@RequestParam("id") String id) {
public boolean createReceiptList(@RequestParam("id") String id) {
//判断是否是特证
if (receiptService.selectSpecialCardByAcceptNo(id)==1){
//查询特证交接单所需数据
Map<String,Object> resultDate =receiptService.selectReceiptListDate(id);
String acceptNo = (String) resultDate.get("ACCEPT_NO");
String GAJG_DM = (String) resultDate.get("GAJG_DM");
int state = 0;
int count = (int) resultDate.get("COUNT");
//生成特证交接单
receiptService.createReceiptList(acceptNo, GAJG_DM, count,state);
System.out.println("6666666666666666666666666666666生成成功");
//查询特证详单所需数据
Map<String,Object> detailedData= receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId =Integer.parseInt((BigDecimal)detailedData.get("ID")+"");
//生成特证详单
System.out.println("22222222222222222222Name:"+name);
receiptService.createDetailedList(uploadNo,acceptNo2,name,id,gajg_dm,receiptId);
}else {
if (receiptService.selectSpecialCardByAcceptNo(id) == 1) {
//查询这个受理号是否生成了交接单
int countAccept = receiptService.selectCountById(id);
//判断是否生成了交接单
if (countAccept == 0) {
//查询特证交接单所需数据
Map<String, Object> resultDate = receiptService.selectReceiptListDate(id);
String acceptNo = (String) resultDate.get("ACCEPT_NO");
String GAJG_DM = (String) resultDate.get("GAJG_DM");
int state = 0;
int count = (int) resultDate.get("COUNT");
//生成特证交接单
receiptService.createReceiptList(acceptNo, GAJG_DM, count, state);
//查询特证详单所需数据
Map<String, Object> detailedData = receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId);
} else {
//已经生成特证交接单,不做操作。
}
} else {
//查询交接单所需数据
Map<String, Object> receiptListDate = receiptService.selectReceiptListDate(id);
String groupNo = (String) receiptListDate.get("GROUP_NO");
String GAJG_DM = (String) receiptListDate.get("GAJG_DM");
int count = Integer.valueOf(receiptListDate.get("VALID_COUNT").toString()) ;
int count = Integer.valueOf(receiptListDate.get("VALID_COUNT").toString());
int state = 0;
//查询这个组号是否生成了交接单
int countGroup = receiptService.selectByGroupNo(groupNo);
//没有生成交接单
if (countGroup == 0) {
receiptService.createReceiptList(groupNo,GAJG_DM,count,state);
System.out.println("6666666666666666666666666666666生成成功");
Map<String,Object> detailedData= receiptService.selectDetailedData(id);
System.out.println("555555555555555555555555detailedData"+detailedData);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId =Integer.parseInt((BigDecimal)detailedData.get("ID")+"");
//生成特证详单
System.out.println("22222222222222222222Name:"+name);
receiptService.createDetailedList(uploadNo,acceptNo2,name,id,gajg_dm,receiptId);
//生成交接单
receiptService.createReceiptList(groupNo, GAJG_DM, count, state);
//查询这个身份证是否生成了详单
int receiptCount = receiptService.selectReceiptById(id);
//没有生成交接单详单
if (receiptCount == 0) {
Map<String, Object> detailedData = receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId);
} else {
//不做操作
}
} else {
//查询交接单详单数据
Map<String,Object> detailedData= receiptService.selectDetailedData(id);
System.out.println(String.valueOf("0000000000000000"+detailedData));
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId =Integer.parseInt((BigDecimal)detailedData.get("ID")+"");
//生成特证详单
receiptService.createDetailedList(uploadNo,acceptNo2,name,id,gajg_dm,receiptId);
System.out.println(receiptId);
//已生成交接单
//查询这个身份证是否生成了详单
int receiptCount = receiptService.selectReceiptById(id);
//未生成交接单详单
if (receiptCount == 0) {
//查询交接单详单数据
Map<String, Object> detailedData = receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId);
} else {
//已生成详单,不做操作。
}
}
//查询有几个
int specialCardCount =receiptService.selectSpecialCard(groupNo);
int finishCount= receiptService.selectCount(groupNo) -specialCardCount;
System.out.println("77777777777777777777777777777777"+finishCount);
receiptService.updateFinishCount(groupNo,finishCount);
System.out.println("..............................................111111");
//查询有几个特证
int specialCardCount = receiptService.selectSpecialCard(groupNo);
//减去特证个数
int finishCount = receiptService.selectCount(groupNo) - specialCardCount;
receiptService.updateFinishCount(groupNo, finishCount);
}
System.out.println("9999999999999999999999999999999999999");
List<Map<String,Object>> resultList=receiptService.selectReceiptListOfSpecialCard();
System.out.println("33333333333333333333resultList"+resultList);
return resultList;
return true;
}
/**
* 查询交接单数据
* @return
*/
@RequestMapping("selectRecriptData")
public List<Map<String,Object>> selectRecriptData(){
//返回交接单数据
List<Map<String,Object>> resultMap=receiptService.selectReceiptListOfSpecialCard();
for (int i=0;i<resultMap.size();i++){
String groupNo= (String) resultMap.get(i).get("QR_CODE");
Map<String,Object> map= receiptService.selectCountTime(groupNo);
resultMap.get(i).put("download",map.get("download"));
resultMap.get(i).put("checkerCount",map.get("checkerCount"));
resultMap.get(i).put("electricCount",map.get("electricCount"));
}
return resultMap;
}
// /**
......@@ -128,27 +156,32 @@ 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 groupNo= (String) resultList.get(i).get("QR_CODE");
Map<String,Object> map= receiptService.selectTimes(groupNo);
resultList.get(i).put("downloadDate",map.get("downloadDate"));
resultList.get(i).put("checkDate",map.get("checkDate"));
resultList.get(i).put("electricDate",map.get("electricDate"));
}
return resultList;
}
/**
* 数据核验
* 数据核验--更改交接单状态
* @param receiptId
* @param checkName
* @return
*/
@RequestMapping("updateReceiptList")
public boolean updateReceiptList(@RequestParam("receiptId")int receiptId,@RequestParam("checkName") String checkName){
public boolean updateReceiptList(@RequestParam("receiptId")String receiptId,@RequestParam("checkName") String checkName){
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
try {
Date date=dt.parse(dt.format(new Date()));
receiptService.updateReceiptList(receiptId,checkName,date);
Date date = dt.parse(dt.format(new Date()));
receiptService.updateReceiptList(receiptId, checkName, date);
} catch (ParseException e) {
e.printStackTrace();
}
return true;
}
}
......@@ -65,11 +65,10 @@ public interface ReceiptMapper {
//根据身份证号查询特证交接单
//查询未复核交接单
@Select("SELECT RECEIPT_LIST.* FROM RECEIPT_LIST where state=0\n")
public List<Map<String,Object>>selectReceiptListOfSpecialCard ();
//根据身份证号查询普通证交接单
@Select("SELECT RECEIPT_LIST.* FROM RECEIPT_LIST \n" +
"LEFT JOIN PROD_CARD_T@PROD_LINK ON subStr(PROD_CARD_T.ACCEPT_NO,0,8) =RECEIPT_LIST.QR_CODE\n" +
......@@ -87,9 +86,48 @@ public interface ReceiptMapper {
"check_date = #{date},\n" +
"check_name=#{checkName} \n" +
"where id=#{receiptId}")
public boolean updateReceiptList(int receiptId, String checkName, Date date);
public boolean updateReceiptList(String receiptId, String checkName, Date date);
//根据输入id查询交接单是否生成
@Select("select count(*) from RECEIPT_LIST where QR_CODE=(select accept_no from prod_card_t@prod_link where id_no=#{id})")
public int selectCountById(@Param("id") String id);
//根据输入id查询是否生成详单
@Select("select count(*) from DETAIL_RECEIPT_LIST where ACCEPT_NO=(select accept_no from prod_card_t@prod_link where id_no=#{id})")
public int selectReceiptById(@Param("id") String id);
//复核一致,按交接单编号查询证件数量
@Select("select FINISH_COUNT from RECEIPT_LIST WHERE ID=#{receiptId}")
public int selectCountByReceiptId(@Param("receiptId")String receiptId);
//符合一致,按交接单编号查询详单库数量
public int selectDetailCountByReceiptId(@Param("receiptId")String receiptId);
@Select("SELECT RECEIPT_LIST.*FROM RECEIPT_LIST where state=0;\n" +
"select \n" +
"count(prod_trace_t.download_no)as download,\n" +
"count(prod_trace_t.checker_no) as checkerCount,\n" +
"count(prod_trace_t.ELECTRIC_WRITER_NO)as electricCount\n" +
"from prod_trace_t@PROD_LINK \n" +
"WHERE subStr(ACCEPT_NO,0,8) = #{groupNo} or ACCEPT_NO=#{groupNo}")
public Map<String,Object> selectCountTime(String groupNo);
@Select("SELECT RECEIPT_LIST.*FROM RECEIPT_LIST where state=0;\n" +
"select \n" +
"prod_trace_t.DOWNLOAD_DATE as downloadDate,\n" +
"prod_trace_t.CHECK_DATE as checkDate,\n" +
"prod_trace_t.ELECTRIC_WRITE_DATE as electricDate\n" +
"from prod_trace_t@PROD_LINK \n" +
"WHERE subStr(ACCEPT_NO,0,8) = #{groupNo} or ACCEPT_NO=#{groupNo}")
public Map<String,Object>selectTimes(String groupNo);
}
......@@ -28,9 +28,29 @@ public interface ReceiptService {
public List<Map<String,Object>> selectDetailList(String receiptId);
public boolean updateReceiptList(int receiptId, String checkName, Date date);
public boolean updateReceiptList(String receiptId, String checkName, Date date);
public int selectCount(String GROUP_NO);
public boolean updateFinishCount(String GROUP_NO,int count);
//特证查询是否生成交接单
public int selectCountById(@Param("id") String id);
//查询是否已生成交接单详单
public int selectReceiptById(@Param("id") String id);
//复核一致,按交接单编号查询证件数量
public int selectCountByReceiptId(@Param("receiptId")String receiptId);
//符合一致,按交接单编号查询详单库数量
public int selectDetailCountByReceiptId(@Param("receiptId")String receiptId);
public Map<String,Object> selectCountTime(String groupNo);
public Map<String,Object> selectTimes(String groupNo);
}
......@@ -77,7 +77,7 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public boolean updateReceiptList(int receiptId, String checkName, Date date) {
public boolean updateReceiptList(String receiptId, String checkName, Date date) {
receiptMapper.updateReceiptList(receiptId, checkName, date);
return true;
}
......@@ -94,5 +94,39 @@ public class ReceiptServiceImpl implements ReceiptService {
return true;
}
@Override
public int selectCountById(String id) {
int countAccept= receiptMapper.selectCountById(id);
return countAccept;
}
@Override
public int selectReceiptById(String id) {
int receiptCount = receiptMapper.selectReceiptById(id);
return receiptCount;
}
@Override
public int selectCountByReceiptId(String receiptId) {
int finishCount = selectCountByReceiptId(receiptId);
return finishCount;
}
@Override
public int selectDetailCountByReceiptId(String receiptId) {
int detailCount = selectDetailCountByReceiptId(receiptId);
return detailCount;
}
@Override
public Map<String, Object> selectCountTime(String groupNo) {
Map<String, Object> maps = receiptMapper.selectCountTime(groupNo);
return maps;
}
@Override
public Map<String, Object> selectTimes(String groupNo) {
Map<String, Object> maps = receiptMapper.selectTimes(groupNo);
return maps;
}
}
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