Commit ff130340 authored by dahai's avatar dahai

修改生成任务单API

parent 76ba39ac
...@@ -5,9 +5,11 @@ import com.yxproject.start.entity.TaskList.CountGajgEntity; ...@@ -5,9 +5,11 @@ import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity; import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.TaskListService; import com.yxproject.start.service.TaskListService;
import com.yxproject.start.utils.YXJSONResponse; import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
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.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -112,7 +114,15 @@ public class TaskListApi { ...@@ -112,7 +114,15 @@ public class TaskListApi {
*/ */
@RequestMapping("createTask") @RequestMapping("createTask")
@Transactional @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){ for (Map<String,Object> map :countyList){
String typeCode = map.get("typeCode").toString(); String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString(); String countyCode = map.get("countyCode").toString();
...@@ -121,17 +131,19 @@ public class TaskListApi { ...@@ -121,17 +131,19 @@ public class TaskListApi {
boolean b = taskListService.saveTask(objects,name); boolean b = taskListService.saveTask(objects,name);
} }
//查询组号详情 if (groupList.size()>0){
String groupNo = "("; //查询组号详情
for ( int i= 0; i<groupList.size();i++){ String groupNo = "(";
if (i!=groupList.size()-1){ for ( int i= 0; i<groupList.size();i++){
groupNo=groupNo+groupList.get(i)+","; if (i!=groupList.size()-1){
}else { groupNo=groupNo+groupList.get(i)+",";
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 保存任务单数据 //todo 保存任务单数据
return "成功生成循环单"; return "成功生成循环单";
......
...@@ -75,7 +75,7 @@ public interface TaskListMapper { ...@@ -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 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" + "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" + "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); public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo);
...@@ -84,7 +84,7 @@ public interface TaskListMapper { ...@@ -84,7 +84,7 @@ public interface TaskListMapper {
* @param taskEntity 任务单 * @param taskEntity 任务单
* @return * @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") @Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
public boolean saveTask(TaskEntity taskEntity); 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