Commit 776c6e99 authored by dahai's avatar dahai

修改添加快证任务单

parent a20cc3be
package com.yxproject.start.mapper;
import com.yxproject.start.entity.GroupNoEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface GroupNoMapper {
......@@ -23,4 +22,20 @@ public interface GroupNoMapper {
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT,SPECIAL_CARD_COUNT) " +
"values(#{groupNo},#{taskId},#{validCount},#{invalidCount},#{specialCardCount})")
public boolean saveGroupNo (GroupNoEntity groupNoEntity);
/**
* 查询组号详情
* @param groupNo 组号
* @return
*/
@Select("select * from group_No where group_No = #{groupNo}")
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo);
/**
* 更新组号详情中 的特证数量
* @param groupNoEntity
* @return
*/
@Update("update GROUP_NO set SPECIAL_CARD_COUNT = #{specialCardCount} where id = #{id}")
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.SpecialCardEntity;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:09
*/
@Mapper
public interface SpecialCardMapper {
/**
* 保存特证信息
* @param specialCardEntity
* @return
*/
@Insert("INSERT into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR) " +
"values (#{acceptNo},#{taskId},#{specialType},#{groupNo},#{initiator})")
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity);
/**
* 查询特证信息
* @param acceptNo 受理组号
* @return
*/
@Select("select * from SPECIAL_CARD where ACCEPT_NO = #{acceptNo}")
public List<SpecialCardEntity> selectSpecialCardByAcceptNo(String acceptNo);
/**
* 更新特证受理类型
* @param specialCardEntity
* @return
*/
@Update("update SPECIAL_CARD set SPECIAL_TYPE = #{specialType} where SPECIAL_CARD_ID = #{specialCardId}")
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity);
}
......@@ -20,8 +20,8 @@ public interface TaskListMapper {
* @param submitDate
* @return
*/
@Select(" SELECT coun.COUNTYNAME,substr(act.upload_no,0,6),count(*) as count FROM ACC_CARD_T@ACCU_DBLINK act ,count()" +
" LEFT JOIN ACC_GROUP_T@ACCU_DBLINK agt on substr(act.accept_no,0,8) = agt.group_no " +
@Select(" SELECT coun.COUNTYNAME,substr(act.upload_no,0,6),count(*) as count FROM ACC_CARD_T@ACCU_LINK act ,count()" +
" LEFT JOIN ACC_GROUP_T@ACCU_LINK agt on substr(act.accept_no,0,8) = agt.group_no " +
" LEFT JOIN COUNTY_DIC coun on substr(act.upload_no,0,6) = coun.county_code " +
" WHERE agt.group_no not in (select GROUP_NO.group_no from GROUP_NO) " +
" and to_char(IMPORT_TIME,'yyyymmdd') = #{submitDate} " +
......@@ -121,13 +121,21 @@ public interface TaskListMapper {
/**
* 生成任务单
* 生成快证任务单
* @param taskEntity 任务单
* @return
*/
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID) values(#{cardType},#{countyCode},#{submitName},#{taskStateId})")
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID,OLD_CARD_TYPE) values(#{cardType},#{countyCode},#{submitName},#{taskStateId},#{oldCardType})")
@Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
public boolean saveTask(TaskEntity taskEntity);
public boolean saveFastTask(TaskEntity taskEntity);
// /**
// * 生成任务单
// * @param taskEntity 任务单
// * @return
// */
// @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);
......@@ -186,10 +194,10 @@ public interface TaskListMapper {
* @return
*/
@Select("SELECT act.ACCEPT_NO, agt.deal_flag, gajg.gajg_mc, gajg.gajg_dm, coun.COUNTYNAME,agt.group_no\n" +
" FROM ACC_CARD_T@ACCU_DBLINK act \n"+
" FROM ACC_CARD_T@ACCU_LINK act \n"+
" LEFT JOIN COUNTY_DIC coun on substr(act.upload_no,0,6) = coun.county_code " +
" LEFT JOIN ACC_GROUP_T@ACCU_DBLINK agt on substr(act.accept_no,0,8) = agt.group_no \n" +
" LEFT JOIN GAJG_MC gajg on substr(act.upload_no,0,9) = gajg.gajg_dm\n"+
" LEFT JOIN ACC_GROUP_T@ACCU_LINK agt on substr(act.accept_no,0,8) = agt.group_no \n" +
" LEFT JOIN GAJG_DM gajg on substr(act.upload_no,0,9) = gajg.gajg_dm\n"+
" WHERE agt.group_no not in (select GROUP_NO.group_no from GROUP_NO) " +
" and to_char(IMPORT_TIME,'yyyymmdd') = #{submitDate} " +
" and gajg.gajg_dm = #{Gajg} " +
......@@ -203,7 +211,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},ISSUED_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState1(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -213,7 +220,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},PRINT_OUT_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState2(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -223,7 +229,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},POSITION_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState3(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -233,7 +238,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},CONCORA_CRUSH_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState4(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -243,7 +247,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},PUNCHING_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState5(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -253,7 +256,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},SORTING_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState6(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -263,9 +265,39 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},CONNECT_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState7(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
/**
*查询快证是否存在受理库
* @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\n" +
"and ACC_GROUP_T.group_no =#{groupNo}")
public List<Object> selectFastCardAtACCU(@Param("groupNo") String groupNo);
/**
* 查询任务单详情
* @param taskId
* @return
*/
@Select("select * from task where task_ID = #{taskId}")
public List<TaskEntity> selectTaskEntityByTaskId(long taskId);
/**
* 保存快证任务单
* 辅助库
* @param taskEntity
* @return
*/
public boolean saveTask(TaskEntity taskEntity);
}
......@@ -2,10 +2,14 @@ package com.yxproject.start.service;
import com.yxproject.start.entity.GroupNoEntity;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/6 21:12
*/
public interface GroupNoService {
public boolean saveGroupNo(GroupNoEntity groupNoEntity);
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo);
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.SpecialCardEntity;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:10
*/
public interface SpecialCardService {
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity);
public List<SpecialCardEntity> selectSpecialCardAtSpecialCard(String acceptNo);
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity;
import com.yxproject.start.entity.TaskList.CountGajgEntity;
......@@ -33,4 +34,12 @@ public interface TaskListService {
public boolean saveTask(TaskEntity taskEntity);
public boolean saveTask(List<Object> list,String submitName,String process);
public List<Object> selectFastCardAtACCU(String groupNo);
public boolean saveFastTask(List<Object> list,String submitName,String acceptNo,long cardType);
public List<TaskEntity> selectTaskEntityByTaskId(long taskId);
public boolean saveFastTask(TaskEntity taskEntity);
}
......@@ -6,6 +6,8 @@ import com.yxproject.start.service.GroupNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/6 21:12
......@@ -23,4 +25,24 @@ public class GroupNoServiceImpl implements GroupNoService {
public boolean saveGroupNo(GroupNoEntity groupNoEntity) {
return groupNoMapper.saveGroupNo(groupNoEntity);
}
/**
* 查询组号详情
* @param groupNo 组号
* @return
*/
@Override
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo) {
return groupNoMapper.selectGroupNoEntityByGroupNo(groupNo);
}
/**
* 更新组号详情的特证数量
* @param groupNoEntity
* @return
*/
@Override
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity) {
return groupNoMapper.updateGroupNoSpecialCount(groupNoEntity);
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.service.SpecialCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:10
*/
@Service
public class SpecialCardServiceImpl implements SpecialCardService {
@Autowired
private SpecialCardMapper specialCardMapper;
/**
* 保存特证信息
* @param specialCardEntity
* @return
*/
@Override
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity) {
return specialCardMapper.saveSpecialCard(specialCardEntity);
}
/**
* 查询快证是否存在于特证表中
* @param acceptNo 特证手里组号
* @return
*/
@Override
public List<SpecialCardEntity> selectSpecialCardAtSpecialCard(String acceptNo) {
return specialCardMapper.selectSpecialCardByAcceptNo(acceptNo);
}
/**
* 更新特证的受理类型
* @param specialCardEntity
* @return
*/
@Override
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity) {
return specialCardMapper.updateSpecialCardSpecialType(specialCardEntity);
}
}
package com.yxproject.start.service.impl;
import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.SpecialCardEntity;
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.SpecialCardMapper;
import com.yxproject.start.mapper.TaskListMapper;
import com.yxproject.start.service.TaskListService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.jws.Oneway;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -26,6 +25,8 @@ public class TaskListServiceImpl implements TaskListService {
private TaskListMapper taskListMapper;
@Autowired
private GroupNoMapper groupNoMapper;
@Autowired
private SpecialCardMapper specialCardMapper;
@Override
public List<CountCountyEntity> selectByCounty(String submitDate) {
......@@ -226,11 +227,6 @@ public class TaskListServiceImpl implements TaskListService {
list = formateMap(mapList_common);
list.addAll(mapList_fast);
list.addAll(mapList_remaind);
//todo 写逻辑0.0........
return list;
}
......@@ -297,6 +293,86 @@ public class TaskListServiceImpl implements TaskListService {
return true;
}
/**
* 查询快证在受理库信息
* @param groupNo 组号
* @return
*/
@Override
public List<Object> selectFastCardAtACCU(String groupNo) {
return taskListMapper.selectFastCardAtACCU(groupNo);
}
/**
* 保存快证任务单
* @param list
* @param submitName
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveFastTask(List<Object> list, String submitName,String acceptNo,long cardType) {
//保存普通证件信息
Map<String,Object> stringObjectMap =(Map<String,Object>)list.get(0);
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType(cardType);
taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+"");
taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId((long)0);
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)1);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity);
}
//保存快证件信息
TaskEntity fastTaskEntity = new TaskEntity();
fastTaskEntity.setCardType((long)1);
fastTaskEntity.setOldCardType(cardType);
fastTaskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+"");
fastTaskEntity.setSubmitName(submitName);
fastTaskEntity.setTaskStateId((long)1);
taskListMapper.saveFastTask(fastTaskEntity);
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
specialCardEntity.setTaskId(fastTaskEntity.getTaskId());
specialCardEntity.setSpecialType((long)2);
specialCardEntity.setInitiator(submitName);
specialCardMapper.saveSpecialCard(specialCardEntity);
return true;
}
/**
* 查询任务单详情
* @param taskId 任务单流水号
* @return
*/
@Override
public List<TaskEntity> selectTaskEntityByTaskId(long taskId) {
return taskListMapper.selectTaskEntityByTaskId(taskId);
}
/**
* 保存快证任务单
* 辅助库
* @param taskEntity
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveFastTask(TaskEntity taskEntity) {
return taskListMapper.saveFastTask(taskEntity);
}
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