Commit ec8e652f authored by liuxinben's avatar liuxinben

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

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