Commit c668099a authored by dahai's avatar dahai

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

# Conflicts:
#	src/main/java/com/yxproject/start/api/FailedCardApi.java
#	src/main/java/com/yxproject/start/mapper/FailedCardMapper.java
parents 7a04f419 5752af18
package com.yxproject.start.api;
import com.yxproject.start.entity.FailedCardEntity;
import com.yxproject.start.entity.FailedCardReasonDicEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
......@@ -70,14 +71,15 @@ public class FailedCardApi {
jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
String acceptNo = o.toString().replace("e", "E").replace("g", "G").replace("l", "L");
Map<String, Object> resultMap = failedCardService.selectInfoByCardId(acceptNo);
List<Map<String, Object>> resultMap = failedCardService.selectInfoByCardId(acceptNo);
if (resultMap == null) {
resultMap = new LinkedHashMap<>();
resultMap.put("ID_NO", o.toString());
resultMap.put("NAME", "查无此人");
resultMap.put("SEX_NO", "-1");
Map<String, Object> map = new LinkedHashMap<>();
map.put("ID_NO", o.toString());
map.put("NAME", "查无此人");
map.put("SEX_NO", "-1");
resultMap.add(map);
}
resultList.add(resultMap);
resultList.addAll(resultMap);
}
} catch (Exception e) {
logger.error("身份证号或受理号:" + jsonarray);
......@@ -239,7 +241,7 @@ public class FailedCardApi {
* @param jsonStr
* @return
*/
@RequestMapping("insertBackCard")
@RequestMapping("insertHistoryCard")
@Transactional(rollbackFor = Exception.class)
public Boolean insertBackCard(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
......@@ -249,10 +251,18 @@ public class FailedCardApi {
try {
jsonarray = JSONArray.fromObject(jsonStr);
taskEntity = new TaskEntity();
String str2 = null;
String str2 = "";
String failedCardReasonId = "";
String workGroup = "";
String note = "";
String name = "";
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
String str = jsonObject.getString("cardId");
failedCardReasonId = jsonObject.getString("failedCardReasonId");
workGroup = jsonObject.getString("workGroup");
note = jsonObject.getString("note");
name = jsonObject.getString("name");
if (i != jsonarray.size() - 1) {
str2 += "'" + str + "',";
} else {
......@@ -265,17 +275,20 @@ public class FailedCardApi {
for (int i = 0; i < groupList.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
//查询生成任务单需要的数据
Map<String, Object> dataMap = failedCardService.selectTaskListById(jsonObject.getString("idCard"));
Map<String, Object> dataMap = failedCardService.selectTaskListById(jsonObject.getString("cardId"));
String countyCode = dataMap.get("COUNTY_CODE").toString();
Long cardType = (Long) dataMap.get("CARD_TYPE_ID");
String submitName =(String) dataMap.get("INITIATOR");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId((long) 1);
//生成任务单
taskListService.saveTask(taskEntity);
//生成新组号列表
Map<String, Object> groupDataMap = failedCardService.selectGroupDate(groupList.get(i));
failedCardService.insertGroupNo(String.valueOf(groupDataMap.get("GROUP_NO")), String.valueOf(groupDataMap.get("TASK_ID")), (Long) groupDataMap.get("VALID_COUNT"), (Long) groupDataMap.get("INVALID_COUNT"));
failedCardService.insertGroupNo(String.valueOf(groupDataMap.get("GROUP_NO")), String.valueOf(taskEntity.getTaskId()), (Long) groupDataMap.get("VALID_COUNT"), (Long) groupDataMap.get("INVALID_COUNT"));
failedCardService.insertFailedCard(failedCardReasonId,String.valueOf(dataMap.get("ACCEPT_NO")),String.valueOf(taskEntity.getTaskId()),String.valueOf("1"),note,workGroup,name);
}
} catch (NullPointerException e) {
logger.error("身份证号或受理号:" + jsonarray);
......
......@@ -38,7 +38,7 @@ public interface FailedCardMapper {
"left join failed_card on PROD_CARD_T.ACCEPT_NO = failed_card.ACCEPT_NO " +
" left join FAILED_CARD_REASON_DIC on failed_card.FAILED_CARD_REASON_ID =FAILED_CARD_REASON_DIC.FAILED_CARD_REASON_ID" +
" WHERE PROD_CARD_T.ID_NO=#{cardId} OR PROD_CARD_T.ACCEPT_NO=#{cardId}")
public Map<String, Object> selectInfoByCardId(@Param("cardId") String cardId);
public List<Map<String, Object>> selectInfoByCardId(@Param("cardId") String cardId);
/**
......@@ -98,8 +98,8 @@ public interface FailedCardMapper {
@Select("select substr(ACCEPT_NO,0,8) from PROD_CARD_T@PRODYD_LINK where ID_NO in" +
" (#{cardIdList}) group by substr(ACCEPT_NO,0,8)")
public List<String> selectGroupNo(@Param("cardIdList") String cardIdList);
" (${cardId}) group by substr(ACCEPT_NO,0,8)")
public List<String> selectGroupNo(@Param("cardId") String cardId);
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6) as COUNTY_CODE ," +
......@@ -107,7 +107,7 @@ public interface FailedCardMapper {
"from prod_card_t@PRODYD_LINK\n" +
"left join SPECIAL_CARD on prod_card_t.accept_no = SPECIAL_CARD.accept_no\n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH=prod_card_t.UPLOAD_NO\n" +
"where prod_card_t.ID_NO=#{acceptNo}")
"where prod_card_t.ID_NO=#{id}")
public Map<String, Object> selectTaskListById(@Param("id") String id);
......
......@@ -12,7 +12,7 @@ public interface FailedCardService {
public List<FailedCardReasonDicEntity>selectFailedCardDic();
public Map<String,Object> selectInfoByCardId(String cardId);
public List<Map<String, Object>> selectInfoByCardId(String cardId);
public boolean insertFailedCard(String failedCardReasonId,String acceptNo,String taskId,String initiator,String note,String workGroup,String name);
......@@ -26,7 +26,7 @@ public interface FailedCardService {
public List<String> selectCardType();
public List<String>selectGroupNo(String idCard);
public List<String>selectGroupNo(String cardId);
public Map<String,Object> selectTaskListById(String id);
......
......@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
......@@ -26,8 +27,8 @@ public class FailedCardServiceImpl implements FailedCardService {
}
@Override
public Map<String, Object> selectInfoByCardId(String cardId) {
Map<String, Object> result= failedCardMapper.selectInfoByCardId(cardId);
public List<Map<String, Object>> selectInfoByCardId(String cardId) {
List<Map<String, Object>> result= failedCardMapper.selectInfoByCardId(cardId);
return result;
}
......@@ -69,8 +70,8 @@ public class FailedCardServiceImpl implements FailedCardService {
}
@Override
public List<String> selectGroupNo(String idCard) {
List<String> result= failedCardMapper.selectGroupNo(idCard);
public List<String> selectGroupNo(String cardId) {
List<String> result= failedCardMapper.selectGroupNo(cardId);
return result;
}
......@@ -78,13 +79,23 @@ public class FailedCardServiceImpl implements FailedCardService {
@Override
public Map<String, Object> selectTaskListById(String id) {
Map<String,Object> resultMap= failedCardMapper.selectTaskListById(id);
return resultMap;
Map<String,Object> resultMap1 = new HashMap <>();
resultMap1.put("SPECIAL_TYPE",Long.parseLong(resultMap.get("SPECIAL_TYPE").toString()));
resultMap1.put("CARD_TYPE_ID",Long.parseLong(resultMap.get("CARD_TYPE_ID").toString()));
resultMap1.put("ACCEPT_NO",resultMap.get("ACCEPT_NO"));
resultMap1.put("COUNTY_CODE",resultMap.get("COUNTY_CODE"));
resultMap1.put("INITIATOR",resultMap.get("INITIATOR"));
return resultMap1;
}
@Override
public Map<String, Object> selectGroupDate(String groupNo) {
Map<String,Object> resultMap= failedCardMapper.selectGroupDate(groupNo);
return resultMap;
Map<String,Object> resultMap1 = new HashMap <>();
resultMap1.put("VALID_COUNT",Long.parseLong(resultMap.get("VALID_COUNT").toString()));
resultMap1.put("INVALID_COUNT",Long.parseLong(resultMap.get("INVALID_COUNT").toString()));
resultMap1.put("GROUP_NO",groupNo);
return resultMap1;
}
@Override
......
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