Commit ff130340 authored by dahai's avatar dahai

修改生成任务单API

parent 76ba39ac
......@@ -5,9 +5,11 @@ import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.TaskListService;
import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
......@@ -112,7 +114,15 @@ public class TaskListApi {
*/
@RequestMapping("createTask")
@Transactional
public String queryByCountyAtACCU(@RequestParam("date") String date,@RequestParam("name") String name,@RequestParam("groupList") List<String> groupList,@RequestParam("countyList") List<Map<String,Object>> countyList, HttpServletResponse resp){
public String queryByCountyAtACCU(@RequestBody String str, HttpServletResponse resp){
System.out.println(str);
JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date");
String name = jsonObject.getString("name");
JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String,Object>> countyList =(List<Map<String,Object>>)jsonCounty;
List<String> groupList =(List<String>)jsonGroup;
for (Map<String,Object> map :countyList){
String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString();
......@@ -121,17 +131,19 @@ public class TaskListApi {
boolean b = taskListService.saveTask(objects,name);
}
//查询组号详情
String groupNo = "(";
for ( int i= 0; i<groupList.size();i++){
if (i!=groupList.size()-1){
groupNo=groupNo+groupList.get(i)+",";
}else {
groupNo=groupNo+groupList.get(i)+")";
if (groupList.size()>0){
//查询组号详情
String groupNo = "(";
for ( int i= 0; i<groupList.size();i++){
if (i!=groupList.size()-1){
groupNo=groupNo+groupList.get(i)+",";
}else {
groupNo=groupNo+groupList.get(i)+")";
}
}
List<Object> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects,name);
}
List<Object> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects,name);
//todo 保存任务单数据
return "成功生成循环单";
......
......@@ -75,7 +75,7 @@ public interface TaskListMapper {
"left join CARD_TYPE_DIC on PREPRO_PERSON.card_type_id = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE is not null and ACC_GROUP_T.deal_flag =3 and" +
" ACC_GROUP_T in #{groupNo} ")
" ACC_GROUP_T.group_no in #{groupNo} ")
public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo);
......@@ -84,7 +84,7 @@ public interface TaskListMapper {
* @param taskEntity 任务单
* @return
*/
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_DATE,SUBMIT_NAME) values(#{cardType},#{countyCode},to_date(#{submitDate},'yyyyMMddhhmmss'),#{submitName})")
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME) values(#{cardType},#{countyCode},#{submitName})")
@Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
public boolean saveTask(TaskEntity taskEntity);
......
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