Commit 6d5b7de5 by 徐高华

批量新增代办

parent eba9f8ac
...@@ -23,6 +23,8 @@ public interface PendingTaskApiService { ...@@ -23,6 +23,8 @@ public interface PendingTaskApiService {
*/ */
public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto); public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto);
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto);
/** /**
* 待办批量 活动任务 * 待办批量 活动任务
......
...@@ -10,9 +10,6 @@ import java.util.Set; ...@@ -10,9 +10,6 @@ import java.util.Set;
@Mapper @Mapper
public interface PendingTaskMapper { public interface PendingTaskMapper {
/**
*/
int deleteByPrimaryKey(Integer id);
/** /**
*/ */
...@@ -24,17 +21,9 @@ public interface PendingTaskMapper { ...@@ -24,17 +21,9 @@ public interface PendingTaskMapper {
/** /**
*/ */
TabPendingTask selectByPrimaryKey(Integer id);
/**
*/
int updateByPrimaryKeySelective(TabPendingTask record); int updateByPrimaryKeySelective(TabPendingTask record);
/** /**
*/
int updateByPrimaryKey(TabPendingTask record);
/**
* 根据关联id 查询单条 * 根据关联id 查询单条
*/ */
TabPendingTask getByRelationId(String relationId); TabPendingTask getByRelationId(String relationId);
......
...@@ -95,5 +95,7 @@ public interface PendingTaskService { ...@@ -95,5 +95,7 @@ public interface PendingTaskService {
*/ */
public boolean changeByRelationId(PendingTaskBO task); public boolean changeByRelationId(PendingTaskBO task);
public void insertPendingTaskBatch(List<PendingTaskBO> list);
} }
...@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService { ...@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService {
pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask); pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask);
return true; 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);
}
}
} }
...@@ -57,6 +57,16 @@ public class PendingTaskApiServiceImpl implements PendingTaskApiService { ...@@ -57,6 +57,16 @@ public class PendingTaskApiServiceImpl implements PendingTaskApiService {
} }
@Override @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) { public ServiceResponse<Page<PendingTaskDetailDTO>> pagePendingTask(PendingListQDTO listQDTO, BasePageInfo pageInfo) {
Page<PendingTaskBO> pendingTask = pendingTaskService.pagePendingTask(listQDTO.getEnterpriseId(), listQDTO.getStoreId() Page<PendingTaskBO> pendingTask = pendingTaskService.pagePendingTask(listQDTO.getEnterpriseId(), listQDTO.getStoreId()
, listQDTO.getClerkId(), listQDTO.getTaskType(), listQDTO.getFinishFlag() , listQDTO.getClerkId(), listQDTO.getTaskType(), listQDTO.getFinishFlag()
......
...@@ -26,16 +26,8 @@ ...@@ -26,16 +26,8 @@
overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag, overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag,
delete_flag, create_time, update_time delete_flag, create_time, update_time
</sql> </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 id="insert" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task (id, enterprise_id, relation_id, insert into tab_haoban_pending_task (id, enterprise_id, relation_id,
task_type, title, description, task_type, title, description,
...@@ -50,6 +42,7 @@ ...@@ -50,6 +42,7 @@
#{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask"> <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task insert into tab_haoban_pending_task
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -222,27 +215,7 @@ ...@@ -222,27 +215,7 @@
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </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 id="getByRelationId" resultMap="BaseResultMap">
select 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