Commit 196af140 authored by suichenguang's avatar suichenguang

修改

parent d626fa4c
...@@ -121,4 +121,56 @@ public class FailedCardApi { ...@@ -121,4 +121,56 @@ public class FailedCardApi {
return true; return true;
} }
/**
* 查询所有证件类型
* @return List
*/
@RequestMapping("selectCardType")
public List<String> selectCardType(){
List<String> result= failedCardService.selectCardType();
return result;
}
/**
* 生成历史回迁证
* @param jsonStr
* @return
*/
@RequestMapping("insertBackCard")
@Transactional(rollbackFor = Exception.class)
public boolean insertBackCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
TaskEntity taskEntity = new TaskEntity();
String str2 = null;
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
String str = jsonObject.getString("idCard");
if (i != jsonarray.size() - 1) {
str2 += "'" + str + "',";
} else {
str2 += "'" + str + "'";
}
}
//查询制证库,拿到组号列表
List<String> groupList = failedCardService.selectGroupNo(str2);
//生成任务单
for (int i = 0; i < groupList.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
//查询生成任务单需要的数据
Map<String, Object> dataMap = failedCardService.selectTaskListById(jsonObject.getString("idCard"));
//TODO 会报空指针异常
String countyCode = dataMap.get("COUNTY_CODE").toString();
Long cardType = (Long) dataMap.get("CARD_TYPE_ID");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
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"));
}
return true;
}
} }
...@@ -82,8 +82,33 @@ public interface FailedCardMapper { ...@@ -82,8 +82,33 @@ public interface FailedCardMapper {
/*历史回迁证*/ /*历史回迁证*/
/*查询所有证件类型,用于下拉框*/
@Select("select CARD_TYPE from card_type_dic")
public List<String> selectCardType();
@Select("select substr(ACCEPT_NO,0,8) from PROD_CARD_T where ID_NO in" +
" (#{cardList})group by substr(ACCEPT_NO,0,8);")
public List<String> selectGroupNo(String cardIdList);
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6),SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
"from prod_card_t@prod_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}")
public Map<String,Object> selectTaskListById(String id);
@Select("select prod_group_t.valid_count,prod_group_t.invalid_count from prod_group_t@prod_link \n" +
"where group_no=#{groupNo}")
public Map<String,Object> selectGroupDate(String groupNo);
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT)values('12345678','20190308073',79,1);")
public boolean insertGroupNo(@Param("GROUP_NO")String GROUP_NO,@Param("TASK_ID")String TASK_ID,@Param("VALID_COUNT")long VALID_COUNT,@Param("INVALID_COUNT")long INVALID_COUNT);
} }
...@@ -35,7 +35,7 @@ public interface PersonPostMapper { ...@@ -35,7 +35,7 @@ public interface PersonPostMapper {
"SELECT A.*, ROWNUM RN " + "SELECT A.*, ROWNUM RN " +
" from (SELECT * FROM PERSON_POST " + " from (SELECT * FROM PERSON_POST " +
" LEFT JOIN FILE_NAME_DIC ON FILE_NAME_DIC.FILE_ID=PERSON_POST.FILE_ID" + " LEFT JOIN FILE_NAME_DIC ON FILE_NAME_DIC.FILE_ID=PERSON_POST.FILE_ID" +
"WHERE 1=1" + " WHERE 1=1" +
" <when test='applicantName!=null'> and PERSON_POST.APPLICANT_NAME = #{applicantName} </when>" + " <when test='applicantName!=null'> and PERSON_POST.APPLICANT_NAME = #{applicantName} </when>" +
" <when test='orderNumber!=null'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" + " <when test='orderNumber!=null'> and PERSON_POST.ORDER_NUMBER=#{orderNumber} </when>" +
" <when test='state!=null'> and PERSON_POST.STATE=#{state} </when>" + " <when test='state!=null'> and PERSON_POST.STATE=#{state} </when>" +
......
...@@ -20,4 +20,15 @@ public interface FailedCardService { ...@@ -20,4 +20,15 @@ public interface FailedCardService {
public boolean addSpecialCard(@Param("acceptNo")String acceptNo); public boolean addSpecialCard(@Param("acceptNo")String acceptNo);
public Map<String, Object> selectTaskListDate(@Param("acceptNo")String acceptNo); public Map<String, Object> selectTaskListDate(@Param("acceptNo")String acceptNo);
public List<String> selectCardType();
public List<String>selectGroupNo(String idCard);
public Map<String,Object> selectTaskListById(@Param("id") String id);
public Map<String,Object> selectGroupDate(String groupNo);
public boolean insertGroupNo(@Param("GROUP_NO")String GROUP_NO,@Param("TASK_ID")String TASK_ID,@Param("VALID_COUNT")long VALID_COUNT,@Param("INVALID_COUNT")long INVALID_COUNT);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.mapper.FailedCardMapper; import com.yxproject.start.mapper.FailedCardMapper;
import com.yxproject.start.service.FailedCardService; import com.yxproject.start.service.FailedCardService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service
...@@ -54,5 +58,36 @@ public class FailedCardServiceImpl implements FailedCardService { ...@@ -54,5 +58,36 @@ public class FailedCardServiceImpl implements FailedCardService {
return resultList; return resultList;
} }
@Override
public List<String> selectCardType() {
List<String> resultList = failedCardMapper.selectCardType();
return null;
}
@Override
public List<String> selectGroupNo(String idCard) {
List<String> result= failedCardMapper.selectGroupNo(idCard);
return result;
}
@Override
public Map<String, Object> selectTaskListById(String id) {
Map<String,Object> resultMap= failedCardMapper.selectTaskListById(id);
return resultMap;
}
@Override
public Map<String, Object> selectGroupDate(String groupNo) {
Map<String,Object> resultMap= failedCardMapper.selectGroupDate(groupNo);
return resultMap;
}
@Override
public boolean insertGroupNo(String GROUP_NO, String TASK_ID, long VALID_COUNT, long INVALID_COUNT) {
failedCardMapper.insertGroupNo(GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT);
return false;
}
} }
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