Commit df1b4385 authored by suichenguang's avatar suichenguang

交接单4.5

parent c86d6e1c
...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -32,58 +33,25 @@ public class ReceiptApi { ...@@ -32,58 +33,25 @@ public class ReceiptApi {
@RequestMapping("createReceiptList") @RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@RequestParam("id") String id) { public boolean createReceiptList(@RequestParam("id") String id) {
//判断是否是特证 try {
if (receiptService.selectSpecialCardByAcceptNo(id) == 1) { //判断是否是特证
//查询这个受理号是否生成了交接单 if (receiptService.selectSpecialCardByAcceptNo(id) == 1) {
int countAccept = receiptService.selectCountById(id); //查询这个受理号是否生成了交接单
//判断是否生成了交接单 int countAccept = receiptService.selectCountById(id);
if (countAccept == 0) { //判断是否生成了交接单
//查询特证交接单所需数据 if (countAccept == 0) {
Map<String, Object> resultDate = receiptService.selectReceiptListDate(id); //查询特证交接单所需数据
String acceptNo = (String) resultDate.get("ACCEPT_NO"); Map<String, Object> resultDate = receiptService.selectReceiptListDate(id);
String GAJG_DM = (String) resultDate.get("GAJG_DM"); String acceptNo = (String) resultDate.get("ACCEPT_NO");
String GAJG_MC = (String) resultDate.get("GAJG_MC"); String GAJG_DM = (String) resultDate.get("GAJG_DM");
String cardType = (String) resultDate.get("CARD_TYPE"); String GAJG_MC = (String) resultDate.get("GAJG_MC");
String oldCardType = (String) resultDate.get("OLD_CARD_TYPE"); String cardType = (String) resultDate.get("CARD_TYPE");
int state = 0; String oldCardType = (String) resultDate.get("OLD_CARD_TYPE");
int count = (int) resultDate.get("COUNT"); int state = 0;
//生成特证交接单 int count = (int) resultDate.get("COUNT");
receiptService.createReceiptList(acceptNo, GAJG_DM, count, state,cardType,oldCardType,GAJG_MC); //生成特证交接单
//查询特证详单所需数据 receiptService.createReceiptList(acceptNo, GAJG_DM, count, state,cardType,oldCardType,GAJG_MC);
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 sex = (String) detailedData.get("SEX");
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,sex);
} else {
//已经生成特证交接单,不做操作。
}
} else {
//查询交接单所需数据
Map<String, Object> receiptListDate = receiptService.selectReceiptListDate(id);
System.out.println("111111111111111111111"+receiptListDate);
String groupNo = (String) receiptListDate.get("GROUP_NO");
String GAJG_DM = (String) receiptListDate.get("GAJG_DM");
String GAJG_MC = (String) receiptListDate.get("GAJG_MC");
String cardType = (String) receiptListDate.get("CARD_TYPE");
String oldCardType = (String) receiptListDate.get("OLD_CARD_TYPE");
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,cardType,oldCardType,GAJG_MC);
//查询这个身份证是否生成了详单
int receiptCount = receiptService.selectReceiptById(id);
//没有生成交接单详单
if (receiptCount == 0) {
Map<String, Object> detailedData = receiptService.selectDetailedData(id); Map<String, Object> detailedData = receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO"); String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO"); String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
...@@ -91,38 +59,76 @@ public class ReceiptApi { ...@@ -91,38 +59,76 @@ public class ReceiptApi {
String sex = (String) detailedData.get("SEX"); String sex = (String) detailedData.get("SEX");
String cardId = (String) detailedData.get("CARD_ID"); String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM"); String gajg_dm = (String) detailedData.get("GAJG_DM");
System.out.println("1111111111111111"+gajg_dm);
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + ""); int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成详单 //生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId,sex); receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId,sex);
} else { } else {
//不做操作 //已经生成特证交接单,不做操作。
} }
} else { } else {
//已生成交接单 //查询交接单所需数据
//查询这个身份证是否生成了详单 Map<String, Object> receiptListDate = receiptService.selectReceiptListDate(id);
int receiptCount = receiptService.selectReceiptById(id); System.out.println("111111111111111111111"+receiptListDate);
//未生成交接单详单 String groupNo = (String) receiptListDate.get("GROUP_NO");
if (receiptCount == 0) { String GAJG_DM = (String) receiptListDate.get("GAJG_DM");
//查询交接单详单数据 String GAJG_MC = (String) receiptListDate.get("GAJG_MC");
Map<String, Object> detailedData = receiptService.selectDetailedData(id); String cardType = (String) receiptListDate.get("CARD_TYPE");
String uploadNo = (String) detailedData.get("UPLOAD_NO"); String oldCardType = (String) receiptListDate.get("OLD_CARD_TYPE");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO"); int count = Integer.valueOf(receiptListDate.get("VALID_COUNT").toString());
String name = (String) detailedData.get("NAME"); int state = 0;
String sex = (String) detailedData.get("SEX"); //查询这个组号是否生成了交接单
String gajg_dm = (String) detailedData.get("GAJG_DM"); int countGroup = receiptService.selectByGroupNo(groupNo);
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + ""); //没有生成交接单
//生成详单 if (countGroup == 0) {
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId,sex); //生成交接单
receiptService.createReceiptList(groupNo, GAJG_DM, count, state,cardType,oldCardType,GAJG_MC);
//查询这个身份证是否生成了详单
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 sex = (String) detailedData.get("SEX");
String cardId = (String) detailedData.get("CARD_ID");
String gajg_dm = (String) detailedData.get("GAJG_DM");
System.out.println("1111111111111111"+gajg_dm);
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId,sex);
} else {
//不做操作
}
} else { } else {
//已生成详单,不做操作。 //已生成交接单
//查询这个身份证是否生成了详单
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 sex = (String) detailedData.get("SEX");
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,sex);
} else {
//已生成详单,不做操作。
}
} }
//查询有几个特证
int specialCardCount = receiptService.selectSpecialCard(groupNo);
//减去特证个数
int finishCount = receiptService.selectCount(groupNo) - specialCardCount;
receiptService.updateFinishCount(groupNo, finishCount);
} }
//查询有几个特证
int specialCardCount = receiptService.selectSpecialCard(groupNo); }catch (NullPointerException e){
//减去特证个数 return false;
int finishCount = receiptService.selectCount(groupNo) - specialCardCount;
receiptService.updateFinishCount(groupNo, finishCount);
} }
return true; return true;
} }
...@@ -137,11 +143,8 @@ public class ReceiptApi { ...@@ -137,11 +143,8 @@ public class ReceiptApi {
List<Map<String,Object>> resultMap=receiptService.selectReceiptListOfSpecialCard(); List<Map<String,Object>> resultMap=receiptService.selectReceiptListOfSpecialCard();
for (int i=0;i<resultMap.size();i++){ for (int i=0;i<resultMap.size();i++){
String groupNo= (String) resultMap.get(i).get("QR_CODE"); String groupNo= (String) resultMap.get(i).get("QR_CODE");
System.out.println("1111111111111111111111111111"+groupNo);
Map<String,Object> map= receiptService.selectCountTime(groupNo); Map<String,Object> map= receiptService.selectCountTime(groupNo);
System.out.println("22222222222222222222222222222"+map.get("download"));
resultMap.get(i).put("download",map.get("download")); resultMap.get(i).put("download",map.get("download"));
// resultMap.get(i).put("",map.get(""));
resultMap.get(i).put("checkerCount",map.get("checkerCount")); resultMap.get(i).put("checkerCount",map.get("checkerCount"));
resultMap.get(i).put("electricCount",map.get("electricCount")); resultMap.get(i).put("electricCount",map.get("electricCount"));
} }
...@@ -170,14 +173,20 @@ public class ReceiptApi { ...@@ -170,14 +173,20 @@ public class ReceiptApi {
@RequestMapping("selectDetailList") @RequestMapping("selectDetailList")
public List<Map<String,Object>> selectDetailList(@RequestParam("receiptId") String receiptId){ public List<Map<String,Object>> selectDetailList(@RequestParam("receiptId") String receiptId){
List<Map<String, Object>> resultList = receiptService.selectDetailList(receiptId); List<Map<String, Object>> resultList = receiptService.selectDetailList(receiptId);
for (int i=0;i<resultList.size();i++){ try {
String groupNo= (String) resultList.get(i).get("QR_CODE");
Map<String,Object> map= receiptService.selectTimes(groupNo); for (int i=0;i<resultList.size();i++){
resultList.get(i).put("downloadDate",map.get("downloadDate")); String groupNo= (String) resultList.get(i).get("QR_CODE");
resultList.get(i).put("checkDate",map.get("checkDate")); Map<String,Object> map= receiptService.selectTimes(groupNo);
resultList.get(i).put("electricDate",map.get("electricDate")); resultList.get(i).put("downloadDate",map.get("downloadDate"));
resultList.get(i).put("checkDate",map.get("checkDate"));
resultList.get(i).put("electricDate",map.get("electricDate"));
}
}catch (NullPointerException e){
return new ArrayList<>();
} }
return resultList; return resultList;
} }
/** /**
......
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