Commit 257f46bb authored by suichenguang's avatar suichenguang

废证修改

parent 5876a9c4
package com.yxproject.start.api;
import com.yxproject.start.service.FailedCardService;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -29,27 +34,32 @@ public class FailedCardApi {
/**
* 根据身份证号或受理号查询身份信息及组号
* @param cardId
* @param jsonStr
* @return
*/
@RequestMapping("selectInfoByCardId")
public Map<String,Object> selectInfoByCardId(String cardId){
Map<String,Object> resultMap =failedCardService.selectInfoByCardId(cardId);
return resultMap;
public List<Map<String,Object>> selectInfoByCardId(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
List<Map<String,Object>> resultList=new ArrayList<>();
for (Object o:jsonarray) {
Map<String,Object> resultMap =failedCardService.selectInfoByCardId(o.toString());
resultList.add(resultMap);
}
return resultList;
}
/**
* 添加废证
* @param failedCardReasonId 废证原因
* @param acceptNo 受理号
* @param taskId 任务单号
* @param initiator 发起工序
* @param note 备注
* @param jsonStr
* @return
*/
@RequestMapping("insertFailedCard")
public Boolean insertFailedCard(String failedCardReasonId,String acceptNo,String taskId,String initiator,String note){
failedCardService.insertFailedCard(failedCardReasonId,acceptNo,taskId,initiator,note);
public Boolean insertFailedCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray){
JSONObject jsonObject =(JSONObject)o;
failedCardService.insertFailedCard(jsonObject.get("failedCardReasonId").toString(),jsonObject.get("acceptNo").toString(),jsonObject.get("taskId").toString(),jsonObject.get("initiator").toString(),jsonObject.get("note").toString());
}
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