数据同步下载问题

master
anthonywj 2 years ago
parent eda9b590d1
commit c6e36d0a79

@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
@ -13,10 +14,13 @@ import com.glxp.api.req.sync.BasicExportStatusRequest;
import com.glxp.api.req.sync.BasicExportTimeRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.sync.BasicDownloadService;
import com.glxp.api.service.sync.BasicExportService;
import com.glxp.api.service.sync.BasicExportTimeService;
import com.glxp.api.util.BeanCopyUtils;
import com.glxp.api.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -41,6 +45,8 @@ public class SpsSyncExportStatusController {
@Resource
BasicExportService basicExportService;
@Resource
BasicDownloadService basicDownloadService;
@Resource
BasicExportTimeService basicExportTimeService;
@Resource
RedisUtil redisUtil;
@ -125,7 +131,14 @@ public class SpsSyncExportStatusController {
if (StrUtil.isBlank(deleteRequest.getId())) {
throw new RuntimeException("缺少唯一标识");
}
BasicExportStatusEntity info = basicExportService.getById(deleteRequest.getId());
BasicExportStatusEntity info = new BasicExportStatusEntity();
if (deleteRequest.getDlType() != null && deleteRequest.getDlType() == 1) {
info = basicExportService.getById(deleteRequest.getId());
} else {
BasicDownloadStatusEntity basicDownloadStatusEntity = basicDownloadService.getById(deleteRequest.getId());
BeanUtils.copyProperties(basicDownloadStatusEntity, info);
}
if (info == null) {
throw new RuntimeException("数据不存在");
}

@ -11,4 +11,5 @@ public class DeleteRequest {
List<String> ids;
String billNo;
List<String> billNos;
Integer dlType; //1:同步任务2下载记录
}

@ -3,7 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.SysRoleMenuMapper">
<resultMap type="com.glxp.api.entity.auth.SysRoleMenu" id="SysRoleMenuResult">
<result property="roleId" column="role_id"/>
<result property="menuId" column="menu_id"/>
@ -15,10 +14,10 @@
SELECT *
FROM auth_role_menu
<where>
<if test="roleId != null ">
<if test="roleId != null">
and role_id = #{roleId}
</if>
<if test="menuId != null ">
<if test="menuId != null">
and menu_id = #{menuId}
</if>
</where>
@ -34,27 +33,21 @@
>
delete
from auth_role_menu
where role_id in
where role_id in
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="insertBatch" keyProperty="id" parameterType="java.util.List">
insert INTO auth_role_menu
(
role_id,menu_id
)
values
replace INTO auth_role_menu
(role_id, menu_id)
values
<foreach collection="list" item="item" index="index"
separator=",">
(
#{item.roleId},
#{item.menuId}
)
(#{item.roleId},
#{item.menuId})
</foreach>
</insert>
</mapper>

@ -388,4 +388,4 @@ CALL Pro_Temp_ColumnWork('thr_corp', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'userId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'deptId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('basic_bustype_pre', 'Id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('sup_cert', 'filePath', 'text', 2);

Loading…
Cancel
Save