Commit 60a1c901 by levphon

指定授权-允许提交空数据以清空用户授权数据

1 parent 781d3818
...@@ -44,4 +44,13 @@ public interface VehiclePermitMapper extends CommonBaseMapper<VehiclePermit> { ...@@ -44,4 +44,13 @@ public interface VehiclePermitMapper extends CommonBaseMapper<VehiclePermit> {
*/ */
int deleteExistedPermit(@Param("contentIds") Collection<Long> contentIds, @Param("receiverId") Long receiverId, @Param("contentType") Integer contentType); int deleteExistedPermit(@Param("contentIds") Collection<Long> contentIds, @Param("receiverId") Long receiverId, @Param("contentType") Integer contentType);
/**
* 删除被授权人授权数据
*
* @param receiverId
* @param contentType
* @return
*/
int deletePermitByReceiverId(@Param("receiverId") Long receiverId, @Param("contentType") Integer contentType);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2034,6 +2034,7 @@ public class VehicleService { ...@@ -2034,6 +2034,7 @@ public class VehicleService {
* @param assignBO * @param assignBO
*/ */
public int assignVehicle(VehiclePermitAssignBO assignBO) { public int assignVehicle(VehiclePermitAssignBO assignBO) {
if (CollectionUtils.isNotEmpty(assignBO.getVehicleIds())) {
List<VehiclePermit> list = Lists.newArrayList(); List<VehiclePermit> list = Lists.newArrayList();
//被授权人的下级用户id(含自己) //被授权人的下级用户id(含自己)
...@@ -2096,6 +2097,11 @@ public class VehicleService { ...@@ -2096,6 +2097,11 @@ public class VehicleService {
log.info("{}剔除用户[{}] 车辆数据 {}", ShieldContextHolder.getUsername(), assignBO.getReceiverId(), delIdList); log.info("{}剔除用户[{}] 车辆数据 {}", ShieldContextHolder.getUsername(), assignBO.getReceiverId(), delIdList);
} }
return 0; return 0;
} else {
int delCnt = vehiclePermitMapper.deletePermitByReceiverId(assignBO.getReceiverId(), 0);
log.info("{}删除用户[{}] 车辆授权数据{}条", ShieldContextHolder.getUsername(), assignBO.getReceiverId(), delCnt);
return delCnt;
}
} }
public List<VehiclePermitDTO> getAssignVehicle(Long receiverId) { public List<VehiclePermitDTO> getAssignVehicle(Long receiverId) {
......
...@@ -85,4 +85,13 @@ ...@@ -85,4 +85,13 @@
#{item} #{item}
</foreach> </foreach>
</update> </update>
<update id="deletePermitByReceiverId">
update t_vehicle_permit
set del_flag = -1,
updated_date = sysdate()
where del_flag = 0
and content_type = #{contentType}
and receiver_id = #{receiverId}
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!