Commit 95c4a993 authored by suichenguang's avatar suichenguang

余证更改

parent e72a307a
...@@ -15,10 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -15,10 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/** /**
* 添加废证 * 添加废证
...@@ -72,11 +69,22 @@ public class FailedCardApi { ...@@ -72,11 +69,22 @@ public class FailedCardApi {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insertFailedCard(@RequestBody String jsonStr){ public Boolean insertFailedCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr); JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray){ for (Object o : jsonarray) {
JSONObject jsonObject =(JSONObject)o; JSONObject jsonObject = (JSONObject) o;
Map<String,Object> idMap= failedCardService.selectCountIdByCardId(jsonObject.getString("cardId")); String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
int initiator = Integer.parseInt(jsonObject.getString("initiator"))-2; Map<String,Object> idMap ;
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"),idMap.get("ACCEPT_NO").toString(),idMap.get("TASK_ID").toString(), String.valueOf(initiator),jsonObject.getString("note")); //判断是否是特殊证件
if (result != null &&result!="") {
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
} else {
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = Integer.parseInt(jsonObject.getString("initiator")) - 2;
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"));
} }
return true; return true;
} }
......
...@@ -172,13 +172,12 @@ public class ReadXmlApi { ...@@ -172,13 +172,12 @@ public class ReadXmlApi {
int max=Integer.parseInt(currPage)*Integer.parseInt(pageSize); int max=Integer.parseInt(currPage)*Integer.parseInt(pageSize);
int min = (Integer.parseInt(currPage)-1)*Integer.parseInt(pageSize); int min = (Integer.parseInt(currPage)-1)*Integer.parseInt(pageSize);
List list = new ArrayList(); List list = new ArrayList();
if (mapList.size()<max){ if (mapList.size()<max){
for (int i=min-1;i<mapList.size();i++){ for (int i=min-1;i<mapList.size();i++){
list.add(mapList.get(i)); list.add(mapList.get(i));
} }
}else { }else {
for (int i=min;i<max;i++){ for (int i=min;i<max-1;i++){
list.add(mapList.get(i)); list.add(mapList.get(i));
} }
......
...@@ -123,4 +123,20 @@ public interface FailedCardMapper { ...@@ -123,4 +123,20 @@ public interface FailedCardMapper {
public boolean updateFailedState4(FailedCardEntity failedCardEntity); public boolean updateFailedState4(FailedCardEntity failedCardEntity);
/**
* 根据身份证号查询是否是特证
*/
@Select("select SPECIAL_CARD_ID from special_card \n" +
"left join prod_card_t@PROD_LINK ON PROD_CARD_T.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO\n" +
"WHERE PROD_CARD_T.ID_NO = #{id} or PROD_CARD_T.ACCEPT_NO=#{id}")
public String selectSpecialCard(String id);
/**
* 根据特证表添加废证
*/
@Select("select ACCEPT_NO,TASK_ID FROM SPECIAL_CARD LEFT JOIN prod_card_t@PROD_LINK ON PROD_CARD_T.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO" +
"WHERE PROD_CARD_T.ID_NO=#{id} or PROD_CARD_T.ACCEPT_NO=#{id}")
public Map<String,Object>selectDataById(String id);
} }
...@@ -36,5 +36,9 @@ public interface FailedCardService { ...@@ -36,5 +36,9 @@ public interface FailedCardService {
public boolean updateFailedCardState(FailedCardEntity failedCardEntity); public boolean updateFailedCardState(FailedCardEntity failedCardEntity);
public String selectSpecialCard(String id);
public Map<String,Object>selectDataById(String id);
} }
...@@ -117,6 +117,17 @@ public class FailedCardServiceImpl implements FailedCardService { ...@@ -117,6 +117,17 @@ public class FailedCardServiceImpl implements FailedCardService {
return false; return false;
} }
@Override
public String selectSpecialCard(String id) {
String result = failedCardMapper.selectSpecialCard(id);
return result;
}
@Override
public Map<String, Object> selectDataById(String id) {
Map resultMap = failedCardMapper.selectDataById(id);
return resultMap;
}
} }
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