Commit 9e8ff74c authored by suichenguang's avatar suichenguang

添加余证

parent 6c885d7a
package com.yxproject.start.api;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.FailedCardService;
import com.yxproject.start.service.TaskListService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -57,6 +59,7 @@ public class FailedCardApi {
* @return
*/
@RequestMapping("insertFailedCard")
@Transactional(rollbackFor = Exception.class)
public Boolean insertFailedCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray){
......@@ -69,25 +72,33 @@ public class FailedCardApi {
/**
* 生成余证
* 生成余证(每个余证生成一个任务单)
* @param jsonStr
* @return
*/
@RequestMapping("insertRemaining")
@Transactional(rollbackFor = Exception.class)
public Boolean insertRemaining(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray) {
JSONObject jsonObject =(JSONObject)o;
// failedCardService.addSpecialCard(acceptNo);
// failedCardService.specialCardAdd(acceptNo);
// taskListService.createTaskList(submitDate,countyCode,Gajg);
// List<TaskListEntity> resultList= taskListService.selectACCU(submitDate,countyCode,Gajg);
// taskListService.createTaskList(resultList);
}
TaskEntity taskEntity = new TaskEntity();
List<Object> taskEntityList = new ArrayList<>();
//TODO 多张余证可以生成一张任务单 判断是否是同一个countyCode
for (Object o:jsonarray) {
JSONObject jsonObject =(JSONObject)o;
/*查询生成任务单需要的数据*/
Map<String,Object> resultMap= failedCardService.selectTaskListDate(jsonObject.getString("ACCEPT_NO"));
String countyCode = resultMap.get("COUNTY_CODE").toString();
Long cardType = (Long) resultMap.get("CARD_TYPE_ID");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
taskEntityList.add(taskEntity);
taskListService.saveTask(taskEntity);
/*特证表添加特证*/
failedCardService.addSpecialCard(jsonObject.getString("ACCEPT_NO"));
/*特证数+1*/
failedCardService.specialCardAdd(jsonObject.getString("ACCEPT_NO"));
}
return true;
}
......
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