Commit 257f46bb authored by suichenguang's avatar suichenguang

废证修改

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