Commit 975c81ee authored by dahai's avatar dahai

添加查询

parent 941eeeeb
......@@ -150,6 +150,7 @@ public class TaskListApi {
JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date");
String name = jsonObject.getString("name");
String process = jsonObject.getString("process");
JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String,Object>> countyList =(List<Map<String,Object>>)jsonCounty;
......@@ -158,7 +159,7 @@ public class TaskListApi {
String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString();
List<Object> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
boolean b = taskListService.saveTask(objects,name);
boolean b = taskListService.saveTask(objects,name,process);
}
//生成某几个组的区县任务单
if (jsonGroup.size()>0){
......@@ -173,7 +174,7 @@ public class TaskListApi {
}
}
List<Object> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects,name);
boolean b = taskListService.saveTask(objects,name,process);
}
//todo 保存任务单数据
return "成功生成循环单";
......
......@@ -40,7 +40,9 @@ public interface TaskListMapper {
"left join ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\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" +
"where county_dic.COUNTY_CODE is not null and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate}")
"where county_dic.COUNTY_CODE is not null " +
"and ACC_GROUP_T.group_no not in (select group_no from group_no)" +
" and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate}")
public List<Map<String,Object>> selectByCountyAtACCU(@Param("submitDate") String submitDate);
/**
......@@ -58,7 +60,9 @@ public interface TaskListMapper {
"left join ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\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" +
"where county_dic.COUNTY_CODE = #{countyCode} and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{date}" +
"where county_dic.COUNTY_CODE = #{countyCode} and " +
" and ACC_GROUP_T.group_no not in (select group_no from group_no) " +
"to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{date}" +
" and PREPRO_PERSON.card_type_id = #{typeCode}" +
") a ) where rn BETWEEN #{minNum} and #{maxNum}")
public List<Map<String,Object>> selectByGroupNoAtACCU(@Param("date") String date,@Param("typeCode")String typeCode,@Param("countyCode")String countyCode,@Param("maxNum")long maxNum,@Param("minNum")long minNum );
......@@ -122,7 +126,7 @@ public interface TaskListMapper {
* @param taskEntity 任务单
* @return
*/
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME) values(#{cardType},#{countyCode},#{submitName})")
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID) values(#{cardType},#{countyCode},#{submitName},#{taskStateId})")
@Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
public boolean saveTask(TaskEntity taskEntity);
......@@ -194,21 +198,22 @@ public interface TaskListMapper {
public List<TaskListEntity> selectACCU(@Param("submitDate") String submitDate,@Param("countyCode") String countyCode,@Param("Gajg_dm") String Gajg);
/**
* 生成任务单
* @param taskListEntityMap
* @return
*/
@Insert("INSERT INTO TASK (CARD_TYPE,OLD_CARD_TYPE,COUNTY_CODE,TASK_STATE_ID)VALUES(1,1,#{countyCode},0)")
public boolean createTaskList(List<TaskListEntity> taskListEntityMap);
// /**
// * 生成任务单
// * @param taskListEntityMap
// * @return
// */
// @Insert("INSERT INTO TASK (CARD_TYPE,OLD_CARD_TYPE,COUNTY_CODE,TASK_STATE_ID)VALUES(1,1,#{countyCode},0)")
// public boolean createTaskList(List<TaskListEntity> taskListEntityMap);
/**
*下发任务单
*更改任务单状态
* @param taskId
* @return
*/
//todo 更改状态
@Update("UPDATE TASK SET TASK_STATE_ID=1 WHERE TASK_ID = #{taskId} ")
public boolean updateState(@Param("taskId") String taskId);
public boolean updateState(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
}
......@@ -32,5 +32,5 @@ public interface TaskListService {
public boolean saveTask(TaskEntity taskEntity);
public boolean saveTask(List<Object> list,String submitName);
public boolean saveTask(List<Object> list,String submitName,String process);
}
......@@ -237,12 +237,13 @@ public class TaskListServiceImpl implements TaskListService {
* @return
*/
@Override
public boolean saveTask(List<Object> list,String submitName) {
public boolean saveTask(List<Object> list,String submitName,String process) {
Map<String,Object> stringObjectMap =(Map<String,Object>)list.get(0);
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType(Long.valueOf(stringObjectMap.get("CARD_TYPE_ID")+""));
taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+"");
taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId(Long.valueOf(process));
saveTask(taskEntity);
for (Object object :list){
Map<String,Object> map =(Map<String,Object>)object;
......
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