Commit ec8e652f authored by liuxinben's avatar liuxinben

添加历史回迁证和废证时,通过身份证号添加重复时返回false

parent ce6b6192
......@@ -147,7 +147,7 @@ public class FailedCardApi {
String name = ((JSONObject) o).getString("name");
String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
Map<String, Object> idMap;
List<Map<String, Object>> idMap;
//判断是否是特殊证件
if (result != null && result != "") {
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
......@@ -155,9 +155,9 @@ public class FailedCardApi {
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = 5;
String acceptNo = idMap.get("ACCEPT_NO").toString();
Object taskId = idMap.get("TASK_ID");
Object workGroup = idMap.get("WORK_GROUP");
String acceptNo = idMap.get(0).get("ACCEPT_NO").toString();
Object taskId = idMap.get(0).get("TASK_ID");
Object workGroup = idMap.get(0).get("WORK_GROUP");
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), replace(acceptNo), replace(taskId), String.valueOf(initiator), jsonObject.getString("note"), replace(workGroup), name);
}
} catch (Exception e) {
......@@ -258,7 +258,7 @@ public class FailedCardApi {
String note = jsonObject.getString("note");
String failedCardReasonId = jsonObject.getString("failedCardReasonId");
String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
Map<String, Object> idMap;
List<Map<String,Object>> idMap;
//判断是否是特殊证件
if (result != null && result != "" ) {
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
......@@ -266,7 +266,7 @@ public class FailedCardApi {
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = 5;
failedCardService.insertHistoryCard(failedCardReasonId, idMap.get("ACCEPT_NO").toString(), String.valueOf(initiator), note, workGroup, name);
failedCardService.insertHistoryCard(failedCardReasonId, idMap.get(0).get("ACCEPT_NO").toString(), String.valueOf(initiator), note, workGroup, name);
}
return true;
}
......
......@@ -492,29 +492,34 @@ public class TaskListApi {
String acceptNo = jsonObject.getString("acceptNo");
String note = jsonObject.getString("note");
String result = failedCardService.selectSpecialCard(acceptNo);
Map<String, Object> idMap;
List<Map<String,Object>> idMap;
//判断是否是特殊证件
if (result != null && result != "") {
idMap = failedCardService.selectDataById(acceptNo);
} else {
idMap = failedCardService.selectCountIdByCardId(acceptNo);
}
String name = jsonObject.getString("name");
//添加重做返回证任务单
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType((long) 2);
taskEntity.setCountyCode("000000");
taskEntity.setTaskStateId((long) 0);
taskEntity.setSubmitName(name);
taskEntity.setNote(note);
taskListService.saveTask(taskEntity);
GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(idMap.get("ACCEPT_NO").toString());
groupNoEntity.setInvalidCount((long) 0);
groupNoEntity.setValidCount((long) 1);
groupNoEntity.setSpecialCardCount((long) 0);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoService.saveGroupNo(groupNoEntity);
if(idMap.size()>1){
map.put("msg", "制证库存在重复的身份证号,请使用受理号添加");
return map;
}else {
String name = jsonObject.getString("name");
//添加重做返回证任务单
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType((long) 2);
taskEntity.setCountyCode("000000");
taskEntity.setTaskStateId((long) 0);
taskEntity.setSubmitName(name);
taskEntity.setNote(note);
taskListService.saveTask(taskEntity);
GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(idMap.get(0).get("ACCEPT_NO").toString());
groupNoEntity.setInvalidCount((long) 0);
groupNoEntity.setValidCount((long) 1);
groupNoEntity.setSpecialCardCount((long) 0);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoService.saveGroupNo(groupNoEntity);
}
}
map.put("msg", "成功添加重做返回证任务单");
return map;
......
......@@ -63,7 +63,7 @@ public interface FailedCardMapper {
"LEFT JOIN GROUP_NO ON GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8) " +
"left join task on task.TASK_ID = group_no.TASK_ID\n" +
"WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}")
public Map<String, Object> selectCountIdByCardId(@Param("cardId") String cardId);
public List<Map<String,Object>> selectCountIdByCardId(@Param("cardId") String cardId);
/**
* 生成历史回迁证
......@@ -162,7 +162,7 @@ public interface FailedCardMapper {
*/
@Select("select SPECIAL_CARD.ACCEPT_NO,SPECIAL_CARD.TASK_ID,task.work_group FROM SPECIAL_CARD left join task on task.TASK_ID = special_card.TASK_ID LEFT JOIN prod_card_t@PRODYD_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);
public List<Map<String,Object>> selectDataById(String id);
/**
* 查询提交人提交的废证详情
......
......@@ -16,7 +16,7 @@ public interface FailedCardService {
public boolean insertFailedCard(String failedCardReasonId,String acceptNo,String taskId,String initiator,String note,String workGroup,String name);
public Map<String,Object> selectCountIdByCardId(String cardId);
public List<Map<String,Object>> selectCountIdByCardId(String cardId);
public boolean insertHistoryCard(String failedCardReasonId,String acceptNo,String initiator,String note,String workGroup,String name);
......@@ -40,7 +40,7 @@ public interface FailedCardService {
public String selectSpecialCard(String id);
public Map<String,Object> selectDataById(String id);
public List<Map<String,Object>> selectDataById(String id);
public List<Map<String,Object>> selectFailedCardInfo(String startDate ,String endDate ,String name);
......
......@@ -41,8 +41,8 @@ public class FailedCardServiceImpl implements FailedCardService {
}
@Override
public Map<String, Object> selectCountIdByCardId(String cardId) {
Map<String, Object> result= failedCardMapper.selectCountIdByCardId(cardId);
public List<Map<String,Object>> selectCountIdByCardId(String cardId) {
List<Map<String,Object>> result= failedCardMapper.selectCountIdByCardId(cardId);
return result;
}
......@@ -140,8 +140,8 @@ public class FailedCardServiceImpl implements FailedCardService {
}
@Override
public Map<String, Object> selectDataById(String id) {
Map resultMap = failedCardMapper.selectDataById(id);
public List<Map<String,Object>> selectDataById(String id) {
List<Map<String,Object>> 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