Commit 6d5b7de5 by 徐高华

批量新增代办

parent eba9f8ac
......@@ -22,6 +22,8 @@ public interface PendingTaskApiService {
* @param qdto
*/
public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto);
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto);
/**
......
......@@ -10,31 +10,20 @@ import java.util.Set;
@Mapper
public interface PendingTaskMapper {
/**
*/
int deleteByPrimaryKey(Integer id);
/**
*/
int insert(TabPendingTask record);
/**
*/
int insertSelective(TabPendingTask record);
/**
*/
TabPendingTask selectByPrimaryKey(Integer id);
/**
*/
int updateByPrimaryKeySelective(TabPendingTask record);
/**
*/
int updateByPrimaryKey(TabPendingTask record);
/**
* 根据关联id 查询单条
*/
TabPendingTask getByRelationId(String relationId);
......
......@@ -95,5 +95,7 @@ public interface PendingTaskService {
*/
public boolean changeByRelationId(PendingTaskBO task);
public void insertPendingTaskBatch(List<PendingTaskBO> list);
}
......@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService {
pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask);
return true;
}
@Override
public void insertPendingTaskBatch(List<PendingTaskBO> tasks) {
if (CollectionUtils.isEmpty(tasks)) {
return ;
}
List<TabPendingTask> pendingTasks = EntityUtil.changeEntityListByJSON(TabPendingTask.class, tasks);
if(pendingTasks.size()>1000) {
int size=1000;
int len = pendingTasks.size();
int yu = len % size;
int nu = len / size+(yu>0?1:0);
for (int i=0;i<nu;i++) {
int start=i*size;
int end=(start+size)>len?(start+yu):(start+size);
List<TabPendingTask> midTask = pendingTasks.subList(start, end);
pendingTaskMapper.insertBatch(midTask);
}
}else {
pendingTaskMapper.insertBatch(pendingTasks);
}
}
}
......@@ -55,6 +55,16 @@ public class PendingTaskApiServiceImpl implements PendingTaskApiService {
pendingTaskService.addOrUpdateBatchPendingTask(list);
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto) {
if (CollectionUtils.isEmpty(qdto)) {
return ServiceResponse.success(true);
}
List<PendingTaskBO> list = EntityUtil.changeEntityListByJSON(PendingTaskBO.class, qdto);
pendingTaskService.insertPendingTaskBatch(list);
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<Page<PendingTaskDetailDTO>> pagePendingTask(PendingListQDTO listQDTO, BasePageInfo pageInfo) {
......
......@@ -26,16 +26,8 @@
overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag,
delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pending_task
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_haoban_pending_task
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task (id, enterprise_id, relation_id,
task_type, title, description,
......@@ -50,6 +42,7 @@
#{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -222,27 +215,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
update tab_haoban_pending_task
set enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
relation_id = #{relationId,jdbcType=VARCHAR},
business_id = #{businessId,jdbcType=VARCHAR},
task_type = #{taskType,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
task_status_flag = #{taskStatusFlag,jdbcType=INTEGER},
overdue_time = #{overdueTime,jdbcType=TIMESTAMP},
invalid_time = #{invalidTime,jdbcType=TIMESTAMP},
store_id = #{storeId,jdbcType=VARCHAR},
clerk_id = #{clerkId,jdbcType=VARCHAR},
finish_time = #{finishTime,jdbcType=TIMESTAMP},
finish_flag = #{finishFlag,jdbcType=INTEGER},
overdue_flag = #{overdueFlag,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getByRelationId" resultMap="BaseResultMap">
select
......
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