Commit 2673ce08 authored by liboyang's avatar liboyang

Merge remote-tracking branch 'origin/dev' into dev

parents 75778185 c16f2a49
......@@ -5,14 +5,17 @@ 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;
import javax.servlet.http.HttpServletResponse;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -102,17 +105,47 @@ public class TaskListApi {
/**
* 生成任务单
*
* @param process 工序
* @param date 查询时间
* @param name 提交人姓名
* @param groupList 组号列表
* @param countyList 区县列表 {typeCode:1,countyCode:'123456'}
* @param resp
* @return
*/
@RequestMapping("createTask")
public String queryByCountyAtACCU(@RequestParam("process") String process,@RequestParam("date") String date,@RequestParam("groupList") List<String> groupList,@RequestParam("countyList") String countyList, HttpServletResponse resp){
// taskListService.selectGrouoAtACCU()
return null;
@Transactional
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();
List<Object> objects = taskListService.selectGroupAtACCU(date, typeCode, countyCode);
//todo 保存任务单数据
boolean b = taskListService.saveTask(objects,name);
}
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);
}
//todo 保存任务单数据
return "成功生成循环单";
}
......
......@@ -16,8 +16,35 @@ public interface LogMapper {
@Insert("")
public boolean insertAnalysisLog();
@Select("")
public List<Map<String,Object>> selectAnalysisLog(String fileName,String analysisDate);
@Select("<script> " +
"SELECT * FROM " +
"( " +
"SELECT A.*, ROWNUM RN " +
"FROM (SELECT FILE_NAME_DIC.FILE_NAME,FILE_NAME_DIC.FORM_START_TIME," +
"FILE_NAME_DIC.FORM_DEADLINE,PERSON_POST.LATTICE_MOUTH_INFORMATION," +
"FILE_NAME_DIC.ANALYSIS_DATE,FILES.RECORD_NUMBER ," +
"SUM(DECOdE(CARD_TYPE_ID,9,1,0)) youcount," +
"SUM(DECOdE(CARD_TYPE_ID,0,1,0)) PUcount " +
"FROM FILE_NAME_DIC " +
"LEFT JOIN PERSON_POST ON FILE_NAME_DIC.FILE_ID=PERSON_POST.FILE_ID " +
"LEFT JOIN FILES ON FILES.ID=FILE_NAME_DIC.FILE_ID " +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH = person_post.FIRST_WHITE " +
"WHERE " +
"<if test='fileName !=\"\"' >" +
"FILE_NAME_DIC.FILE_NAME=#{fileName} " +
"</if>" +
"<if test='analysisDate !=\"\"' >" +
"AND FILE_NAME_DIC.ANALYSIS_DATE = #{analysisDate} " +
"</if>" +
"group by FILE_NAME_DIC.FILE_NAME, FILE_NAME_DIC.FORM_START_TIME, " +
"FILE_NAME_DIC.FORM_DEADLINE, PERSON_POST.LATTICE_MOUTH_INFORMATION, " +
"FILE_NAME_DIC.ANALYSIS_DATE, FILES.RECORD_NUMBER" +
")" +
"A" +
")" +
"WHERE RN BETWEEN #{end} AND #{begin}" +
"</script>")
public List<Map<String,Object>> selectAnalysisLog(String fileName,String analysisDate,long begin,long end);
@Select("<script> " +
"SELECT * FROM " +
......
......@@ -60,14 +60,31 @@ public interface TaskListMapper {
"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 to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')= #{date}\n" +
"and PREPRO_PERSON.card_type_id =#{typeCode} and substr(PREPRO_PERSON.JMSFZSLH,0,6) =#{countyCode}")
public List<Map<String,Object>> selectGrouoAtACCU(@Param("date") String date,@Param("typeCode") String typeCode,@Param("countyCode") String countyCode);
public List<Map<String,Object>> selectGroupAtACCUByCountyCode(@Param("date") String date,@Param("typeCode") String typeCode,@Param("countyCode") String countyCode);
/**
* 查询组号列表
* 受理库
* @param groupNo 组号信息
* @return
*/
@Select("select DISTINCT CARD_TYPE_DIC.card_type_id, ACC_GROUP_T.group_no ,ACC_GROUP_T.valid_count,ACC_GROUP_T.invalid_count, county_dic.county_code\n" +
"from ACC_CARD_T@ACCU_LINK \n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH = acc_card_t.upload_no \n" +
"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 ACC_GROUP_T.deal_flag =3 and" +
" ACC_GROUP_T.group_no in #{groupNo} ")
public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo);
/**
* 生成任务单
* @param taskEntity 任务单
* @return
*/
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_DATE,SUBMIT_NAME) values(#{cardType},#{countyCode},#{submitDate},#{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);
......
......@@ -22,7 +22,11 @@ public interface TaskListService {
public List<Object> selectByCountyAtACCU(String date);
public List<Object> selectGrouoAtACCU(String date,String typeCode,String countyCode);
public List<Object> selectGroupAtACCU(String date,String typeCode,String countyCode);
public List<Object> selectGroupAtACCU(String groupNo);
public boolean saveTask(TaskEntity taskEntity);
public boolean saveTask(List<Object> list,String submitName);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity;
import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.TaskListMapper;
import com.yxproject.start.service.TaskListService;
import org.apache.ibatis.annotations.Mapper;
......@@ -20,6 +22,8 @@ import java.util.Map;
public class TaskListServiceImpl implements TaskListService {
@Autowired
private TaskListMapper taskListMapper;
@Autowired
private GroupNoMapper groupNoMapper;
@Override
public List<CountCountyEntity> selectByCounty(String submitDate) {
......@@ -154,8 +158,19 @@ public class TaskListServiceImpl implements TaskListService {
* @return
*/
@Override
public List selectGrouoAtACCU(String date,String typeCode,String countyCode) {
return taskListMapper.selectGrouoAtACCU(date,typeCode,countyCode);
public List selectGroupAtACCU(String date,String typeCode,String countyCode) {
return taskListMapper.selectGroupAtACCUByCountyCode(date,typeCode,countyCode);
}
/**
* 查询组号信息
* 受理库
* @param groupNo 受理组号
* @return
*/
@Override
public List selectGroupAtACCU(String groupNo) {
return taskListMapper.selectGroupAtACCUByGroupNo(groupNo);
}
/**
......@@ -168,6 +183,32 @@ public class TaskListServiceImpl implements TaskListService {
return taskListMapper.saveTask(taskEntity);
}
/**
* 保存循环单
* @param list
* @return
*/
@Override
public boolean saveTask(List<Object> list,String submitName) {
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);
saveTask(taskEntity);
for (Object object :list){
Map<String,Object> map =(Map<String,Object>)object;
GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(map.get("GROUP_NO")+"");
groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT")+""));
groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT")+""));
groupNoEntity.setSpecialCardCount((long)0);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity);
}
return true;
}
private String createGroupNo(List<Integer> c, List<Integer> nsList) {
try {
String groupNo = "";
......
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