Commit b6fa0fd3 authored by dahai's avatar dahai

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

parents c799060a 559ff0b7
......@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -32,58 +33,25 @@ public class ReceiptApi {
@RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@RequestParam("id") String id) {
//判断是否是特证
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");
String GAJG_MC = (String) resultDate.get("GAJG_MC");
String cardType = (String) resultDate.get("CARD_TYPE");
String oldCardType = (String) resultDate.get("OLD_CARD_TYPE");
int state = 0;
int count = (int) resultDate.get("COUNT");
//生成特证交接单
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) {
try {
//判断是否是特证
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");
String GAJG_MC = (String) resultDate.get("GAJG_MC");
String cardType = (String) resultDate.get("CARD_TYPE");
String oldCardType = (String) resultDate.get("OLD_CARD_TYPE");
int state = 0;
int count = (int) resultDate.get("COUNT");
//生成特证交接单
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");
......@@ -91,38 +59,76 @@ public class ReceiptApi {
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 {
//已生成交接单
//查询这个身份证是否生成了详单
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);
//查询交接单所需数据
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);
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 {
//已生成详单,不做操作。
//已生成交接单
//查询这个身份证是否生成了详单
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);
//减去特证个数
int finishCount = receiptService.selectCount(groupNo) - specialCardCount;
receiptService.updateFinishCount(groupNo, finishCount);
}catch (NullPointerException e){
return false;
}
return true;
}
......@@ -137,11 +143,8 @@ public class ReceiptApi {
List<Map<String,Object>> resultMap=receiptService.selectReceiptListOfSpecialCard();
for (int i=0;i<resultMap.size();i++){
String groupNo= (String) resultMap.get(i).get("QR_CODE");
System.out.println("1111111111111111111111111111"+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("",map.get(""));
resultMap.get(i).put("checkerCount",map.get("checkerCount"));
resultMap.get(i).put("electricCount",map.get("electricCount"));
}
......@@ -170,14 +173,20 @@ 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"));
try {
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"));
}
}catch (NullPointerException e){
return new ArrayList<>();
}
return resultList;
}
/**
......
......@@ -84,7 +84,7 @@ public interface ReceiptMapper {
//根据交接单号查详单信息
@Select("select * from detail_receipt_list where receipt=#{RECEIPT_ID}")
public List<Map<String,Object>> selectDetailList(String receiptId);
public List<Map<String,Object>> selectDetailList(@Param("receiptId") String receiptId);
//根据传入的交接单ID和复核人ID插入复核人、复核时间
......@@ -92,7 +92,7 @@ public interface ReceiptMapper {
"check_date = #{date},\n" +
"check_name=#{checkName} \n" +
"where id=#{receiptId}")
public boolean updateReceiptList(String receiptId, String checkName, Date date);
public boolean updateReceiptList(@Param("receiptId") String receiptId,@Param("checkName") String checkName,@Param("date") Date date);
......@@ -131,7 +131,7 @@ public interface ReceiptMapper {
"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);
public Map<String,Object>selectTimes(@Param("groupNo") String groupNo);
}
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